[clang] [clang][deps] Consolidate types into new `DependencyGraph.h` (PR #197567)

Naveen Seth Hanig via cfe-commits cfe-commits at lists.llvm.org
Thu May 14 04:03:26 PDT 2026


================
@@ -19,24 +19,12 @@
 using namespace clang;
 using namespace dependencies;
 
-void ModuleDeps::forEachFileDep(llvm::function_ref<void(StringRef)> Cb) const {
-  SmallString<0> PathBuf;
-  PathBuf.reserve(256);
-  for (StringRef FileDep : FileDeps) {
-    auto ResolvedFileDep =
-        ASTReader::ResolveImportedPath(PathBuf, FileDep, FileDepsBaseDir);
-    Cb(*ResolvedFileDep);
-  }
-}
-
-const std::vector<std::string> &ModuleDeps::getBuildArguments() const {
-  // FIXME: this operation is not thread safe and is expected to be called
-  // on a single thread. Otherwise it should be protected with a lock.
-  assert(!std::holds_alternative<std::monostate>(BuildInfo) &&
-         "Using uninitialized ModuleDeps");
-  if (const auto *CI = std::get_if<CowCompilerInvocation>(&BuildInfo))
-    BuildInfo = CI->getCC1CommandLine();
-  return std::get<std::vector<std::string>>(BuildInfo);
+PrebuiltModuleDep createPrebuiltModuleDep(const serialization::ModuleFile *MF) {
----------------
naveen-seth wrote:

I think this should be made static for internal linkage. Otherwise, LGTM!

https://github.com/llvm/llvm-project/pull/197567


More information about the cfe-commits mailing list