[Lldb-commits] [lldb] a175c6a - [lldb][NFC] Remove wrong and unused ClangASTContext::CopyDecl method

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 23 03:11:52 PST 2019


Author: Raphael Isemann
Date: 2019-12-23T12:11:26+01:00
New Revision: a175c6a6f6bd98a5afc3bb90b41362e812134309

URL: https://github.com/llvm/llvm-project/commit/a175c6a6f6bd98a5afc3bb90b41362e812134309
DIFF: https://github.com/llvm/llvm-project/commit/a175c6a6f6bd98a5afc3bb90b41362e812134309.diff

LOG: [lldb][NFC] Remove wrong and unused ClangASTContext::CopyDecl method

Added: 
    

Modified: 
    lldb/include/lldb/Symbol/ClangASTContext.h
    lldb/source/Symbol/ClangASTContext.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index c2c3726e48b5..255a9af17bbb 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -171,10 +171,6 @@ class ClangASTContext : public TypeSystem {
     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);
 

diff  --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 65d73d5f6828..ae5fe561528b 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1153,22 +1153,6 @@ CompilerType ClangASTContext::GetCStringType(bool is_const) {
   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 =


        


More information about the lldb-commits mailing list