aboutsummaryrefslogtreecommitdiff
path: root/source/Symbol/ClangASTImporter.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
committerEd Maste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
commitf21a844f60ae6c74fcf1fddca32461acce3c1ee0 (patch)
tree56d79f94966870db1cecd65a7264510a25fd1cba /source/Symbol/ClangASTImporter.cpp
parent37d22554be9f5a677dad2a95b7ef22fe59c66a8a (diff)
Notes
Diffstat (limited to 'source/Symbol/ClangASTImporter.cpp')
-rw-r--r--source/Symbol/ClangASTImporter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/Symbol/ClangASTImporter.cpp b/source/Symbol/ClangASTImporter.cpp
index 152949620450..afdca97ece27 100644
--- a/source/Symbol/ClangASTImporter.cpp
+++ b/source/Symbol/ClangASTImporter.cpp
@@ -716,3 +716,18 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to)
return clang::ASTImporter::Imported(from, to);
}
+
+clang::Decl *ClangASTImporter::Minion::GetOriginalDecl (clang::Decl *To)
+{
+ ASTContextMetadataSP to_context_md = m_master.GetContextMetadata(&To->getASTContext());
+
+ if (!to_context_md)
+ return NULL;
+
+ OriginMap::iterator iter = to_context_md->m_origins.find(To);
+
+ if (iter == to_context_md->m_origins.end())
+ return NULL;
+
+ return const_cast<clang::Decl*>(iter->second.decl);
+}