kadircet wrote:

I'd like to chime in for the issue with source locations and its implications. 
Seems like it has been brought up already along the thread.

These might not be as crucial for diagnostic locations (or other clang 
purposes) when they're slightly off, but they actually result in big changes in 
most of the source tools, especially ones that rewrite source code.
Many tools already operate with the assumption of source locations provided by 
AST being a best-effort service, but subtle edge cases like this PR makes tools 
really complicated and also regress without anyone noticing, as these edge 
cases are usually not tested.

After this patch we now have a discrepancy in source ranges associated with 
member vs non-member declarations. It's also popping up in test cases updated 
in this patch, we're updating some golden tests but only for member 
declarations. I think getting rid of this discrepancy either by keeping source 
ranges as-is for member decls, or having a similar update for non-member 
declarations? That way source tools only need to special case attributes, and 
not `FieldDecl`s on top of that.

https://github.com/llvm/llvm-project/pull/133107
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to