diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index fec1c33b4e5..c12e2949bf1 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2537,7 +2537,8 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, /// information in the source file. If the location is invalid, the /// previous location will be reused. void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc, - bool ForceColumnInfo) { + bool ForceColumnInfo, + llvm::MDNode *ForceScope) { // Update our current location setLocation(Loc); @@ -2556,7 +2557,7 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc, // Update last state. PrevLoc = CurLoc; - llvm::MDNode *Scope = LexicalBlockStack.back(); + llvm::MDNode *Scope = ForceScope ? ForceScope : &*LexicalBlockStack.back(); Builder.SetCurrentDebugLocation(llvm::DebugLoc::get (getLineNumber(CurLoc), getColumnNumber(CurLoc, ForceColumnInfo), |