[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Sat May 31 11:42:40 PDT 2025


================
@@ -614,3 +614,30 @@ nvfortran defines `-fast` as
  - `-Mcache_align`: there is no equivalent flag in Flang or Clang.
  - `-Mflushz`: flush-to-zero mode - when `-ffast-math` is specified, Flang will
    link to `crtfastmath.o` to ensure denormal numbers are flushed to zero.
+
+
+## FCC_OVERRIDE_OPTIONS
+
+The environment variable `FCC_OVERRIDE_OPTIONS` can be used to edit flang's
+command line arguments. The value of this variable is a space-separated list of
+edits to perform. The edits are applied in the order in which they appear in
+`FCC_OVERRIDE_OPTIONS`. Each edit should be one of the following forms:
+
+- `#`: Silence information about the changes to the command line arguments.
+
+- `^FOO`: Add `FOO` as a new argument at the beginning of the command line.
----------------
MaskRay wrote:

For `clang a.cc`, this actually adds `FOO` after `clang`.  The comment in clang/lib/Driver/Driver.cpp and this description probably should be made more accurate.

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


More information about the cfe-commits mailing list