Skip to content

Commit 7a8e02a

Browse files
[SYCL][NFC] Minor refactor to reuse existing code. (#2844)
1 parent 7bdba14 commit 7a8e02a

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10193,11 +10193,6 @@ class Sema final {
1019310193
bool checkAllowedSYCLInitializer(VarDecl *VD,
1019410194
bool CheckValueDependent = false);
1019510195

10196-
// Adds a scheduler_target_fmax_mhz attribute to a particular declaration.
10197-
void addSYCLIntelSchedulerTargetFmaxMhzAttr(Decl *D,
10198-
const AttributeCommonInfo &CI,
10199-
Expr *E);
10200-
1020110196
//===--------------------------------------------------------------------===//
1020210197
// C++ Coroutines TS
1020310198
//

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,24 +3048,6 @@ static void handleUseStallEnableClustersAttr(Sema &S, Decl *D,
30483048
handleSimpleAttribute<SYCLIntelUseStallEnableClustersAttr>(S, D, Attr);
30493049
}
30503050

3051-
// Add scheduler_target_fmax_mhz
3052-
void Sema::addSYCLIntelSchedulerTargetFmaxMhzAttr(
3053-
Decl *D, const AttributeCommonInfo &Attr, Expr *E) {
3054-
assert(E && "Attribute must have an argument.");
3055-
3056-
SYCLIntelSchedulerTargetFmaxMhzAttr TmpAttr(Context, Attr, E);
3057-
if (!E->isValueDependent()) {
3058-
ExprResult ResultExpr;
3059-
if (checkRangedIntegralArgument<SYCLIntelSchedulerTargetFmaxMhzAttr>(
3060-
E, &TmpAttr, ResultExpr))
3061-
return;
3062-
E = ResultExpr.get();
3063-
}
3064-
3065-
D->addAttr(::new (Context)
3066-
SYCLIntelSchedulerTargetFmaxMhzAttr(Context, Attr, E));
3067-
}
3068-
30693051
// Handle scheduler_target_fmax_mhz
30703052
static void handleSchedulerTargetFmaxMhzAttr(Sema &S, Decl *D,
30713053
const ParsedAttr &AL) {
@@ -3081,7 +3063,7 @@ static void handleSchedulerTargetFmaxMhzAttr(Sema &S, Decl *D,
30813063
S.Diag(AL.getLoc(), diag::note_spelling_suggestion)
30823064
<< "'intel::scheduler_target_fmax_mhz'";
30833065

3084-
S.addSYCLIntelSchedulerTargetFmaxMhzAttr(D, AL, E);
3066+
S.AddOneConstantValueAttr<SYCLIntelSchedulerTargetFmaxMhzAttr>(D, AL, E);
30853067
}
30863068

30873069
// Handles max_global_work_dim.

0 commit comments

Comments
 (0)