@@ -156,7 +156,6 @@ static Value &widenDistinctValues(QualType Type, Value &Prev,
156
156
157
157
// / Initializes a global storage value.
158
158
static void insertIfGlobal (const Decl &D,
159
- llvm::DenseSet<const FieldDecl *> &Fields,
160
159
llvm::DenseSet<const VarDecl *> &Vars) {
161
160
if (auto *V = dyn_cast<VarDecl>(&D))
162
161
if (V->hasGlobalStorage ())
@@ -166,7 +165,7 @@ static void insertIfGlobal(const Decl &D,
166
165
static void getFieldsAndGlobalVars (const Decl &D,
167
166
llvm::DenseSet<const FieldDecl *> &Fields,
168
167
llvm::DenseSet<const VarDecl *> &Vars) {
169
- insertIfGlobal (D, Fields, Vars);
168
+ insertIfGlobal (D, Vars);
170
169
if (const auto *Decomp = dyn_cast<DecompositionDecl>(&D))
171
170
for (const auto *B : Decomp->bindings ())
172
171
if (auto *ME = dyn_cast_or_null<MemberExpr>(B->getBinding ()))
@@ -191,11 +190,11 @@ static void getFieldsAndGlobalVars(const Stmt &S,
191
190
for (auto *D : DS->getDeclGroup ())
192
191
getFieldsAndGlobalVars (*D, Fields, Vars);
193
192
} else if (auto *E = dyn_cast<DeclRefExpr>(&S)) {
194
- insertIfGlobal (*E->getDecl (), Fields, Vars);
193
+ insertIfGlobal (*E->getDecl (), Vars);
195
194
} else if (auto *E = dyn_cast<MemberExpr>(&S)) {
196
195
// FIXME: should we be using `E->getFoundDecl()`?
197
196
const ValueDecl *VD = E->getMemberDecl ();
198
- insertIfGlobal (*VD, Fields, Vars);
197
+ insertIfGlobal (*VD, Vars);
199
198
if (const auto *FD = dyn_cast<FieldDecl>(VD))
200
199
Fields.insert (FD);
201
200
}
0 commit comments