forked from OSchip/llvm-project
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
This commit is contained in:
parent
fb02cec44e
commit
1b291b22d0
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue