[clang] [clang-cl] Add cl compiler build deterministic options for compatibility. (PR #194779)

Daniel Paoliello via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 12:11:24 PDT 2026


================
@@ -8821,6 +8783,39 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
     CmdArgs.push_back(Args.MakeArgString(
         Twine("-loader-replaceable-function=") + FuncOverride));
   }
+
+  if (Args.hasArg(options::OPT__SLASH_experimental_deterministic)) {
+    CmdArgs.push_back("-Wdate-time");
+
+    if (Args.hasArg(options::OPT_mincremental_linker_compatible)) {
+      D.Diag(diag::err_drv_argument_not_allowed_with)
+          << "/experimental:deterministic"
+          << "/Brepro-";
+    }
+    // CL's sets COFF's OBJ timestamp to a hash of the source file path to get
----------------
dpaoliello wrote:

But we lose incremental linking? Is this the same as MSVC, or is there a way in LLVM to stamp a hash as well?

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


More information about the cfe-commits mailing list