https://github.com/AaronBallman commented:

> I think at its current state this PR moves us in the opposite direction of 
> const-correctness, despite increasing the number of `const` qualifiers.

+1, I don't think the create functions should take a const `ASTContext` object 
because they're going to mutate the AST context.

I suspect that materially improving const correctness in the AST layer will be 
a fairly significant undertaking with a large amount of churn. Historically, 
we've not been interested in a sweeping change like that due to the pain it 
causes downstream forks with things like merge conflicts. However, it may be 
more worth that effort and churn given that it's becoming more important to 
know "will this AST call actually mutate things" in regards to features like 
reflection.

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

Reply via email to