[clang-tools-extra] [clang-tidy] Speed up misc-static-initialization-cycle (PR #224243)

Daniel Petrovic via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 10:02:44 PDT 2026


================
@@ -199,8 +199,8 @@ class VarUseCollector : public DynamicRecursiveASTVisitor {
 
   bool VisitDeclRefExpr(DeclRefExpr *DRE) override {
     if (const auto *VarD = dyn_cast<VarDecl>(DRE->getDecl());
-        VarD && (!shouldIgnoreRef(DRE, Node->getDecl()) &&
-                 (VarD->hasGlobalStorage() || VarD->isStaticLocal())))
+        VarD && VarD->hasGlobalStorage() &&
----------------
daniel-petrovic wrote:

the condition is not the same - why can `VarD->isStaticLocal()` be ignored now ?

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


More information about the cfe-commits mailing list