Skip to content

Commit 3f58076

Browse files
committed
address review comments
1 parent 3e53d8d commit 3f58076

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,10 +2934,9 @@ static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &Attr,
29342934
}
29352935

29362936
if (Attr.getKind() == ParsedAttr::AT_SYCLIntelMaxWorkGroupSize &&
2937-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
2937+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
29382938
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
29392939
<< "'intel::max_work_group_size'";
2940-
}
29412940

29422941
if (const auto *A = D->getAttr<ReqdWorkGroupSizeAttr>()) {
29432942
if (!(WGSize[0] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
@@ -5191,10 +5190,9 @@ static void handleNoGlobalWorkOffsetAttr(Sema &S, Decl *D,
51915190
<< Attr;
51925191

51935192
if (Attr.getKind() == ParsedAttr::AT_SYCLIntelNoGlobalWorkOffset &&
5194-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
5193+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
51955194
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
51965195
<< "'intel::no_global_work_offset'";
5197-
}
51985196

51995197
D->addAttr(::new (S.Context)
52005198
SYCLIntelNoGlobalWorkOffsetAttr(S.Context, Attr, Enabled));
@@ -5221,14 +5219,13 @@ static void handleIntelFPGAPumpAttr(Sema &S, Decl *D, const ParsedAttr &Attr) {
52215219
S.Context, IntelFPGAMemoryAttr::Default));
52225220

52235221
if (Attr.getKind() == ParsedAttr::AT_IntelFPGADoublePump &&
5224-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
5222+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
52255223
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
52265224
<< "'intel::doublepump'";
5227-
} else if (Attr.getKind() == ParsedAttr::AT_IntelFPGASinglePump &&
5228-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
5229-
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
5230-
<< "'intel::singlepump'";
5231-
}
5225+
else if (Attr.getKind() == ParsedAttr::AT_IntelFPGASinglePump &&
5226+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
5227+
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
5228+
<< "'intel::singlepump'";
52325229

52335230
handleSimpleAttribute<AttrType>(S, D, Attr);
52345231
}
@@ -5345,14 +5342,13 @@ static void handleOneConstantPowerTwoValueAttr(Sema &S, Decl *D,
53455342
return;
53465343

53475344
if (Attr.getKind() == ParsedAttr::AT_IntelFPGABankWidth &&
5348-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
5345+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
53495346
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
53505347
<< "'intel::bankwidth'";
5351-
} else if (Attr.getKind() == ParsedAttr::AT_IntelFPGANumBanks &&
5352-
checkDeprecatedSYCLAttributeSpelling(S, Attr)) {
5353-
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
5354-
<< "'intel::numbanks'";
5355-
}
5348+
else if (Attr.getKind() == ParsedAttr::AT_IntelFPGANumBanks &&
5349+
checkDeprecatedSYCLAttributeSpelling(S, Attr))
5350+
S.Diag(Attr.getLoc(), diag::note_spelling_suggestion)
5351+
<< "'intel::numbanks'";
53565352

53575353
S.AddOneConstantPowerTwoValueAttr<AttrType>(D, Attr, Attr.getArgAsExpr(0));
53585354
}

clang/lib/Sema/SemaStmtAttr.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static Attr *handleIntelFPGALoopAttr(Sema &S, const ParsedAttr &A) {
103103
}
104104
}
105105

106-
if (A.getParsedKind() == ParsedAttr::AT_SYCLIntelFPGAII &&
106+
if (A.getKind() == ParsedAttr::AT_SYCLIntelFPGAII &&
107107
checkDeprecatedSYCLLoopAttributeSpelling(S, A)) {
108108
S.Diag(A.getLoc(), diag::note_spelling_suggestion) << "'intel::ii'";
109109
} else if (A.getKind() == ParsedAttr::AT_SYCLIntelFPGAMaxConcurrency &&
@@ -144,10 +144,9 @@ Attr *handleIntelFPGALoopAttr<SYCLIntelFPGADisableLoopPipeliningAttr>(
144144
return nullptr;
145145
}
146146

147-
if (checkDeprecatedSYCLLoopAttributeSpelling(S, A)) {
147+
if (checkDeprecatedSYCLLoopAttributeSpelling(S, A))
148148
S.Diag(A.getLoc(), diag::note_spelling_suggestion)
149149
<< "'intel::disable_loop_pipelining'";
150-
}
151150

152151
return new (S.Context) SYCLIntelFPGADisableLoopPipeliningAttr(S.Context, A);
153152
}
@@ -310,9 +309,8 @@ static Attr *handleIntelFPGAIVDepAttr(Sema &S, const ParsedAttr &A) {
310309
return nullptr;
311310
}
312311

313-
if (checkDeprecatedSYCLLoopAttributeSpelling(S, A)) {
312+
if (checkDeprecatedSYCLLoopAttributeSpelling(S, A))
314313
S.Diag(A.getLoc(), diag::note_spelling_suggestion) << "'intel::ivdep'";
315-
}
316314

317315
return S.BuildSYCLIntelFPGAIVDepAttr(
318316
A, NumArgs >= 1 ? A.getArgAsExpr(0) : nullptr,

clang/test/SemaSYCL/intel-restrict.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int main() {
2424
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel2
2525
// CHECK: SYCLIntelKernelArgsRestrictAttr
2626
kernel<class test_kernel2>(
27-
[]() [[intel::kernel_args_restrict]]{});
27+
[]() [[intel::kernel_args_restrict]] {});
2828

2929
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel3
3030
// CHECK: SYCLIntelKernelArgsRestrictAttr

0 commit comments

Comments
 (0)