diff options
author | John McCall <rjmccall@apple.com> | 2010-05-03 21:39:56 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-03 21:39:56 +0000 |
commit | e65ce966b6865b686b0a9ba4fc72dfadf3e83701 (patch) | |
tree | 73a08eca146d45e846c98a8a311d18d68f2c5208 /lib/CodeGen/CGDecl.cpp | |
parent | a36f3ed3f19ebd78432d967325e9157ec02e1bdf (diff) |
Just bail out immediately when emitting an unreachable function-local static
variable. Surprisingly, this does seem to be the right way to solve this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102961 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 98a449ad76..244a5323d4 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -231,6 +231,9 @@ CodeGenFunction::AddInitializerToGlobalBlockVarDecl(const VarDecl &D, void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage) { + // Bail out early if the block is unreachable. + if (!Builder.GetInsertBlock()) return; + llvm::Value *&DMEntry = LocalDeclMap[&D]; assert(DMEntry == 0 && "Decl already exists in localdeclmap!"); |