[PATCH] D148004: [clang][dataflow][NFC] Remove unused parameter from `insertIfGlobal()`.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 04:32:19 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG991c7e11728f: [clang][dataflow][NFC] Remove unused parameter from `insertIfGlobal()`. (authored by mboehme).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148004/new/

https://reviews.llvm.org/D148004

Files:
  clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp


Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -156,7 +156,6 @@
 
 /// Initializes a global storage value.
 static void insertIfGlobal(const Decl &D,
-                           llvm::DenseSet<const FieldDecl *> &Fields,
                            llvm::DenseSet<const VarDecl *> &Vars) {
   if (auto *V = dyn_cast<VarDecl>(&D))
     if (V->hasGlobalStorage())
@@ -166,7 +165,7 @@
 static void getFieldsAndGlobalVars(const Decl &D,
                                    llvm::DenseSet<const FieldDecl *> &Fields,
                                    llvm::DenseSet<const VarDecl *> &Vars) {
-  insertIfGlobal(D, Fields, Vars);
+  insertIfGlobal(D, Vars);
   if (const auto *Decomp = dyn_cast<DecompositionDecl>(&D))
     for (const auto *B : Decomp->bindings())
       if (auto *ME = dyn_cast_or_null<MemberExpr>(B->getBinding()))
@@ -191,11 +190,11 @@
       for (auto *D : DS->getDeclGroup())
           getFieldsAndGlobalVars(*D, Fields, Vars);
   } else if (auto *E = dyn_cast<DeclRefExpr>(&S)) {
-    insertIfGlobal(*E->getDecl(), Fields, Vars);
+    insertIfGlobal(*E->getDecl(), Vars);
   } else if (auto *E = dyn_cast<MemberExpr>(&S)) {
     // FIXME: should we be using `E->getFoundDecl()`?
     const ValueDecl *VD = E->getMemberDecl();
-    insertIfGlobal(*VD, Fields, Vars);
+    insertIfGlobal(*VD, Vars);
     if (const auto *FD = dyn_cast<FieldDecl>(VD))
       Fields.insert(FD);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148004.512395.patch
Type: text/x-patch
Size: 1609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230411/d41f811a/attachment.bin>


More information about the cfe-commits mailing list