Skip to content

Commit 2c805fc

Browse files
Fznamznonpreethi-intel
authored andcommitted
[SYCL] Fix integration header on Windows
Disable printing anonymous tag locations because Windows file path separators are treated as escape sequences and cause errors when integration header is compiled with host compiler.
1 parent 35a48cb commit 2c805fc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,6 +5074,10 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
50745074
PrintingPolicy Policy(LO);
50755075
Policy.SuppressTypedefs = true;
50765076
Policy.SuppressUnwrittenScope = true;
5077+
// Disable printing anonymous tag locations because on Windows
5078+
// file path separators are treated as escape sequences and cause errors
5079+
// when integration header is compiled with host compiler.
5080+
Policy.AnonymousTagLocations = 0;
50775081
SYCLFwdDeclEmitter FwdDeclEmitter(O, S.getLangOpts());
50785082

50795083
// Predefines which need to be set for custom host compilation

clang/test/CodeGenSYCL/code_location.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int test1() {
2222
// CHECK: }
2323
// CHECK: static constexpr const char* getFunctionName() {
2424
// CHECK: #ifndef NDEBUG
25-
// CHECK: return "";
25+
// CHECK: return "class (lambda)";
2626
// CHECK: #else
2727
// CHECK: return "";
2828
// CHECK: #endif
@@ -214,7 +214,7 @@ int test5() {
214214
// CHECK: }
215215
// CHECK: static constexpr const char* getFunctionName() {
216216
// CHECK: #ifndef NDEBUG
217-
// CHECK: return "NS::";
217+
// CHECK: return "NS::class (lambda)";
218218
// CHECK: #else
219219
// CHECK: return "";
220220
// CHECK: #endif

0 commit comments

Comments
 (0)