[clang] beebad9 - [clang][deps] NFC: Remove dead code

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 24 09:49:49 PST 2023


Author: Jan Svoboda
Date: 2023-01-24T09:49:22-08:00
New Revision: beebad9a9b230d9c491e7e09a892689dc23240aa

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

LOG: [clang][deps] NFC: Remove dead code

This patch removes some dead code in the dependency scanner.

The `ModuleDeps::ImplicitModulePCMPath` member stopped being used in D131934.

The strict context hash was replaced in D129884 by hash of the canonical command line.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D142416

Added: 
    

Modified: 
    clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
    clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
index fd6db992d42f1..6e4cec25961de 100644
--- a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
+++ b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
@@ -88,9 +88,6 @@ struct ModuleDeps {
   /// additionally appear in \c FileDeps as a dependency.
   std::string ClangModuleMapFile;
 
-  /// The path to where an implicit build would put the PCM for this module.
-  std::string ImplicitModulePCMPath;
-
   /// A collection of absolute paths to files that this module directly depends
   /// on, not including transitive dependencies.
   llvm::StringSet<> FileDeps;

diff  --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index 9ad8b17bafebd..cb1c66b8d63f7 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -169,14 +169,6 @@ ModuleDepCollector::makeInvocationForModuleBuildWithoutOutputs(
 
   Optimize(CI);
 
-  // The original invocation probably didn't have strict context hash enabled.
-  // We will use the context hash of this invocation to distinguish between
-  // multiple incompatible versions of the same module and will use it when
-  // reporting dependencies to the clients. Let's make sure we're using
-  // **strict** context hash in order to prevent accidental sharing of
-  // incompatible modules (e.g. with 
diff erences in search paths).
-  CI.getHeaderSearchOpts().ModulesStrictContextHash = true;
-
   return CI;
 }
 
@@ -413,7 +405,6 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
 
   MD.ID.ModuleName = M->getFullModuleName();
   MD.ImportedByMainFile = DirectModularDeps.contains(M);
-  MD.ImplicitModulePCMPath = std::string(M->getASTFile()->getName());
   MD.IsSystem = M->IsSystem;
 
   ModuleMap &ModMapInfo =


        


More information about the cfe-commits mailing list