Skip to content

[SYCL][Driver] Prevent duplication of error diagnostics for -fsycl #1007

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 1 commit into from
Jan 15, 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
9 changes: 5 additions & 4 deletions clang/lib/Driver/Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ static bool ActionFailed(const Action *A,
if (FailingCommands.empty())
return false;

// CUDA/HIP can have the same input source code compiled multiple times so do
// not compiled again if there are already failures. It is OK to abort the
// CUDA pipeline on errors.
if (A->isOffloading(Action::OFK_Cuda) || A->isOffloading(Action::OFK_HIP))
// CUDA/HIP/SYCL can have the same input source code compiled multiple times
// so do not compile again if there are already failures. It is OK to abort
// the CUDA pipeline on errors.
if (A->isOffloading(Action::OFK_Cuda) || A->isOffloading(Action::OFK_HIP) ||
A->isOffloading(Action::OFK_SYCL))
return true;

for (const auto &CI : FailingCommands)
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Driver/sycl-offload-dup-error.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Tests to make sure that there is no duplicate error messaging for host
// REQUIRES: x86-registered-target
// RUN: not %clangxx -c -target x86_64-unknown-linux-gnu -fsycl %s \
// RUN: 2>&1 | FileCheck %s

void foo() {
foobar s;
}

// CHECK: error: unknown type name 'foobar'
// CHECK-NOT: error: unknown type name 'foobar'