Skip to content

Commit 9fa28b7

Browse files
author
Benson Chu
committed
[NFC][ARM] Moved handleInterruptSaveFP function to SemaARM
1 parent 01100de commit 9fa28b7

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

clang/include/clang/Sema/SemaARM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class SemaARM : public SemaBase {
7171
void handleNewAttr(Decl *D, const ParsedAttr &AL);
7272
void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL);
7373
void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
74+
void handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL);
7475
};
7576

7677
SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD);

clang/lib/Sema/SemaARM.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,4 +1341,17 @@ void SemaARM::handleInterruptAttr(Decl *D, const ParsedAttr &AL) {
13411341
ARMInterruptAttr(getASTContext(), AL, Kind));
13421342
}
13431343

1344+
void SemaARM::handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL) {
1345+
handleARMInterruptAttr(D, AL);
1346+
1347+
bool VFP = SemaRef.Context.getTargetInfo().hasFeature("vfp");
1348+
1349+
if (!VFP) {
1350+
SemaRef.Diag(D->getLocation(), diag::warn_arm_interrupt_save_fp_without_vfp_unit);
1351+
return;
1352+
}
1353+
1354+
D->addAttr(::new (SemaRef.Context) ARMSaveFPAttr(SemaRef.Context, AL));
1355+
}
1356+
13441357
} // namespace clang

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,20 +5498,6 @@ static void handleAbiTagAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
54985498
AbiTagAttr(S.Context, AL, Tags.data(), Tags.size()));
54995499
}
55005500

5501-
static void handleARMInterruptSaveFPAttr(Sema &S, Decl *D,
5502-
const ParsedAttr &AL) {
5503-
handleARMInterruptAttr(S, D, AL);
5504-
5505-
bool VFP = S.Context.getTargetInfo().hasFeature("vfp");
5506-
5507-
if (!VFP) {
5508-
S.Diag(D->getLocation(), diag::warn_arm_interrupt_save_fp_without_vfp_unit);
5509-
return;
5510-
}
5511-
5512-
D->addAttr(::new (S.Context) ARMSaveFPAttr(S.Context, AL));
5513-
}
5514-
55155501
static bool hasBTFDeclTagAttr(Decl *D, StringRef Tag) {
55165502
for (const auto *I : D->specific_attrs<BTFDeclTagAttr>()) {
55175503
if (I->getBTFDeclTag() == Tag)
@@ -6406,7 +6392,7 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
64066392
handleInterruptAttr(S, D, AL);
64076393
break;
64086394
case ParsedAttr::AT_ARMInterruptSaveFP:
6409-
handleARMInterruptSaveFPAttr(S, D, AL);
6395+
S.ARM().handleInterruptSaveFPAttr(D, AL);
64106396
break;
64116397
case ParsedAttr::AT_X86ForceAlignArgPointer:
64126398
S.X86().handleForceAlignArgPointerAttr(D, AL);

0 commit comments

Comments
 (0)