[clang] Deprecate order file instrumentation (PR #121514)

Ellis Hoag via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 18:59:16 PST 2025


================
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     }
   }
 
-  if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
-     CmdArgs.push_back("-forder-file-instrumentation");
-     // Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
-     // on, we need to pass these flags as linker flags and that will be handled
-     // outside of the compiler.
-     if (!IsUsingLTO) {
-       CmdArgs.push_back("-mllvm");
-       CmdArgs.push_back("-enable-order-file-instrumentation");
-     }
+  if (const Arg *A =
+          Args.getLastArg(options::OPT_forder_file_instrumentation)) {
+    D.Diag(diag::warn_drv_deprecated_arg)
+        << A->getAsString(Args) << /*hasReplacement=*/true
+        << "-mllvm -pgo-temporal-instrumentation";
----------------
ellishg wrote:

These flags are extensively documented in this [RFC](https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068/7) and this [EuroLLVM talk](https://youtu.be/yd4pbSTjwuA). And LLVM options do have descriptions like clang frontend flags. I think it might be overkill to turn this into a frontend flag.

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


More information about the cfe-commits mailing list