[cfe-dev] A patch for a new callback for the preprocessor
Chris Lattner
clattner at apple.com
Thu Mar 12 10:32:50 PDT 2009
On Mar 12, 2009, at 10:01 AM, Paolo Bolzoni wrote:
> dear cfe-dev,
>
> while working with your preprocessor,
> I found really useful to attach callbacks to events such as
> ChangeFile.
>
> Now I also needed a new callback hook for the `macro expansion'
> event, which seems to be missing. Hence, I am proposing the attached
> simple
> patch.
>
> This new feature allows me to code checkers for coding rules like
> `Your program shall not use the setjmp macro'
Sure, sounds good. I committed a modified patch here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090309/013849.html
Note that this will have limited utility for function-like macros. It
might be better to call the callback down lower after the MacroArgs
are parsed and constructed.
-Chris
More information about the cfe-dev
mailing list