Skip to content

Commit 7f1e341

Browse files
committed
NFC Simplify ExprEngine::VisitAttributedStmt
1 parent daddb9e commit 7f1e341

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,25 +1203,15 @@ void ExprEngine::VisitLambdaExpr(const LambdaExpr *LE, ExplodedNode *Pred,
12031203

12041204
void ExprEngine::VisitAttributedStmt(const AttributedStmt *A,
12051205
ExplodedNode *Pred, ExplodedNodeSet &Dst) {
1206-
12071206
ExplodedNodeSet CheckerPreStmt;
12081207
getCheckerManager().runCheckersForPreStmt(CheckerPreStmt, Pred, A, *this);
12091208

12101209
ExplodedNodeSet EvalSet;
12111210
StmtNodeBuilder Bldr(CheckerPreStmt, EvalSet, *currBldrCtx);
12121211

1213-
{
1214-
for (const auto *attr : A->getAttrs()) {
1215-
1216-
CXXAssumeAttr const *assumeAttr = llvm::dyn_cast<CXXAssumeAttr>(attr);
1217-
if (!assumeAttr) {
1218-
continue;
1219-
}
1220-
Expr *AssumeExpr = assumeAttr->getAssumption();
1221-
1222-
for (auto *node : CheckerPreStmt) {
1223-
Visit(AssumeExpr, node, EvalSet);
1224-
}
1212+
if (const auto *AssumeAttr = getSpecificAttr<CXXAssumeAttr>(A->getAttrs())) {
1213+
for (ExplodedNode *N : CheckerPreStmt) {
1214+
Visit(AssumeAttr->getAssumption(), N, EvalSet);
12251215
}
12261216
}
12271217

0 commit comments

Comments
 (0)