Fix PR10204 in a better way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133943 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 5bdb016..a3f8301 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -791,9 +791,7 @@
return RValue::get(EmitARCLoadWeak(LV.getAddress()));
if (LV.isSimple()) {
- // Functions are l-values that don't require loading.
- if (LV.getType()->isFunctionType())
- return RValue::get(LV.getAddress());
+ assert(!LV.getType()->isFunctionType());
// Everything needs a load.
return RValue::get(EmitLoadOfScalar(LV));