diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-02-16 23:59:08 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-02-16 23:59:08 +0000 |
commit | a03733b28b7c0a6dde83561a8a391c1067f404a5 (patch) | |
tree | 51ae419b939533ba2d85b3cd01011e8795210d82 /lib/CodeGen/CGDecl.cpp | |
parent | c71a2c0ce03ec74391ff2b43b0a966860f23786e (diff) |
Ensure that the NRVO flag has some block to insert into. Fixes PR9178!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index c31840a78e..129416fa07 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/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. |