[NFC] Remove unused Sema::DirectModuleImports
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 20 Feb 2023 07:07:07 +0000 (15:07 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 20 Feb 2023 07:07:49 +0000 (15:07 +0800)
Sema::DirectModuleImports is not used now. Remove it for clearness.

clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaModule.cpp

index 3e177ba..a6b1102 100644 (file)
@@ -2279,9 +2279,6 @@ private:
   /// The global module fragment of the current translation unit.
   clang::Module *GlobalModuleFragment = nullptr;
 
-  /// The modules we imported directly.
-  llvm::SmallPtrSet<clang::Module *, 8> DirectModuleImports;
-
   /// Namespace definitions that we will export when they finish.
   llvm::SmallPtrSet<const NamespaceDecl*, 8> DeferredExportedNamespaces;
 
@@ -2332,10 +2329,6 @@ public:
     return Entity->getOwningModule();
   }
 
-  bool isModuleDirectlyImported(const Module *M) {
-    return DirectModuleImports.contains(M);
-  }
-
   // Determine whether the module M belongs to the  current TU.
   bool isModuleUnitOfCurrentTU(const Module *M) const;
 
index f1c4090..f03d982 100644 (file)
@@ -602,11 +602,6 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
     Diag(ExportLoc, diag::err_export_not_in_module_interface);
   }
 
-  // In some cases we need to know if an entity was present in a directly-
-  // imported module (as opposed to a transitive import).  This avoids
-  // searching both Imports and Exports.
-  DirectModuleImports.insert(Mod);
-
   return Import;
 }