[cfe-dev] Querying a compiler switch setting in clang

Jonathan Roelofs via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 26 07:24:17 PDT 2015



On 8/26/15 6:22 AM, Nat! via cfe-dev wrote:
> Hi
>
> I would like to query at certain points in unfortunately various files
> like SemaExpr.cpp or CGCall.cpp the value of a compiler flag and branch
> accordingly to custom code.
>
> The specific flag I want to query the value of is -fobjc-runtime.
>
> I have now spent some time in various corners of clang, certainly not
> all, but I haven't come across that yet, except possibly LangOptions.
> Maybe extending LangOptions would be the best place, but I don't know.

LangOptions already has a field in it for this, called ObjCRuntime.

https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/LangOptions.h#L85
https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/ObjCRuntime.h

Jon

>
> Thanks for a clue.
>
> Ciao
>      Nat!
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list