diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index c2040587633..f851be737df 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -745,10 +745,7 @@ public: return *get(); } - DIScope getContext() const { return getScope(); } - unsigned getLineNumber() const { return getScope().getLineNumber(); } - unsigned getColumnNumber() const { return getScope().getColumnNumber(); } - DILexicalBlock getScope() const { return DILexicalBlock(get()->getScope()); } + DIScope getContext() const { return get()->getScope(); } unsigned getDiscriminator() const { return get()->getDiscriminator(); } }; @@ -1050,11 +1047,9 @@ public: // Since discriminators are associated with lexical blocks, make // sure this location is a lexical block before retrieving its // value. - return getScope().isLexicalBlockFile() - ? DILexicalBlockFile( - cast(cast(DbgNode)->getScope())) - .getDiscriminator() - : 0; + if (auto *F = dyn_cast(get()->getScope())) + return F->getDiscriminator(); + return 0; } /// \brief Generate a new discriminator value for this location. diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 1ad9dcae3ad..8ae2bcb8485 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -498,9 +498,6 @@ void DebugInfoFinder::processScope(DIScope Scope) { if (Scope.isLexicalBlock()) { DILexicalBlock LB(Scope); processScope(LB.getContext()); - } else if (Scope.isLexicalBlockFile()) { - DILexicalBlockFile LBF = DILexicalBlockFile(Scope); - processScope(LBF.getScope()); } else if (Scope.isNameSpace()) { DINameSpace NS(Scope); processScope(NS.getContext());