r215145 - Flip the order the preprocessor and frontendaction are informed of the end of a file.

Benjamin Kramer benny.kra at gmail.com
Thu Aug 7 14:28:13 PDT 2014


On 07.08.2014, at 23:07, Chandler Carruth <chandlerc at google.com> wrote:

> 
> On Thu, Aug 7, 2014 at 1:51 PM, Benjamin Kramer <benny.kra at googlemail.com> wrote:
> Flip the order the preprocessor and frontendaction are informed of the end of a file.
> 
> This allows using EndOfMainFile from a PPCallback to access data from the
> action. The pattern of PPCallback referencing an action is common in clang-tidy.
> 
> Do we have no use cases of th ereverse? Wondering if we should have different APIs to support both directions.

You can probably make up a use case but I don't see much value in it. PPCallbacks. The previous ordering was rather atypical

Action.Begin
Preprocessor.Begin
Action.End
Preprocessor.End

now it's

Action.Begin
Preprocessor.Begin
Preprocessor.End
Action.End

which is more natural.  If anyone's tools start failing now we can consider adding a hatch to get the old behavior but I think that is highly unlikely.

- Ben



More information about the cfe-commits mailing list