[flang-commits] [clang] [flang] [FLANG][Driver] Support -fno-profile-generate and -fprofile-generate=<dir> in flang (PR #216643)

Kaviya Rajendiran via flang-commits flang-commits at lists.llvm.org
Tue Aug 18 00:47:02 PDT 2026


================
@@ -497,8 +497,18 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
       opts.IsPIE = 1;
   }
 
-  if (args.hasArg(clang::options::OPT_fprofile_generate)) {
-    opts.setProfileInstr(llvm::driver::ProfileInstrKind::ProfileIRInstr);
+  if (const llvm::opt::Arg *a =
----------------
kaviya2510 wrote:

The implementation in this PR, the driver accepts `-fno-profile-generate` option but does not forward it to -fc1. However, I still handled the option in `CompilerInvocation.cpp` so that a direct `-fc1 -fno-profile-generate` invocation does not result in an "unknown argument" error.

Before proceeding further, I would like to understand the intended design for such options. Once we align on the expected behavior, I will  update the implementation accordingly.

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


More information about the flang-commits mailing list