Skip to content

[Sema] Remove unnecessary casts (NFC) #148871

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
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
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6247,7 +6247,7 @@ static void handleInterruptAttr(Sema &S, Decl *D, const ParsedAttr &AL) {

static void handleLayoutVersion(Sema &S, Decl *D, const ParsedAttr &AL) {
uint32_t Version;
Expr *VersionExpr = static_cast<Expr *>(AL.getArgAsExpr(0));
Expr *VersionExpr = AL.getArgAsExpr(0);
if (!S.checkUInt32Argument(AL, AL.getArgAsExpr(0), Version))
return;

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaM68k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void SemaM68k::handleInterruptAttr(Decl *D, const ParsedAttr &AL) {

// FIXME: Check for decl - it should be void ()(void).

Expr *NumParamsExpr = static_cast<Expr *>(AL.getArgAsExpr(0));
Expr *NumParamsExpr = AL.getArgAsExpr(0);
auto MaybeNumParams = NumParamsExpr->getIntegerConstantExpr(getASTContext());
if (!MaybeNumParams) {
Diag(AL.getLoc(), diag::err_attribute_argument_type)
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaMSP430.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void SemaMSP430::handleInterruptAttr(Decl *D, const ParsedAttr &AL) {
return;
}

Expr *NumParamsExpr = static_cast<Expr *>(AL.getArgAsExpr(0));
Expr *NumParamsExpr = AL.getArgAsExpr(0);
std::optional<llvm::APSInt> NumParams = llvm::APSInt(32);
if (!(NumParams = NumParamsExpr->getIntegerConstantExpr(getASTContext()))) {
Diag(AL.getLoc(), diag::err_attribute_argument_type)
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6533,7 +6533,7 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type,
return;
}

Expr *ASArgExpr = static_cast<Expr *>(Attr.getArgAsExpr(0));
Expr *ASArgExpr = Attr.getArgAsExpr(0);
LangAS ASIdx;
if (!BuildAddressSpaceIndex(S, ASIdx, ASArgExpr, Attr.getLoc())) {
Attr.setInvalid();
Expand Down
Loading