forked from OSchip/llvm-project
Revert "[Driver] Delete -mimplicit-it="
This reverts commit 2919222d80
.
That commit broke backwards compatibility. Additionally, the
replacement, -Wa,-mimplicit-it, isn't yet supported by any stable
release of Clang.
See D102812 for a fix for the error cases when callers specify both
-mimplicit-it and -Wa,-mimplicit-it.
This commit is contained in:
parent
09a8372726
commit
688b917b4b
|
@ -3017,6 +3017,7 @@ 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>;
|
||||
|
|
|
@ -2393,6 +2393,22 @@ 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".
|
||||
|
||||
|
@ -4337,6 +4353,16 @@ 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);
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
// 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='
|
|
@ -20,6 +20,13 @@
|
|||
// 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
|
||||
|
@ -31,5 +38,7 @@
|
|||
// 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'
|
||||
|
|
|
@ -53,6 +53,20 @@
|
|||
// 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
|
||||
|
|
Loading…
Reference in New Issue