================
@@ -786,6 +797,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
/// Keeps track of the deallocated DeclListNodes for future reuse.
DeclListNode *ListNodeFreeList = nullptr;
+ std::unique_ptr<SemaProxy> SemaProxyPtr;
----------------
AaronBallman wrote:
I'm not comfortable with the idea that any AST evaluation whatsoever will now
always carry the potential to mutate the AST and it's up to the caller to
determine whether that's possible based on contextual clues. I don't think
that's the status quo -- if I call `Expr::HasSideEffects()` today, I don't
expect that to mutate my AST out from under me. If I call
`Expr::tryEvaluateString()` I might expect that to fail instead of mutating the
AST out from under me. I expect this to only impact interfaces like
`EvaluateAsConstantExpr()` where the evaluation of the constant expression is
explicitly requested. I think using function parameters to be explicit with
that request makes a lot of sense, too, because I expect there are consumers of
these APIs that *never want to mutate the AST* an encoding that in the API
itself gives a much stronger guarantee than a hidden pointer.
https://github.com/llvm/llvm-project/pull/173537
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits