[cfe-dev] A checker that checks macro calls

Todd Nowacki nowacki724 at gmail.com
Mon Jun 24 15:15:37 PDT 2013


Hi,

I'm currently trying to implement a checker that needs to know when a
certain macro is invoked.

For example, if I had something like:
#define MY_MACRO(x)  ...

I would want to check if the statement is MY_MACRO and then inspect its
argument.

I see that with checkPreStmt or checkPostStmt. I can check if it is a
macro, via getLocStart and isMacroID. Is there a way to get the name of the
macro and it's argument (if it has one)?
I see that MacroInfo could be used to get the args possibly, but it doesn't
seem to give me the name.

Thanks!

Sincerely,
Todd Nowacki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130624/c0ba1902/attachment.html>


More information about the cfe-dev mailing list