summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2015-07-28 21:01:21 +0000
committerArtem Belevich <tra@google.com>2015-07-28 21:01:21 +0000
commit4242f41d8ab4c1fdd8168b97cf3813a3bfd90dd9 (patch)
tree27022dee87d23151bab4cfdc0d81aaef3af8c14d /clang
parent97c45b65884af7147d4b11516bc1017f50fac58e (diff)
downloadbcm5719-llvm-4242f41d8ab4c1fdd8168b97cf3813a3bfd90dd9.tar.gz
bcm5719-llvm-4242f41d8ab4c1fdd8168b97cf3813a3bfd90dd9.zip
--cuda-host-only should not disable linking phase.
Host-only cuda compilation does produce valid host object file and in some cases users do want to proceed on to the linking phase. The change removes special case that stopped compilation pipeline at the Assembly phase. Device-side compilation is still stopped early by the types::getCompilationPhases(). Differential Revision: http://reviews.llvm.org/D11573 llvm-svn: 243478
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Driver/Driver.cpp6
-rw-r--r--clang/test/Driver/cuda-options.cu4
2 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 76df10babba..86cf8556ef2 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -174,10 +174,8 @@ phases::ID Driver::getFinalPhase(const DerivedArgList &DAL,
} else if ((PhaseArg = DAL.getLastArg(options::OPT_S))) {
FinalPhase = phases::Backend;
- // -c and partial CUDA compilations only run up to the assembler.
- } else if ((PhaseArg = DAL.getLastArg(options::OPT_c)) ||
- (PhaseArg = DAL.getLastArg(options::OPT_cuda_device_only)) ||
- (PhaseArg = DAL.getLastArg(options::OPT_cuda_host_only))) {
+ // -c compilation only runs up to the assembler.
+ } else if ((PhaseArg = DAL.getLastArg(options::OPT_c))) {
FinalPhase = phases::Assemble;
// Otherwise do everything.
diff --git a/clang/test/Driver/cuda-options.cu b/clang/test/Driver/cuda-options.cu
index 65d4913a159..37411680b61 100644
--- a/clang/test/Driver/cuda-options.cu
+++ b/clang/test/Driver/cuda-options.cu
@@ -27,8 +27,8 @@
// RUN: | FileCheck -check-prefix CUDA-ND \
// Then compile host side and make sure we don't attempt to incorporate GPU code.
// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-NI \
-// Make sure we don't link anything.
-// RUN: -check-prefix CUDA-NL %s
+// Linking is allowed to happen, even if we're missing GPU code.
+// RUN: -check-prefix CUDA-L %s
// Verify that -cuda-no-host disables host-side compilation and linking
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only %s 2>&1 \
OpenPOWER on IntegriCloud