From: Daniel Dunbar Date: Sun, 19 Jul 2009 07:03:11 +0000 (+0000) Subject: Fix thinko. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25b6ebf0f8c07514250ec76c987f84b6810d4d17;p=clang Fix thinko. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76362 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 6da8649b0a..47727f2d36 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -325,10 +325,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { // Emit debug info for local var declaration. if (CGDebugInfo *DI = getDebugInfo()) { - // FIXME: Remove this once debug info isn't modeled as instructions. - EnsureInsertPoint(); - - EmitStopPoint(S); + assert(HaveInsertPoint() && "Unexpected unreachable point!"); DI->setLocation(D.getLocation()); if (Target.useGlobalsForAutomaticVariables()) { diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 0999947881..4e6ec82eb5 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -525,6 +525,13 @@ 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()) { + EnsureInsertPoint(); + EmitStopPoint(&S); + } + for (DeclStmt::const_decl_iterator I = S.decl_begin(), E = S.decl_end(); I != E; ++I) EmitDecl(**I);