[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
This commit is contained in:
Nathan Lanza 2019-07-17 16:43:36 +00:00
parent 1716454027
commit 3b96ebeee4
2 changed files with 5 additions and 0 deletions

View File

@ -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());

View File

@ -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; }