Skip to content

Commit 4191d12

Browse files
committed
Made stall_enable disgnostic more descriptive.
1 parent fd93cd1 commit 4191d12

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,9 @@ def warn_dllimport_dropped_from_inline_function : Warning<
31923192
InGroup<IgnoredAttributes>;
31933193
def warn_attribute_ignored : Warning<"%0 attribute ignored">,
31943194
InGroup<IgnoredAttributes>;
3195+
def warn_attribute_on_direct_kernel_callee_only : Warning<"%0 attribute allowed"
3196+
" only on function directly called from kernel; attribute ignored">,
3197+
InGroup<IgnoredAttributes>;
31953198
def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
31963199
" exception specification; attribute ignored">,
31973200
InGroup<IgnoredAttributes>;

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ static void collectSYCLAttributes(Sema &S, FunctionDecl *FD,
328328
if (DirectlyCalled) {
329329
Attrs.push_back(A);
330330
} else {
331-
S.Diag(A->getLocation(), diag::warn_attribute_ignored) << A;
331+
S.Diag(A->getLocation(),
332+
diag::warn_attribute_on_direct_kernel_callee_only)
333+
<< A;
332334
FD->dropAttr<SYCLIntelUseStallEnableClustersAttr>();
333335
}
334336
}

clang/test/SemaSYCL/stall_enable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using namespace cl::sycl;
77
queue q;
88

9-
[[intel::use_stall_enable_clusters]] void test() {} //expected-warning{{'use_stall_enable_clusters' attribute ignored}}
9+
[[intel::use_stall_enable_clusters]] void test() {} //expected-warning{{'use_stall_enable_clusters' attribute allowed only on function directly called from kernel}}
1010

1111
#ifdef TRIGGER_ERROR
1212
[[intel::use_stall_enable_clusters(1)]] void bar1() {} // expected-error{{'use_stall_enable_clusters' attribute takes no arguments}}

0 commit comments

Comments
 (0)