[clang] cb81135 - [clang][cli] Implement '-cuid=' marshalling

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 26 04:40:59 PST 2021


Author: Jan Svoboda
Date: 2021-02-26T13:17:51+01:00
New Revision: cb81135f94e58ce0a0e91d764841acee90eeb59f

URL: https://github.com/llvm/llvm-project/commit/cb81135f94e58ce0a0e91d764841acee90eeb59f
DIFF: https://github.com/llvm/llvm-project/commit/cb81135f94e58ce0a0e91d764841acee90eeb59f.diff

LOG: [clang][cli] Implement '-cuid=' marshalling

This patch adds marshalling to the `-cuid=` option introduced in D95007.

Reviewed By: Bigcheese

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index ec0e84fbd771..c34c371197c3 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -934,7 +934,8 @@ def cuid_EQ : Joined<["-"], "cuid=">, Flags<[CC1Option]>,
            "compilation unit but 
diff erent for 
diff erent 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 "

diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dac64183306a..a3b4855ab54f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -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();


        


More information about the cfe-commits mailing list