rapidsna wrote:

> > Whether `LateParsedAttribute` is in `Parser` or in `DeclSpec`, the 
> > fundamental problem is that this creates either an AST → Sema or AST → 
> > Parser dependency because `LateParsedAttrType` in AST references 
> > `LateParsedTypeAttribute`.
> 
> Right, but I think the idea is that the reference to 
> `LateParsedTypeAttribute` should be opaque, since it's referencing state in 
> the parser? The AST library shouldn't need to see through it.
> 
> > Currently, some AST code includes `DeclSpec.h` to access `AttrNameLoc` from 
> > `LateParsedTypeAttribute`. However, I think I can eliminate this dependency 
> > by storing the SourceLocation separately instead of accessing it through 
> > `LateParsedTypeAttribute`.
> > Would that address your concern about the AST → Sema dependency?
> 
> Yes, I think so.
> 
> It looks like `ASTContext.cpp` also includes `DeclSpec.h` for 
> `ASTContext::getLateParsedAttrType`, but I don't think that actually needs 
> the definition of `LateParsedTypeAttribute` -- a forward declaration should 
> be enough (and it has one already, via Type.h -> TypeBase.h).

@zmodem I just updated PR as suggested.

https://github.com/llvm/llvm-project/pull/179612
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to