summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-02-12 10:46:45 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-02-12 10:46:45 +0000
commit5379c6d6fd121f822b6b191906fc1aa664726607 (patch)
tree08739fa004f397650e2264ac86c90de555bc2201 /clang/lib/Frontend/CompilerInvocation.cpp
parent15dd8c6c32d84bd3251a63ba15c3d4cc305563c5 (diff)
downloadbcm5719-llvm-5379c6d6fd121f822b6b191906fc1aa664726607.tar.gz
bcm5719-llvm-5379c6d6fd121f822b6b191906fc1aa664726607.zip
[CUDA] Add option to generate relocatable device code
As a first step, pass '-c/--compile-only' to ptxas so that it doesn't complain about references to external function. This will successfully generate object files, but they won't work at runtime because the registration routines need to adapted. Differential Revision: https://reviews.llvm.org/D42921 llvm-svn: 324878
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 95fd1665b40..5b5c24dfc58 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2074,6 +2074,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_approx_transcendentals))
Opts.CUDADeviceApproxTranscendentals = 1;
+ Opts.CUDARelocatableDeviceCode = Args.hasArg(OPT_fcuda_rdc);
+
if (Opts.ObjC1) {
if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
StringRef value = arg->getValue();
OpenPOWER on IntegriCloud