diff options
| author | Sean Callanan <scallanan@apple.com> | 2013-10-09 22:33:34 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2013-10-09 22:33:34 +0000 |
| commit | 931a0def9e4f1f1d326f2bf2fe54f76a3f98487e (patch) | |
| tree | b545fc1f3a1869a1371aa7610dd71dac0684bd67 /lldb/source/Symbol/ClangASTImporter.cpp | |
| parent | 4c3261d1b3bfa47870ad0eb23e07306754c4c0f7 (diff) | |
| download | bcm5719-llvm-931a0def9e4f1f1d326f2bf2fe54f76a3f98487e.tar.gz bcm5719-llvm-931a0def9e4f1f1d326f2bf2fe54f76a3f98487e.zip | |
Implemented the reverse-lookup API in the AST
importer to avoid duplicate imports of anonymous
structs.
<rdar://problem/14421722>
llvm-svn: 192327
Diffstat (limited to 'lldb/source/Symbol/ClangASTImporter.cpp')
| -rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index 15294962045..afdca97ece2 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/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); +} |

