diff options
author | Devang Patel <dpatel@apple.com> | 2011-06-04 00:38:02 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-06-04 00:38:02 +0000 |
commit | 1b291b22d0f41dbe5771b9f75cab322fc3e87529 (patch) | |
tree | 7a0e653aa0e8867eeddf71259c42c580c5bd4fcd /clang/lib/CodeGen | |
parent | fb02cec44e89f53dbb6b87fb774c1d6727a3df83 (diff) | |
download | bcm5719-llvm-1b291b22d0f41dbe5771b9f75cab322fc3e87529.tar.gz bcm5719-llvm-1b291b22d0f41dbe5771b9f75cab322fc3e87529.zip |
Rework r132576.
Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way.
llvm-svn: 132610
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 048289e5067..8a1a8536dab 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -632,8 +632,6 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { if (HaveInsertPoint()) if (CGDebugInfo *DI = getDebugInfo()) { DI->setLocation(D.getLocation()); - DI->UpdateLineDirectiveRegion(Builder); - DI->EmitStopPoint(Builder); if (Target.useGlobalsForAutomaticVariables()) { DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D); } else diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 5f660f88587..782ff061606 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -771,6 +771,11 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) { } void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) { + // As long as debug info is modeled with instructions, we have to ensure we + // have a place to insert here and write the stop point here. + if (getDebugInfo() && HaveInsertPoint()) + EmitStopPoint(&S); + for (DeclStmt::const_decl_iterator I = S.decl_begin(), E = S.decl_end(); I != E; ++I) EmitDecl(**I); |