return getASTContext().getTranslationUnitDecl();
}
- static clang::Decl *CopyDecl(clang::ASTContext *dest_context,
- clang::ASTContext *source_context,
- clang::Decl *source_decl);
-
static bool AreTypesSame(CompilerType type1, CompilerType type2,
bool ignore_qualifiers = false);
return CompilerType(this, ast.getPointerType(char_type).getAsOpaquePtr());
}
-clang::Decl *ClangASTContext::CopyDecl(ASTContext *dst_ast, ASTContext *src_ast,
- clang::Decl *source_decl) {
- FileSystemOptions file_system_options;
- FileManager file_manager(file_system_options);
- ASTImporter importer(*dst_ast, file_manager, *src_ast, file_manager, false);
-
- if (llvm::Expected<clang::Decl *> ret_or_error =
- importer.Import(source_decl)) {
- return *ret_or_error;
- } else {
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
- LLDB_LOG_ERROR(log, ret_or_error.takeError(), "Couldn't import decl: {0}");
- return nullptr;
- }
-}
-
bool ClangASTContext::AreTypesSame(CompilerType type1, CompilerType type2,
bool ignore_qualifiers) {
ClangASTContext *ast =