diff options
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 14 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-line.cpp | 10 | 
3 files changed, 11 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 85368882e6d..9f993b804fe 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2628,20 +2628,6 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,    if (CurLoc.isInvalid() || CurLoc.isMacroID())      return; -  // Don't bother if things are the same as last time. -  SourceManager &SM = CGM.getContext().getSourceManager(); -  assert(!LexicalBlockStack.empty()); -  if (CurLoc == PrevLoc || -      SM.getExpansionLoc(CurLoc) == SM.getExpansionLoc(PrevLoc)) -    // New Builder may not be in sync with CGDebugInfo. -    if (!Builder.getCurrentDebugLocation().isUnknown() && -        Builder.getCurrentDebugLocation().getScope(CGM.getLLVMContext()) == -            LexicalBlockStack.back()) -      return; - -  // Update last state. -  PrevLoc = CurLoc; -    llvm::MDNode *Scope = LexicalBlockStack.back();    Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(        getLineNumber(CurLoc), getColumnNumber(CurLoc, ForceColumnInfo), Scope)); diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 274cbc4f365..92af27e4cc9 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -53,7 +53,7 @@ class CGDebugInfo {    const CodeGenOptions::DebugInfoKind DebugKind;    llvm::DIBuilder DBuilder;    llvm::DICompileUnit TheCU; -  SourceLocation CurLoc, PrevLoc; +  SourceLocation CurLoc;    llvm::DIType VTablePtrType;    llvm::DIType ClassTy;    llvm::DICompositeType ObjTy; diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp index 714f8953330..a4dff576efc 100644 --- a/clang/test/CodeGenCXX/debug-info-line.cpp +++ b/clang/test/CodeGenCXX/debug-info-line.cpp @@ -130,6 +130,15 @@ void f12() {    f12_2();  } +// CHECK-LABEL: define +void f13() { +// CHECK: call {{.*}} !dbg [[DBG_F13:!.*]] +#define F13_IMPL 1, src() +  1, +#line 1400 +  F13_IMPL; +} +  // CHECK: [[DBG_F1]] = !{i32 100,  // CHECK: [[DBG_FOO_VALUE]] = !{i32 200,  // CHECK: [[DBG_FOO_REF]] = !{i32 202, @@ -146,3 +155,4 @@ void f12() {  // CHECK: [[DBG_F10_STORE]] = !{i32 1100,  // CHECK: [[DBG_F11]] = !{i32 1200,  // CHECK: [[DBG_F12]] = !{i32 1300, +// CHECK: [[DBG_F13]] = !{i32 1400,  | 

