[cfe-dev] Adding -add-override functionality to cpp11-migrate tool

Philip Dunstan phil at philipdunstan.com
Mon Feb 4 15:40:02 PST 2013


Thanks Dmitri and Matthieu,

At the moment I am not doing anything like this. I am simply inserting the
"override" keyword in AddOverrideActions. Should I be appling a similar
technique to find an appropriate macro to apply instead of the raw override
keyword?

Looking at how it is done for the fix-it hints for [[clang::fallthrough]] I
appear to need to access a Preprocessor object. Is that still available at
the time the AST matchers MatchCallback is run and what is the recommended
way to access it?

Phil
--
Philip Dunstan
phil at philipdunstan.com
www.philipdunstan.com


On Mon, Feb 4, 2013 at 8:03 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Mon, Feb 4, 2013 at 8:24 PM, Matthieu Monrocq
> <matthieu.monrocq at gmail.com> wrote:
> > I seem to remember there was some magic in the [[clang::fallthrough]]
> > attribute that allowed one to find the last macro that evaluated to this
> > attribute (should one exist), and thus allowed the fix-it hints to use
> the
> > macro spelling instead of the "pure" spelling.
>
> Philip,
>
> You can find an example of that in r164892.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130205/6b6354d3/attachment.html>


More information about the cfe-dev mailing list