Skip to content

Commit

Permalink
[clang][dataflow][NFC] Remove unused parameter from insertIfGlobal().
Browse files Browse the repository at this point in the history
Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D148004
  • Loading branch information
martinboehme committed Apr 11, 2023
1 parent 271853c commit 991c7e1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ static Value &widenDistinctValues(QualType Type, Value &Prev,

/// 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())
Expand All @@ -166,7 +165,7 @@ static void insertIfGlobal(const Decl &D,
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()))
Expand All @@ -191,11 +190,11 @@ static void getFieldsAndGlobalVars(const Stmt &S,
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);
}
Expand Down

0 comments on commit 991c7e1

Please sign in to comment.