[cfe-dev] A checker that checks macro calls

eph dr.khong at gmail.com
Thu Jul 11 01:02:29 PDT 2013


Todd,

did you suceed with building a Checker for Macros and their arguments, and
if yes, can you share how you did it? I'm currently facing the same problem,
my code uses a lot of macro calls, and basing a checker on them is much
easier than trying to re-assemble them on a function call level, but I am a
bit lost in the clang API.

Many Thanks
Eph


Todd Nowacki wrote
> Right now, I've been using checkPostStmt and then using the source
> location
> of the expression to check isMacroId() and using the CheckerContext
> function getMacroNameOrSpelling. The reason being that I need the
> SymbolRef
> for the argument to the macro, and I can't see a way to get that via a
> MacroArg or Token (which is what I get if I used the Preprocessor).
> 
> The PPCallback seems much cleaner; if there was a way to get a SymbolRef
> fromt that method, that would be awesome.





--
View this message in context: http://clang-developers.42468.n3.nabble.com/A-checker-that-checks-macro-calls-tp4032824p4033131.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list