[Lldb-commits] [lldb] 2aec4b4 - [lldb][NFC] Don't implement ClangASTContext::SetMetadata again as a static method

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 12 02:15:53 PST 2019


Author: Raphael Isemann
Date: 2019-12-12T11:14:26+01:00
New Revision: 2aec4b4863f883e1e9e8e0362b85d37fc5fc0545

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

LOG: [lldb][NFC] Don't implement ClangASTContext::SetMetadata again as a static method

We always have an ClangASTContext when we call this method so we might as
well always call the non-static version.

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 f13567e0583c..97b151c14b91 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -132,12 +132,7 @@ class ClangASTContext : public TypeSystem {
 
   void SetMetadataAsUserID(const void *object, lldb::user_id_t user_id);
 
-  void SetMetadata(const void *object, ClangASTMetadata &meta_data) {
-    SetMetadata(getASTContext(), object, meta_data);
-  }
-
-  static void SetMetadata(clang::ASTContext *ast, const void *object,
-                          ClangASTMetadata &meta_data);
+  void SetMetadata(const void *object, ClangASTMetadata &meta_data);
 
   ClangASTMetadata *GetMetadata(const void *object) {
     return GetMetadata(getASTContext(), object);

diff  --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index e7237a39a9c2..d49c29c0a495 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1344,7 +1344,7 @@ CompilerType ClangASTContext::CreateRecordType(
 
   if (decl) {
     if (metadata)
-      SetMetadata(ast, decl, *metadata);
+      SetMetadata(decl, *metadata);
 
     if (access_type != eAccessNone)
       decl->setAccess(ConvertAccessTypeToAccessSpecifier(access_type));
@@ -1701,7 +1701,7 @@ CompilerType ClangASTContext::CreateObjCClass(const char *name,
       isInternal);
 
   if (decl && metadata)
-    SetMetadata(ast, decl, *metadata);
+    SetMetadata(decl, *metadata);
 
   return CompilerType(this, ast->getObjCInterfaceType(decl).getAsOpaquePtr());
 }
@@ -2405,10 +2405,11 @@ void ClangASTContext::SetMetadataAsUserID(const void *object,
   SetMetadata(object, meta_data);
 }
 
-void ClangASTContext::SetMetadata(clang::ASTContext *ast, const void *object,
+void ClangASTContext::SetMetadata(const void *object,
                                   ClangASTMetadata &metadata) {
   ClangExternalASTSourceCommon *external_source =
-      ClangExternalASTSourceCommon::Lookup(ast->getExternalSource());
+      ClangExternalASTSourceCommon::Lookup(
+          getASTContext()->getExternalSource());
 
   if (external_source)
     external_source->SetMetadata(object, metadata);
@@ -7662,7 +7663,7 @@ bool ClangASTContext::AddObjCClassProperty(
     return false;
 
   if (metadata)
-    ClangASTContext::SetMetadata(clang_ast, property_decl, *metadata);
+    ast->SetMetadata(property_decl, *metadata);
 
   class_interface_decl->addDecl(property_decl);
 
@@ -7745,7 +7746,7 @@ bool ClangASTContext::AddObjCClassProperty(
 
     if (getter) {
       if (metadata)
-        ClangASTContext::SetMetadata(clang_ast, getter, *metadata);
+        ast->SetMetadata(getter, *metadata);
 
       getter->setMethodParams(*clang_ast,
                               llvm::ArrayRef<clang::ParmVarDecl *>(),
@@ -7780,7 +7781,7 @@ bool ClangASTContext::AddObjCClassProperty(
 
     if (setter) {
       if (metadata)
-        ClangASTContext::SetMetadata(clang_ast, setter, *metadata);
+        ast->SetMetadata(setter, *metadata);
 
       llvm::SmallVector<clang::ParmVarDecl *, 1> params;
       params.push_back(clang::ParmVarDecl::Create(


        


More information about the lldb-commits mailing list