summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-12-22 00:04:00 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-12-22 00:04:00 +0000
commit5c9cd7a8a3e823f8ee72592f95ba1a406dfc7e6a (patch)
treeab3d89c70cfad127de8b410dbd59ab4dbea1f970 /clang/lib/CodeGen/CGExprConstant.cpp
parent2aa433398a72949ebf14c2189d3b82734249ac2a (diff)
downloadbcm5719-llvm-5c9cd7a8a3e823f8ee72592f95ba1a406dfc7e6a.tar.gz
bcm5719-llvm-5c9cd7a8a3e823f8ee72592f95ba1a406dfc7e6a.zip
Fix a failure (which led to a crash) in constant emission code with vector compound literals.
llvm-svn: 147111
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 48eda17b7a8..136b7139108 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -870,7 +870,8 @@ public:
// Note that due to the nature of compound literals, this is guaranteed
// to be the only use of the variable, so we just generate it here.
CompoundLiteralExpr *CLE = cast<CompoundLiteralExpr>(E);
- llvm::Constant* C = Visit(CLE->getInitializer());
+ llvm::Constant* C = CGM.EmitConstantExpr(CLE->getInitializer(),
+ CLE->getType(), CGF);
// FIXME: "Leaked" on failure.
if (C)
C = new llvm::GlobalVariable(CGM.getModule(), C->getType(),
OpenPOWER on IntegriCloud