================
@@ -1056,8 +1056,20 @@ void Clang::AddPreprocessingOptions(Compilation &C, 
const JobAction &JA,
         DepFile = getDependencyFileName(Args, Inputs);
         C.addFailureResultFile(DepFile, &JA);
       }
-      CmdArgs.push_back("-dependency-file");
-      CmdArgs.push_back(DepFile);
+      // for host compile, if OPT_MMMD is on, default to create *.d.host file
+      // and merge it with *.d (kernel dep) file in DependencyFile.cpp
+      Arg *ArgMMD = Args.getLastArg(options::OPT_MMMD);
+      auto at = getToolChain().getAuxTriple();
+      if (ArgMMD && !at && std::string(DepFile) != "-") {
+        SmallString<128> NewDepFile(DepFile);
+        NewDepFile.append(".host");
----------------
zhouronghua wrote:

this patten of ".host" is an interface for 
DependencyFileGenerator::outputDependencyFile
so if we chang it to some CUID, we now do not get any good way to let host 
compiler know if we need to merge two or more dep file.
I will think over it, and try to find some way to fixed it.

https://github.com/llvm/llvm-project/pull/119513
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to