Skip to content

Commit 6b357e0

Browse files
AaronBallmanvmaksimo
authored andcommitted
Fix incorrectly merged 3b99acb
Properly generate the testing predicate for whether a given attribute can be applied with the given language options. This is needed because of the split compilation model used by SYCL, where some attribute diagnostics are elided in host vs device mode to avoid duplications. This fixes clang/test/SemaSYCL/reqd-sub-group-size-host.cpp and clang/test/SemaSYCL/spurious-host-warning.cpp
1 parent ac2caf7 commit 6b357e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3824,7 +3824,9 @@ static void GenerateLangOptRequirements(const Record &R,
38243824
return;
38253825

38263826
OS << "bool acceptsLangOpts(const LangOptions &LangOpts) const override {\n";
3827-
OS << " return " << GenerateTestExpression(LangOpts, true) << ";\n";
3827+
OS << " if (" << GenerateTestExpression(LangOpts, true) << ")\n";
3828+
OS << " return true;\n\n";
3829+
OS << " return !" << GenerateTestExpression(LangOpts, false) << ";\n";
38283830
OS << "}\n\n";
38293831
}
38303832

0 commit comments

Comments
 (0)