[flang-commits] [clang] [flang] [Flang][Driver]Add support for option '-fpseudo-probe-for-profiling' in flang (PR #205046)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Mon Jun 22 07:31:45 PDT 2026


================
@@ -488,6 +488,10 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
   opts.SampleProfileFile =
       args.getLastArgValue(clang::options::OPT_fprofile_sample_use_EQ);
 
+  if (args.hasFlag(clang::options::OPT_fpseudo_probe_for_profiling,
+                   clang::options::OPT_fno_pseudo_probe_for_profiling, false))
+    opts.PseudoProbeForProfiling = 1;
+
----------------
tarunprabhu wrote:

Unlike clang, in flang, even single-statement conditionals require braces. Admittedly, this particular file is inconsistent, and flang's style guide does allow for exceptions, but probably best to stick with the default here

```suggestion
  if (args.hasFlag(clang::options::OPT_fpseudo_probe_for_profiling,
                   clang::options::OPT_fno_pseudo_probe_for_profiling, false)) {
    opts.PseudoProbeForProfiling = 1;
  }
```

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


More information about the flang-commits mailing list