Author: Fangrui Song Date: 2021-05-18T10:57:24-07:00 New Revision: 2919222d8017f2425a85765b95e4b7c6f8e70ca4
URL: https://github.com/llvm/llvm-project/commit/2919222d8017f2425a85765b95e4b7c6f8e70ca4 DIFF: https://github.com/llvm/llvm-project/commit/2919222d8017f2425a85765b95e4b7c6f8e70ca4.diff LOG: [Driver] Delete -mimplicit-it= This is a GNU as and Clang cc1as option, not a GCC option. Users should specify `-Wa,-mimplicit-it=` instead. Note: mixing the -m option and the -Wa, option doesn't work `-Wa,-mimplicit-it=never -mimplicit-it=always` => `clang (LLVM option parsing): for the --arm-implicit-it option: may only occur zero or one times!` Reviewed By: nickdesaulniers, raj.khem Differential Revision: https://reviews.llvm.org/D102568 Added: Modified: clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/arm-target-as-mimplicit-it.s clang/test/Driver/as-options.s Removed: clang/test/Driver/arm-implicit-it.s ################################################################################ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 09de6b5a50d0..a876f48c5596 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3009,7 +3009,6 @@ def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[NoXarchOp HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): " "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">, MarshallingInfoInt<CodeGenOpts<"TLSSize">>; -def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>; def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>; def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>; def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>; diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index afc119263db9..47552dcb6fdf 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2393,22 +2393,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, DefaultIncrementalLinkerCompatible)) CmdArgs.push_back("-mincremental-linker-compatible"); - switch (C.getDefaultToolChain().getArch()) { - case llvm::Triple::arm: - case llvm::Triple::armeb: - case llvm::Triple::thumb: - case llvm::Triple::thumbeb: - if (Arg *A = Args.getLastArg(options::OPT_mimplicit_it_EQ)) { - StringRef Value = A->getValue(); - if (!AddARMImplicitITArgs(Args, CmdArgs, Value)) - D.Diag(diag::err_drv_unsupported_option_argument) - << A->getOption().getName() << Value; - } - break; - default: - break; - } - // If you add more args here, also add them to the block below that // starts with "// If CollectArgsForIntegratedAssembler() isn't called below". @@ -4353,16 +4337,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.ClaimAllArgs(options::OPT_mno_relax_all); Args.ClaimAllArgs(options::OPT_mincremental_linker_compatible); Args.ClaimAllArgs(options::OPT_mno_incremental_linker_compatible); - switch (C.getDefaultToolChain().getArch()) { - case llvm::Triple::arm: - case llvm::Triple::armeb: - case llvm::Triple::thumb: - case llvm::Triple::thumbeb: - Args.ClaimAllArgs(options::OPT_mimplicit_it_EQ); - break; - default: - break; - } } Args.ClaimAllArgs(options::OPT_Wa_COMMA); Args.ClaimAllArgs(options::OPT_Xassembler); diff --git a/clang/test/Driver/arm-implicit-it.s b/clang/test/Driver/arm-implicit-it.s deleted file mode 100644 index 48e4bdbe8c95..000000000000 --- a/clang/test/Driver/arm-implicit-it.s +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: %clang -target armv7--none-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-DEFAULT - -// RUN: %clang -target armv7--none-eabi -mimplicit-it=arm -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-ARM - -// RUN: %clang -target armv7--none-eabi -mimplicit-it=thumb -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-THUMB - -// RUN: %clang -target armv7--none-eabi -mimplicit-it=never -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NEVER - -// RUN: %clang -target armv7--none-eabi -mimplicit-it=always -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-ALWAYS - -// RUN: %clang -target armv7--none-eabi -mimplicit-it=thisisnotavalidoption -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-INVALID - -// CHECK-DEFAULT-NOT: "-arm-implicit-it -// CHECK-ARM: "-arm-implicit-it=arm" -// CHECK-THUMB: "-arm-implicit-it=thumb" -// CHECK-NEVER: "-arm-implicit-it=never" -// CHECK-ALWAYS: "-arm-implicit-it=always" -// CHECK-INVALID: error: unsupported argument 'thisisnotavalidoption' to option 'mimplicit-it=' diff --git a/clang/test/Driver/arm-target-as-mimplicit-it.s b/clang/test/Driver/arm-target-as-mimplicit-it.s index b13b4918780c..e7da7cf691d6 100644 --- a/clang/test/Driver/arm-target-as-mimplicit-it.s +++ b/clang/test/Driver/arm-target-as-mimplicit-it.s @@ -20,13 +20,6 @@ // RUN: %clang -target arm-linux-gnueabi -### -Wa,-mimplicit-it=always,-mimplicit-it=arm %s 2>&1 | FileCheck %s --check-prefix=ARM // RUN: %clang -target arm-linux-gnueabi -### -Wa,-mimplicit-it=always,-mimplicit-it=thumb %s 2>&1 | FileCheck %s --check-prefix=THUMB -/// Mix -implicit-it= (compiler) with -Wa,-mimplicit-it= (assembler), assembler -/// takes priority. -mllvm -arm-implicit-it= will be repeated, with the -/// assembler flag appearing last (latter wins). -// RUN: %clang -target arm-linux-gnueabi -### -mimplicit-it=never -Wa,-mimplicit-it=always %S/Inputs/wildcard1.c 2>&1 | FileCheck %s --check-prefix=NEVER_ALWAYS -// RUN: %clang -target arm-linux-gnueabi -### -mimplicit-it=always -Wa,-mimplicit-it=never %S/Inputs/wildcard1.c 2>&1 | FileCheck %s --check-prefix=ALWAYS_NEVER -// RUN: %clang -target arm-linux-gnueabi -### -Wa,-mimplicit-it=never -mimplicit-it=always %S/Inputs/wildcard1.c 2>&1 | FileCheck %s --check-prefix=ALWAYS_NEVER - /// Test invalid input. // RUN: %clang -target arm-linux-gnueabi -### -Wa,-mimplicit-it=foo %s 2>&1 | FileCheck %s --check-prefix=INVALID // RUN: %clang -target arm-linux-gnueabi -### -Xassembler -mimplicit-it=foo %s 2>&1 | FileCheck %s --check-prefix=XINVALID @@ -38,7 +31,5 @@ // NEVER: "-mllvm" "-arm-implicit-it=never" // ARM: "-mllvm" "-arm-implicit-it=arm" // THUMB: "-mllvm" "-arm-implicit-it=thumb" -// NEVER_ALWAYS: "-mllvm" "-arm-implicit-it=never" "-mllvm" "-arm-implicit-it=always" -// ALWAYS_NEVER: "-mllvm" "-arm-implicit-it=always" "-mllvm" "-arm-implicit-it=never" // INVALID: error: unsupported argument '-mimplicit-it=foo' to option 'Wa,' // XINVALID: error: unsupported argument '-mimplicit-it=foo' to option 'Xassembler' diff --git a/clang/test/Driver/as-options.s b/clang/test/Driver/as-options.s index 64269683ec34..3d35c6a99928 100644 --- a/clang/test/Driver/as-options.s +++ b/clang/test/Driver/as-options.s @@ -53,20 +53,6 @@ // RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \ // RUN: | FileCheck --check-prefix=WARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -fintegrated-as -o /dev/null -x c++ %s 2>&1 \ -// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s - -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -fintegrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \ -// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s -// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \ -// RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \ -// RUN: | FileCheck --check-prefix=WARN --allow-empty %s - // RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fintegrated-as \ // RUN: -o /dev/null -x c++ %s 2>&1 \ // RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits