[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 01:17:06 PDT 2023


================
@@ -666,13 +666,19 @@ static StringRef makeAbsoluteAndPreferred(CompilerInstance &CI, StringRef Path,
 }
 
 void ModuleDepCollector::addFileDep(StringRef Path) {
-  llvm::SmallString<256> Storage;
-  Path = makeAbsoluteAndPreferred(ScanInstance, Path, Storage);
+  // Within P1689 format, we don't want all the paths to be absolute path
+  // since it may violate the tranditional make style dependencies info.
+  if (!IsStdModuleP1689Format) {
+    llvm::SmallString<256> Storage;
+    Path = makeAbsoluteAndPreferred(ScanInstance, Path, Storage);
+  }
   FileDeps.push_back(std::string(Path));
----------------
ChuanqiXu9 wrote:

Done. Thanks for your catch!

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


More information about the cfe-commits mailing list