[cfe-dev] About the “unsupported argumnet” Error in developping with clang

John Criswell criswell at illinois.edu
Thu Nov 3 08:27:04 PDT 2011


On 11/2/11 10:34 PM, redder_0210 at yeah.net wrote:
> Dear All,
> 	I'm trying to add a command line option to Clang/Clang++.
>          What I have done is that I have modified the driver of Clang. But the compilation instance(perhaps named clang cc1) of Clang cannot identify the new option. And the console prints the ERROR:" unsupported argumnet".
>         what's more,  when I have add the new command line argumnet to the "CC1Options.td", the console prints the "ast infomation"(in my opinion) of the source File. I have no idea about the reason.
>         What should I do to solve the problem now?
> Thanks in advance.
>         ------Redder.

When you add a command line argument to Clang, you need to add it to 
both Clang (the compiler driver) and cc1 (the actual compiler).

Take a look at 
http://lists.cs.uiuc.edu/pipermail/sva-commits/2011-October/000563.html.  Notice 
how I had to add options to Options.td and CC1Options.td and how I had 
to modify lib/Driver/Tools.cpp to propagate the logfile argument from 
Clang to CC1.

BTW, you should send questions to the Clang Developer's list 
(http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev) instead of to me 
personally.  You're more likely to get an answer from people on the list 
(as they're more expert in clang than I am).
:)

-- John T.





More information about the cfe-dev mailing list