[llvm-branch-commits] [NFC][AST] Clean up XRayFilter and NoSanitizeL before backend (PR #162119)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 6 10:00:41 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

I don't thin we need them after AST is destroyed.
If I am wrong we should see crashes immediately, as pointers dereferenced unchecked.


---
Full diff: https://github.com/llvm/llvm-project/pull/162119.diff


1 Files Affected:

- (modified) clang/lib/AST/ASTContext.cpp (+3) 


``````````diff
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 056bfe36b2a0a..6ac0767c80067 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -976,6 +976,9 @@ void ASTContext::cleanup() {
   for (const auto &Value : ModuleInitializers)
     Value.second->~PerModuleInitializers();
   ModuleInitializers.clear();
+
+  XRayFilter.reset();
+  NoSanitizeL.reset();
 }
 
 ASTContext::~ASTContext() { cleanup(); }

``````````

</details>


https://github.com/llvm/llvm-project/pull/162119


More information about the llvm-branch-commits mailing list