[cfe-dev] RFC: Fortran optoins in Clang

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 9 01:56:03 PDT 2021


On 08/04/2021 19:28, Andrzej Warzynski via cfe-dev wrote:
> Hi Joerg,
> 
> On 08/04/2021 17:44, Joerg Sonnenberger via cfe-dev wrote:
>>
>> I think warning and codegen options should be claimed only if the
>> corresponding language frontend is actually active. I think we have some
>> existing cases for that with Objective-C and C++ interaction. So just
>> extend that?
> 
> What do you mean by "active"?
> 
> Unlike Objective-C and C++, Flang's frontend is implemented in a 
> different sub-project. Also, AFAIK, there's no concept of 
> active/inactive frontend in the compiler driver.
> 
> Perhaps you meant "Clang, the frontend and the frontend driver"? I'm 
> referring to "Clang, the compiler driver" :) I should've made that 
> clearer first time round.

The Clang driver claims arguments in the various things in the ToolChain 
files.  If I remember correctly, most of this is done automatically by 
marking options in the .td files as being automatically forwarded to 
certain tools (e.g. clang -cc1 or ld), but you will get an error for 
anything that is not claimed.

I have not looked at the Flang code, but I presume the clang driver has 
a FlangTool class for collecting and forwarding arguments from the 
driver to the flang front end.  I'd expect this to be the place to claim 
all flang-only arguments, anywhere else they should just show up as 
unclaimed.

David



More information about the cfe-dev mailing list