Skip to content

[BoundsSafety][NFC] Remove the unused parameter 'Decls' from 'Sema::C… #102076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -15071,9 +15071,6 @@ class Sema final : public SemaBase {
///
/// \param FD The FieldDecl to apply the attribute to
/// \param E The count expression on the attribute
/// \param[out] Decls If the attribute is semantically valid \p Decls
/// is populated with TypeCoupledDeclRefInfo objects, each
/// describing Decls referred to in \p E.
/// \param CountInBytes If true the attribute is from the "sized_by" family of
/// attributes. If the false the attribute is from
/// "counted_by" family of attributes.
Expand All @@ -15086,10 +15083,8 @@ class Sema final : public SemaBase {
/// `counted_by_or_null` attribute.
///
/// \returns false iff semantically valid.
bool CheckCountedByAttrOnField(
FieldDecl *FD, Expr *E,
llvm::SmallVectorImpl<TypeCoupledDeclRefInfo> &Decls, bool CountInBytes,
bool OrNull);
bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes,
bool OrNull);

///@}
};
Expand Down
8 changes: 2 additions & 6 deletions clang/lib/Sema/SemaBoundsSafety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};

bool Sema::CheckCountedByAttrOnField(
FieldDecl *FD, Expr *E,
llvm::SmallVectorImpl<TypeCoupledDeclRefInfo> &Decls, bool CountInBytes,
bool OrNull) {
bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes,
bool OrNull) {
// Check the context the attribute is used in

unsigned Kind = getCountAttrKind(CountInBytes, OrNull);
Expand Down Expand Up @@ -185,8 +183,6 @@ bool Sema::CheckCountedByAttrOnField(
return true;
}
}

Decls.push_back(TypeCoupledDeclRefInfo(CountFD, /*IsDref*/ false));
return false;
}

Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5898,8 +5898,7 @@ static void handleCountedByAttrField(Sema &S, Decl *D, const ParsedAttr &AL) {
llvm_unreachable("unexpected counted_by family attribute");
}

llvm::SmallVector<TypeCoupledDeclRefInfo, 1> Decls;
if (S.CheckCountedByAttrOnField(FD, CountExpr, Decls, CountInBytes, OrNull))
if (S.CheckCountedByAttrOnField(FD, CountExpr, CountInBytes, OrNull))
return;

QualType CAT = S.BuildCountAttributedArrayOrPointerType(
Expand Down
Loading