Skip to content

[Driver][SYCL] Remove real_path workaround for integration header #2689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6289,24 +6289,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Host-side SYCL compilation receives the integration header file as
// Inputs[1]. Include the header with -include
if (!IsSYCLOffloadDevice && SYCLDeviceInput) {
SmallString<128> RealPath;
#if defined(_WIN32)
// Fixup the header path name in case there are discrepancies in the
// string used for the temporary directory environment variable and
// actual path expectations.
//
// While generating the driver commands, we're most often working
// with non-existing files. The Unix implementation of LLVM's real_path
// returns an empty path for a non-existing file if it's expected to be
// placed in the current directory. This becomes a problem when we're
// saving intermediate compilation results via -save-temps.
// Since the header file path fix-up is Windows-specific, the real_path
// call is not necessary for a Unix-based OS (case-sensitive filesystem).
llvm::sys::fs::real_path(SYCLDeviceInput->getFilename(), RealPath);
#else // _WIN32
RealPath.assign(StringRef(SYCLDeviceInput->getFilename()));
#endif // _WIN32
const char *IntHeaderPath = Args.MakeArgString(RealPath);
const char *IntHeaderPath =
Args.MakeArgString(SYCLDeviceInput->getFilename());
CmdArgs.push_back("-include");
CmdArgs.push_back(IntHeaderPath);
// When creating dependency information, filter out the generated
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/sycl-offload-header-check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
// CHECK-HEADER: clang{{.*}} "-fsycl-int-header=[[HEADER:.+\.h]]"
// CHECK-HEADER: {{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"
// CHECK-HEADER-NOT: clang{{.*}} "-include" "[[HEADER]]"
// CHECK-HEADER: clang{{.*}} "-include" "{{.*}}_DiRnAmE{{.+}}.h"
// CHECK-HEADER: clang{{.*}} "-include" "{{.*}}_dirname{{.+}}.h"
3 changes: 0 additions & 3 deletions clang/test/Driver/sycl-offload-with-split.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,3 @@
// RUN: %clang_cl -### -fsycl -fsycl-device-code-split -fsycl-device-code-split=off %s 2>&1 \
// RUN: | FileCheck %s -check-prefixes=CHK-NO-SPLIT
// CHK-NO-SPLIT-NOT: sycl-post-link{{.*}} -split{{.*}}

// TODO: SYCL specific fail - analyze and enable
// XFAIL: windows-msvc
5 changes: 0 additions & 5 deletions sycl/test/regression/fsycl-save-temps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ int main() {
});
return 0;
}

// TODO: Address a Windows-specific issue with integration header filenames
// XFAIL: system-windows && !level_zero
// TODO: fail is flaky on Windows for Level Zero. Enable when fixed.
// UNSUPPORTED: system-windows && level_zero