Skip to content

Commit 1b17e07

Browse files
committed
Use CapExprSet
1 parent 59b415b commit 1b17e07

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/lib/Analysis/ThreadSafety.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2268,12 +2268,12 @@ static bool neverReturns(const CFGBlock *B) {
22682268
void ThreadSafetyAnalyzer::checkMismatchedFunctionAttrs( const NamedDecl *ND) {
22692269

22702270
auto collectCapabilities = [&](const Decl *D) {
2271-
llvm::SmallVector<CapabilityExpr> Args;
2271+
CapExprSet Caps;
22722272
for (const auto *A : D->specific_attrs<RequiresCapabilityAttr>()) {
22732273
for (const Expr *E : A->args())
2274-
Args.push_back(SxBuilder.translateAttrExpr(E, nullptr));
2274+
Caps.push_back_nodup(SxBuilder.translateAttrExpr(E, nullptr));
22752275
}
2276-
return Args;
2276+
return Caps;
22772277
};
22782278

22792279
auto NDArgs = collectCapabilities(ND);
@@ -2282,9 +2282,9 @@ void ThreadSafetyAnalyzer::checkMismatchedFunctionAttrs( const NamedDecl *ND) {
22822282
auto DArgs = collectCapabilities(D);
22832283

22842284
for (const auto &[A, B] : zip_longest(NDArgs, DArgs)) {
2285-
if (!A || !B || !(*A).equals(*B)) {
2286-
Handler.handleAttributeMismatch(cast<NamedDecl>(ND), cast<NamedDecl>(D));
2287-
}
2285+
if (!A || !B || !(*A).equals(*B))
2286+
Handler.handleAttributeMismatch(cast<NamedDecl>(ND),
2287+
cast<NamedDecl>(D));
22882288
}
22892289
}
22902290
}

0 commit comments

Comments
 (0)