[lldb][NFC] Remove implementation of GetOriginalDecl and just call GetDeclOrigin instead

Those functions have the same semantics beside some small optimization of not creating
a new empty ASTContextMetadataSP value in the metadata map. We never actually hit this
optimization according to test coverage so let's just call GetDeclOrigin instead.
This commit is contained in:
Raphael Isemann 2019-12-17 09:55:51 +01:00
parent d5b54bbfaf
commit 6e1fe4966c
1 changed files with 1 additions and 12 deletions

View File

@ -1139,16 +1139,5 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from,
clang::Decl *
ClangASTImporter::ASTImporterDelegate::GetOriginalDecl(clang::Decl *To) {
ASTContextMetadataSP to_context_md =
m_master.GetContextMetadata(&To->getASTContext());
if (!to_context_md)
return nullptr;
OriginMap::iterator iter = to_context_md->m_origins.find(To);
if (iter == to_context_md->m_origins.end())
return nullptr;
return const_cast<clang::Decl *>(iter->second.decl);
return m_master.GetDeclOrigin(To).decl;
}