[Lldb-commits] [lldb] r373337 - [lldb][NFC] Remove unused ClangASTContext::GetHasExternalStorage

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 1 06:25:25 PDT 2019


Author: teemperor
Date: Tue Oct  1 06:25:25 2019
New Revision: 373337

URL: http://llvm.org/viewvc/llvm-project?rev=373337&view=rev
Log:
[lldb][NFC] Remove unused ClangASTContext::GetHasExternalStorage

This code isn't used nor tested.

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

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=373337&r1=373336&r2=373337&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Oct  1 06:25:25 2019
@@ -862,7 +862,6 @@ public:
   static bool SetHasExternalStorage(lldb::opaque_compiler_type_t type,
                                     bool has_extern);
 
-  static bool GetHasExternalStorage(const CompilerType &type);
   // Tag Declarations
   static bool StartTagDeclarationDefinition(const CompilerType &type);
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=373337&r1=373336&r2=373337&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Oct  1 06:25:25 2019
@@ -8721,74 +8721,6 @@ clang::ObjCMethodDecl *ClangASTContext::
   return objc_method_decl;
 }
 
-bool ClangASTContext::GetHasExternalStorage(const CompilerType &type) {
-  if (ClangUtil::IsClangType(type))
-    return false;
-
-  clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));
-
-  const clang::Type::TypeClass type_class = qual_type->getTypeClass();
-  switch (type_class) {
-  case clang::Type::Record: {
-    clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
-    if (cxx_record_decl)
-      return cxx_record_decl->hasExternalLexicalStorage() ||
-             cxx_record_decl->hasExternalVisibleStorage();
-  } break;
-
-  case clang::Type::Enum: {
-    clang::EnumDecl *enum_decl =
-        llvm::cast<clang::EnumType>(qual_type)->getDecl();
-    if (enum_decl)
-      return enum_decl->hasExternalLexicalStorage() ||
-             enum_decl->hasExternalVisibleStorage();
-  } break;
-
-  case clang::Type::ObjCObject:
-  case clang::Type::ObjCInterface: {
-    const clang::ObjCObjectType *objc_class_type =
-        llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
-    assert(objc_class_type);
-    if (objc_class_type) {
-      clang::ObjCInterfaceDecl *class_interface_decl =
-          objc_class_type->getInterface();
-
-      if (class_interface_decl)
-        return class_interface_decl->hasExternalLexicalStorage() ||
-               class_interface_decl->hasExternalVisibleStorage();
-    }
-  } break;
-
-  case clang::Type::Typedef:
-    return GetHasExternalStorage(CompilerType(
-        type.GetTypeSystem(), llvm::cast<clang::TypedefType>(qual_type)
-                                  ->getDecl()
-                                  ->getUnderlyingType()
-                                  .getAsOpaquePtr()));
-
-  case clang::Type::Auto:
-    return GetHasExternalStorage(CompilerType(
-        type.GetTypeSystem(), llvm::cast<clang::AutoType>(qual_type)
-                                  ->getDeducedType()
-                                  .getAsOpaquePtr()));
-
-  case clang::Type::Elaborated:
-    return GetHasExternalStorage(CompilerType(
-        type.GetTypeSystem(), llvm::cast<clang::ElaboratedType>(qual_type)
-                                  ->getNamedType()
-                                  .getAsOpaquePtr()));
-
-  case clang::Type::Paren:
-    return GetHasExternalStorage(CompilerType(
-        type.GetTypeSystem(),
-        llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()));
-
-  default:
-    break;
-  }
-  return false;
-}
-
 bool ClangASTContext::SetHasExternalStorage(lldb::opaque_compiler_type_t type,
                                             bool has_extern) {
   if (!type)




More information about the lldb-commits mailing list