Skip to content

[SYCL][NFC] Minor refactor to reuse existing code. #2844

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 1 commit into from
Dec 2, 2020
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
5 changes: 0 additions & 5 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -10193,11 +10193,6 @@ class Sema final {
bool checkAllowedSYCLInitializer(VarDecl *VD,
bool CheckValueDependent = false);

// Adds a scheduler_target_fmax_mhz attribute to a particular declaration.
void addSYCLIntelSchedulerTargetFmaxMhzAttr(Decl *D,
const AttributeCommonInfo &CI,
Expr *E);

//===--------------------------------------------------------------------===//
// C++ Coroutines TS
//
Expand Down
20 changes: 1 addition & 19 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3048,24 +3048,6 @@ static void handleUseStallEnableClustersAttr(Sema &S, Decl *D,
handleSimpleAttribute<SYCLIntelUseStallEnableClustersAttr>(S, D, Attr);
}

// Add scheduler_target_fmax_mhz
void Sema::addSYCLIntelSchedulerTargetFmaxMhzAttr(
Decl *D, const AttributeCommonInfo &Attr, Expr *E) {
assert(E && "Attribute must have an argument.");

SYCLIntelSchedulerTargetFmaxMhzAttr TmpAttr(Context, Attr, E);
if (!E->isValueDependent()) {
ExprResult ResultExpr;
if (checkRangedIntegralArgument<SYCLIntelSchedulerTargetFmaxMhzAttr>(
E, &TmpAttr, ResultExpr))
return;
E = ResultExpr.get();
}

D->addAttr(::new (Context)
SYCLIntelSchedulerTargetFmaxMhzAttr(Context, Attr, E));
}

// Handle scheduler_target_fmax_mhz
static void handleSchedulerTargetFmaxMhzAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
Expand All @@ -3081,7 +3063,7 @@ static void handleSchedulerTargetFmaxMhzAttr(Sema &S, Decl *D,
S.Diag(AL.getLoc(), diag::note_spelling_suggestion)
<< "'intel::scheduler_target_fmax_mhz'";

S.addSYCLIntelSchedulerTargetFmaxMhzAttr(D, AL, E);
S.AddOneConstantValueAttr<SYCLIntelSchedulerTargetFmaxMhzAttr>(D, AL, E);
}

// Handles max_global_work_dim.
Expand Down