summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-06-27 19:46:54 +0000
committerNico Weber <nicolasweber@gmx.de>2011-06-27 19:46:54 +0000
commit8aba2d8014bacc5d8ef36202e49f3e6cc8c95491 (patch)
treed393893486ff1228702e9503fd3b2df684d7cb22 /clang/lib/CodeGen/CGExpr.cpp
parentd289104e292162c9a7b5094942aadfd855a34d3a (diff)
downloadbcm5719-llvm-8aba2d8014bacc5d8ef36202e49f3e6cc8c95491.tar.gz
bcm5719-llvm-8aba2d8014bacc5d8ef36202e49f3e6cc8c95491.zip
Revert parts of r133860 to fix a crash. Add a test.
llvm-svn: 133931
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index a3f8301578f..5bdb016738b 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -791,7 +791,9 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV) {
return RValue::get(EmitARCLoadWeak(LV.getAddress()));
if (LV.isSimple()) {
- assert(!LV.getType()->isFunctionType());
+ // Functions are l-values that don't require loading.
+ if (LV.getType()->isFunctionType())
+ return RValue::get(LV.getAddress());
// Everything needs a load.
return RValue::get(EmitLoadOfScalar(LV));
OpenPOWER on IntegriCloud