[cfe-dev] Compiler arguments for clang_parseTranslationUnit

Stefan Seefeld seefeld at sympatico.ca
Tue Feb 15 13:51:54 PST 2011


On 2011-02-15 16:19, Douglas Gregor wrote:
>
> On Feb 15, 2011, at 1:10 PM, Ehsan Akhgari wrote:
>
>> I think the idea is that you just pass in argc and argv to that 
>> function so that your tool can be used as a drop-in replacement for a 
>> real compiler.
>
> Yes, this is the intent.
>
> And the best place to look for documentation on the command-line 
> options Clang accepts is... the GCC documentation. Clang doesn't have 
> a user manual describing all of its command-line options :)

Fair enough. But which GCC would that be ? Different versions use 
different defaults. Can I change what compiler Clang targets / emulates ?
For example, I have a Cell cross-compiler installed on my laptop (giving 
me 'ppu-g++' and 'spu-g++'). How can I make Clang use their sysroots and 
related flags ?

To illustrate my use-case a little:

I'm working on a portable library that targets different platforms. 
Depending on how I compile it, different backends are picked up. I'd 
like to be able to process that library with Synopsis to "see" all the 
active backends in the generated documentation, which requires it to 
emulate the different compilers I'd normally compile the library with.

Thanks,
         Stefan


-- 

       ...ich hab' noch einen Koffer in Berlin...




More information about the cfe-dev mailing list