diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-01-02 19:06:25 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-01-02 19:06:25 +0000 |
| commit | ba90b04b7bbbaa88dc0bbef341d62cf454041230 (patch) | |
| tree | 667ace81d52b3d5159b3e096a62c945e53385182 /clang/lib/CodeGen | |
| parent | 434fedb8d8eec0d5d9e904fcb9a9f1c8d2a8513b (diff) | |
| download | bcm5719-llvm-ba90b04b7bbbaa88dc0bbef341d62cf454041230.tar.gz bcm5719-llvm-ba90b04b7bbbaa88dc0bbef341d62cf454041230.zip | |
DebugInfo: Fix cases where location failed to be updated after r225000
The optimization (that appears to have been here since the earliest
implementation (r50848) & has become more complicated over the years) to
avoid recreating the debugloc if it would be the same was out of date
because ApplyDebugLocation was not re-updating the CurLoc/PrevLoc. This
optimization doesn't look terribly beneficial/necessary, so I'm removing
it - if it turns up in benchmarks, I'm happy to reconsider/reimplement
this with justification, but for now it just seems to add
complexity/problems.
llvm-svn: 225083
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 14 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 2 |
2 files changed, 1 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; |

