r207896 - Fix a bunch of mislayered clang/Lex includes from Sema

Alp Toker alp at nuanti.com
Sat May 3 01:58:03 PDT 2014


On 03/05/2014 09:35, Chandler Carruth wrote:
>
> On Fri, May 2, 2014 at 8:45 PM, Alp Toker <alp at nuanti.com 
> <mailto:alp at nuanti.com>> wrote:
>
>     Fix a bunch of mislayered clang/Lex includes from Sema
>
>
> The direction of this change makes lots of sense, but this commit log 
> isn't really helpful for reviewers because you're actually making 
> non-trivial changes in order to fix the layering issues. It would be 
> really helpful for me at least to both split each change into its own 
> commit unless they are interdependent in some way, and to describe the 
> nature of the layering fix when it isn't just a "include the right 
> header instead of the wrong header".

The changes are fairly trivial. I'll describe the commit below as the 
log was a bit brief:

The two functions getLocForEndOfToken() and getModuleLoader() aren't 
dependent on Preprocessor state so we can lift them into Sema.

The other changes involve using existing local accessors available in 
Sema and ASTContext e.g. Sema::getDiagnostics() instead of 
Preprocessor::getDiagnostics().

A few FIXMEs are downgraded to TODOs because the broken layering has 
unfortunately become widespread in recent years.

Together these changes let us remove several of the low-hanging 
Preprocessor.h includes (so in that respect they're interdependent). No 
change in functionality.

Alp.

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list