================
@@ -4417,7 +4417,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList 
&Args,
 
       // Use the -mcpu=? flag as the dummy input to cc1.
       Actions.clear();
-      Action *InputAc = C.MakeAction<InputAction>(*A, types::TY_C);
+      Action *InputAc = C.MakeAction<InputAction>(
+          *A, IsFlangMode() ? types::TY_Fortran : types::TY_C);
----------------
tarunprabhu wrote:

This is actually needed. 

The `-mcpu=help` argument is used as a "dummy input" (there is a comment a few 
lines above that says as much). 
The input action created here eventually gets used in `ShouldUseFlangCompiler` 
which checks if the input type is accepted by `flang`. `flang` does not accept 
inputs of type `TY_C` (even if they are "dummies"). If `ShouldUseFlangCompiler` 
returns `false`, a `cc1` command line is created - which is, obviously, not 
correct.

https://github.com/llvm/llvm-project/pull/117199
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to