summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lanza <nathan@lanza.io>2019-07-17 16:43:36 +0000
committerNathan Lanza <nathan@lanza.io>2019-07-17 16:43:36 +0000
commit3b96ebeee473c263a743066861687b320de3e6d6 (patch)
tree89ee43495ba537daa118ac2aa7c31df6c3eafb73
parent1716454027dbef52f04dc3abbb708cb73c254318 (diff)
downloadbcm5719-llvm-3b96ebeee473c263a743066861687b320de3e6d6.tar.gz
bcm5719-llvm-3b96ebeee473c263a743066861687b320de3e6d6.zip
[NativePDB] Add a FromCompilerDecl for going from lldb -> clang
Summary: A common transformation in NativePDB is to go from lldb types to clang types and vice versa. This function automates one of those steps. Differential Revision: https://reviews.llvm.org/D64851 llvm-svn: 366345
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
index eb8da2a51b6..4991be8e70c 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
@@ -1354,6 +1354,10 @@ PdbAstBuilder::ToCompilerDeclContext(clang::DeclContext &context) {
return {&m_clang, &context};
}
+clang::Decl * PdbAstBuilder::FromCompilerDecl(CompilerDecl decl) {
+ return static_cast<clang::Decl *>(decl.GetOpaqueDecl());
+}
+
clang::DeclContext *
PdbAstBuilder::FromCompilerDeclContext(CompilerDeclContext context) {
return static_cast<clang::DeclContext *>(context.GetOpaqueDeclContext());
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
index 8331abeaf47..67d024741e0 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
@@ -76,6 +76,7 @@ public:
CompilerDecl ToCompilerDecl(clang::Decl &decl);
CompilerType ToCompilerType(clang::QualType qt);
CompilerDeclContext ToCompilerDeclContext(clang::DeclContext &context);
+ clang::Decl * FromCompilerDecl(CompilerDecl decl);
clang::DeclContext *FromCompilerDeclContext(CompilerDeclContext context);
ClangASTContext &clang() { return m_clang; }
OpenPOWER on IntegriCloud