[clang][cli] Implement '-cuid=' marshalling
authorJan Svoboda <jan_svoboda@apple.com>
Thu, 25 Feb 2021 12:20:59 +0000 (13:20 +0100)
committerJan Svoboda <jan_svoboda@apple.com>
Fri, 26 Feb 2021 12:17:51 +0000 (13:17 +0100)
This patch adds marshalling to the `-cuid=` option introduced in D95007.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D97461

clang/include/clang/Driver/Options.td
clang/lib/Frontend/CompilerInvocation.cpp

index ec0e84f..c34c371 100644 (file)
@@ -934,7 +934,8 @@ def cuid_EQ : Joined<["-"], "cuid=">, Flags<[CC1Option]>,
            "compilation unit but different for different compilation units. "
            "It is used to externalize device-side static variables for single "
            "source offloading languages CUDA and HIP so that they can be "
-           "accessed by the host code of the same compilation unit.">;
+           "accessed by the host code of the same compilation unit.">,
+  MarshallingInfoString<LangOpts<"CUID">>;
 def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">,
   HelpText<"Method to generate ID's for compilation units for single source "
            "offloading languages CUDA and HIP: 'hash' (ID's generated by hashing "
index dac6418..a3b4855 100644 (file)
@@ -3585,11 +3585,6 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
     }
   }
 
-
-  if (auto *A = Args.getLastArg(OPT_cuid_EQ)) {
-    Opts.CUID = std::string(A->getValue());
-  }
-
   if (Opts.ObjC) {
     if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
       StringRef value = arg->getValue();