Skip to content

Commit 39a555e

Browse files
authored
[Driver][SYCL] Remove real_path workaround for integration header (#2689)
We applied a workaround for integration header usage on Windows that corrected the directory name in case it did not match expectations of the file system (lowercase/uppercase like things). The workaround is not needed anymore as community has addressed the non-portable path warning directly for Windows.
1 parent 82280a3 commit 39a555e

File tree

4 files changed

+3
-27
lines changed

4 files changed

+3
-27
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6329,24 +6329,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
63296329
// Host-side SYCL compilation receives the integration header file as
63306330
// Inputs[1]. Include the header with -include
63316331
if (!IsSYCLOffloadDevice && SYCLDeviceInput) {
6332-
SmallString<128> RealPath;
6333-
#if defined(_WIN32)
6334-
// Fixup the header path name in case there are discrepancies in the
6335-
// string used for the temporary directory environment variable and
6336-
// actual path expectations.
6337-
//
6338-
// While generating the driver commands, we're most often working
6339-
// with non-existing files. The Unix implementation of LLVM's real_path
6340-
// returns an empty path for a non-existing file if it's expected to be
6341-
// placed in the current directory. This becomes a problem when we're
6342-
// saving intermediate compilation results via -save-temps.
6343-
// Since the header file path fix-up is Windows-specific, the real_path
6344-
// call is not necessary for a Unix-based OS (case-sensitive filesystem).
6345-
llvm::sys::fs::real_path(SYCLDeviceInput->getFilename(), RealPath);
6346-
#else // _WIN32
6347-
RealPath.assign(StringRef(SYCLDeviceInput->getFilename()));
6348-
#endif // _WIN32
6349-
const char *IntHeaderPath = Args.MakeArgString(RealPath);
6332+
const char *IntHeaderPath =
6333+
Args.MakeArgString(SYCLDeviceInput->getFilename());
63506334
CmdArgs.push_back("-include");
63516335
CmdArgs.push_back(IntHeaderPath);
63526336
// When creating dependency information, filter out the generated

clang/test/Driver/sycl-offload-header-check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
// CHECK-HEADER: clang{{.*}} "-fsycl-int-header=[[HEADER:.+\.h]]"
1313
// CHECK-HEADER: {{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"
1414
// CHECK-HEADER-NOT: clang{{.*}} "-include" "[[HEADER]]"
15-
// CHECK-HEADER: clang{{.*}} "-include" "{{.*}}_DiRnAmE{{.+}}.h"
15+
// CHECK-HEADER: clang{{.*}} "-include" "{{.*}}_dirname{{.+}}.h"

clang/test/Driver/sycl-offload-with-split.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,3 @@
284284
// RUN: %clang_cl -### -fsycl -fsycl-device-code-split -fsycl-device-code-split=off %s 2>&1 \
285285
// RUN: | FileCheck %s -check-prefixes=CHK-NO-SPLIT
286286
// CHK-NO-SPLIT-NOT: sycl-post-link{{.*}} -split{{.*}}
287-
288-
// TODO: SYCL specific fail - analyze and enable
289-
// XFAIL: windows-msvc

sycl/test/regression/fsycl-save-temps.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ int main() {
2020
});
2121
return 0;
2222
}
23-
24-
// TODO: Address a Windows-specific issue with integration header filenames
25-
// XFAIL: system-windows && !level_zero
26-
// TODO: fail is flaky on Windows for Level Zero. Enable when fixed.
27-
// UNSUPPORTED: system-windows && level_zero

0 commit comments

Comments
 (0)