summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-10-01 22:29:41 +0000
committerMike Stump <mrs@apple.com>2009-10-01 22:29:41 +0000
commit017460ab6c6550395e17763bd62d449586f79ab9 (patch)
tree800803f74dea217855857c5462b6a2ba565678cd /clang/lib/CodeGen/CGDebugInfo.cpp
parent1cc6dd97dac3da3605aa5e71362f24e9a6c10db5 (diff)
downloadbcm5719-llvm-017460ab6c6550395e17763bd62d449586f79ab9.tar.gz
bcm5719-llvm-017460ab6c6550395e17763bd62d449586f79ab9.zip
Implement a FIXME. This improves codegen just a tad.
llvm-svn: 83221
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 645125667c9..0b386841f19 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1088,7 +1088,7 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
// The llvm optimizer and code generator are not yet ready to support
// optimized code debugging.
const CompileOptions &CO = M->getCompileOpts();
- if (CO.OptimizationLevel)
+ if (CO.OptimizationLevel || Builder.GetInsertBlock() == 0)
return;
uint64_t XOffset = 0;
@@ -1269,7 +1269,7 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
Decl->getNameAsString(), Unit, Line, Ty,
addr);
// Insert an llvm.dbg.declare into the current block.
- DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());
+ DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertPoint());
}
void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *Decl,
OpenPOWER on IntegriCloud