MaskRay created this revision. MaskRay added reviewers: nickdesaulniers, ostannard, raj.khem. Herald added subscribers: dang, kristof.beyls. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
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!` Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D102568 Files: clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/arm-implicit-it.s clang/test/Driver/arm-target-as-mimplicit-it.s clang/test/Driver/as-options.s
Index: clang/test/Driver/as-options.s =================================================================== --- clang/test/Driver/as-options.s +++ 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 Index: clang/test/Driver/arm-target-as-mimplicit-it.s =================================================================== --- clang/test/Driver/arm-target-as-mimplicit-it.s +++ 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' Index: clang/test/Driver/arm-implicit-it.s =================================================================== --- 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=' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -2384,22 +2384,6 @@ 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". @@ -4337,16 +4321,6 @@ 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); Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -3005,7 +3005,6 @@ 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>;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits