[cfe-dev] Using clang reporting for a clang-tool

Armand Leclercq marman.email at gmail.com
Fri Mar 8 12:12:22 PST 2013


I have another question.

I am currently using PPCallbacks in order to check coding-style in macros.
In order to do so, I'm using MacroDefined callback and I correctly get
the macro name, but I cannot figure out how to get the macro arguments
locations.

I get the macro argument string with
clang::MacroInfo::arg_begin()::getNameStart()

And then, I can figure out the offset with the getLength() method, but
it cannot help me to handle correctly the following example :

#define MAX(Arg,  Arg)
#define MAX(Arg, Arg)

-- 
Armand Leclercq
EPITA 2013 Assistant C/Unix



More information about the cfe-dev mailing list