summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-02-16 23:59:08 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-02-16 23:59:08 +0000
commit8d2226208d1717ddc34c63707d2ffcfc6f1d21b6 (patch)
treede27cedd72d7b180786ca6eebab0a8cb90500348 /clang/lib
parent197fcd44188b6923a515ac8a9798501af165cd8f (diff)
downloadbcm5719-llvm-8d2226208d1717ddc34c63707d2ffcfc6f1d21b6.tar.gz
bcm5719-llvm-8d2226208d1717ddc34c63707d2ffcfc6f1d21b6.zip
Ensure that the NRVO flag has some block to insert into. Fixes PR9178!
llvm-svn: 125694
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index c31840a78e2..129416fa07f 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -648,7 +648,8 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D,
// to this variable. Set it to zero to indicate that NRVO was not
// applied.
llvm::Value *Zero = Builder.getFalse();
- NRVOFlag = CreateTempAlloca(Zero->getType(), "nrvo");
+ NRVOFlag = CreateTempAlloca(Zero->getType(), "nrvo");
+ EnsureInsertPoint();
Builder.CreateStore(Zero, NRVOFlag);
// Record the NRVO flag for this variable.
OpenPOWER on IntegriCloud