Skip to content

Commit bbc7b1b

Browse files
committed
Address review comments
- Update clang-cl based test to use Windows triple - Update some comments
1 parent fc4489b commit bbc7b1b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

clang/lib/Driver/Action.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch,
8888
// Deps job uses the host kinds.
8989
if (Kind == OffloadDepsJobClass)
9090
return;
91-
// Packaging actions can use host kinds for preprocessing.
91+
// Packaging actions can use host kinds for preprocessing. When packaging
92+
// preprocessed files, these packaged files will contain both host and device
93+
// files, where the host side does not have any device info to propagate.
9294
bool hasPreprocessJob =
9395
std::any_of(Inputs.begin(), Inputs.end(), [](const Action *A) {
9496
return A->getKind() == PreprocessJobClass;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10391,7 +10391,7 @@ void OffloadPackager::ConstructJob(Compilation &C, const JobAction &JA,
1039110391
CmdArgs, Inputs, Output));
1039210392
}
1039310393

10394-
// Use the clang-offload-packager to extract binaries from an packaged
10394+
// Use the clang-offload-packager to extract binaries from a packaged
1039510395
// binary. This currently only supports single input/single output.
1039610396
void OffloadPackagerExtract::ConstructJob(Compilation &C, const JobAction &JA,
1039710397
const InputInfo &Output,

clang/test/Driver/sycl-preprocess.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
/// When generating preprocessed files, verify the compilation phases.
1919
// RUN: %clangxx --target=x86_64-unknown-linux-gnu --offload-new-driver -fsycl -E %s -o %t.ii -ccc-print-phases 2>&1 \
20-
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES
21-
// RUN: %clang_cl --target=x86_64-unknown-linux-gnu --offload-new-driver -fsycl -P %s -Fi%t.ii -ccc-print-phases 2>&1 \
22-
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES
20+
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES -DTARGET=x86_64-unknown-linux-gnu
21+
// RUN: %clang_cl --target=x86_64-pc-windows-msvc --offload-new-driver -fsycl -P %s -Fi%t.ii -ccc-print-phases 2>&1 \
22+
// RUN: | FileCheck %s -check-prefix PREPROC_PHASES -DTARGET=x86_64-pc-windows-msvc
2323
// PREPROC_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl)
2424
// PREPROC_PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
2525
// PREPROC_PHASES: 2: input, "[[INPUT]]", c++, (device-sycl)
2626
// PREPROC_PHASES: 3: preprocessor, {2}, c++-cpp-output, (device-sycl)
2727
// PREPROC_PHASES: 4: compiler, {3}, none, (device-sycl)
2828
// PREPROC_PHASES: 5: offload, "device-sycl (spir64-unknown-unknown)" {3}, c++-cpp-output
2929
// PREPROC_PHASES: 6: clang-offload-packager, {5, 1}, c++-cpp-output
30-
// PREPROC_PHASES: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (spir64-unknown-unknown)" {3}, "device-sycl (spir64-unknown-unknown)" {4}, " (x86_64-unknown-linux-gnu)" {6}, c++-cpp-output
30+
// PREPROC_PHASES: 7: offload, "host-sycl ([[TARGET]])" {1}, "device-sycl (spir64-unknown-unknown)" {3}, "device-sycl (spir64-unknown-unknown)" {4}, " ([[TARGET]])" {6}, c++-cpp-output
3131

3232
/// When generating preprocessed files, verify the tools called and the expected
3333
/// output file name.

0 commit comments

Comments
 (0)