summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-10-27 00:53:34 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-10-27 00:53:34 +0000
commit5b1a89a33b2313bea62b18e9272a42f73b791c17 (patch)
tree87a4459d35b43c5f811d7bf30884e660bd15f857 /clang/lib/Driver/Driver.cpp
parent94c427c23eb1e49354503f3a5980f5b574a02999 (diff)
downloadbcm5719-llvm-5b1a89a33b2313bea62b18e9272a42f73b791c17.tar.gz
bcm5719-llvm-5b1a89a33b2313bea62b18e9272a42f73b791c17.zip
Fix bug when compiling CUDA code with -emit-llvm and -o.
In this case the device code is not injected into an host action and therefore the user should get an error as -o can't be used when generating two outputs. llvm-svn: 285263
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index f2ee1ca5c80..4335bbfd42d 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1611,6 +1611,11 @@ class OffloadingActionBuilder final {
// We avoid creating host action in device-only mode.
return CompileDeviceOnly ? ABRT_Ignore_Host : ABRT_Success;
+ } else if (CurPhase > phases::Backend) {
+ // If we are past the backend phase and still have a device action, we
+ // don't have to do anything as this action is already a device
+ // top-level action.
+ return ABRT_Success;
}
assert(CurPhase < phases::Backend && "Generating single CUDA "
OpenPOWER on IntegriCloud