================
@@ -1488,6 +1484,18 @@ DeclContext *DeclContext::getNonTransparentContext() {
return DC;
}
+ASTContext &DeclContext::getParentASTContextSlow() const {
+ const DeclContext *DC = this;
+ while (!DC->isTranslationUnit()) {
----------------
efriedma-quic wrote:
We might as well just past the ASTContext into the DeclContext constructor;
should be simple to implement, and makes things slightly faster if we can skip
doing a null check.
------
My primary concern with this patch is that this is sort of an irreversible
decision; if we start assuming the ASTContext is always available cheaply from
a DeclContext, we'll never be able go the other way. But I guess we might
already be at that point.
https://github.com/llvm/llvm-project/pull/223047
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits