[PATCH] D83698: Port Target option flags to new option parsing system
Daniel Grumberg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 15 07:16:16 PDT 2020
dang updated this revision to Diff 278179.
dang added a comment.
Remove -triple that got duplicated
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83698/new/
https://reviews.llvm.org/D83698
Files:
clang/include/clang/Driver/Options.td
clang/lib/Frontend/CompilerInvocation.cpp
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -3576,9 +3576,6 @@
Opts.LinkerVersion =
std::string(Args.getLastArgValue(OPT_target_linker_version));
Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ);
- Opts.ForceEnableInt128 = Args.hasArg(OPT_fforce_enable_int128);
- Opts.NVPTXUseShortPointers = Args.hasFlag(
- options::OPT_fcuda_short_ptr, options::OPT_fno_cuda_short_ptr, false);
if (Arg *A = Args.getLastArg(options::OPT_target_sdk_version_EQ)) {
llvm::VersionTuple Version;
if (Version.tryParse(A->getValue()))
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -562,6 +562,21 @@
} // Flags = [CC1Option, CC1AsOption, NoDriverOption]
+// Target Options
+
+defm cuda_short_ptr : BooleanMarshalledFFlag<"cuda-short-ptr", "TargetOpts->NVPTXUseShortPointers", "false",
+ "Use 32-bit pointers for accessing const/local/shared address spaces">;
+defm force_enable_int128 : OptInFFlag<"force-enable-int128", "Enable", "Disable", " support for int128_t type", [], "TargetOpts->ForceEnableInt128">;
+
+let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
+
+def triple : Separate<["-"], "triple">,
+ HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
+ MarshallingInfoString<"TargetOpts->Triple", "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
+ AlwaysEmit, Normalizer<"normalizeTriple">, DenormalizeString;
+
+} // Flags = [CC1Option, CC1AsOption, NoDriverOption]
+
// Standard Options
def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[DriverOption, CoreOption]>,
@@ -835,8 +850,6 @@
"Generate relocatable device code, also known as separate compilation mode", "", "">;
def : Flag<["-"], "fcuda-rdc">, Alias<fgpu_rdc>;
def : Flag<["-"], "fno-cuda-rdc">, Alias<fno_gpu_rdc>;
-defm cuda_short_ptr : OptInFFlag<"cuda-short-ptr",
- "Use 32-bit pointers for accessing const/local/shared address spaces">;
def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group<i_Group>,
HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<Link_Group>,
@@ -1157,7 +1170,6 @@
def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
defm jump_tables : OptOutFFlag<"jump-tables", "Use", "Do not use", " jump tables for lowering switches">;
-defm force_enable_int128 : OptInFFlag<"force-enable-int128", "Enable", "Disable", " support for int128_t type">;
defm keep_static_consts : OptInFFlag<"keep-static-consts", "Keep", "Don't keep", " static const variables if unused", [DriverOption]>;
defm fixed_point : OptInFFlag<"fixed-point", "Enable", "Disable", " fixed point types">;
defm cxx_static_destructors : OptOutFFlag<"c++-static-destructors", "",
@@ -3611,10 +3623,6 @@
HelpText<"Target a specific cpu type">;
def target_feature : Separate<["-"], "target-feature">,
HelpText<"Target specific attributes">;
-def triple : Separate<["-"], "triple">,
- HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
- MarshallingInfoString<"TargetOpts->Triple", "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
- AlwaysEmit, Normalizer<"normalizeTriple">, DenormalizeString;
def target_abi : Separate<["-"], "target-abi">,
HelpText<"Target a particular ABI type">;
def target_sdk_version_EQ : Joined<["-"], "target-sdk-version=">,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83698.278179.patch
Type: text/x-patch
Size: 3782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200715/d5f6a4ef/attachment.bin>
More information about the cfe-commits
mailing list