Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots.

llvm-svn: 266753
This commit is contained in:
Andrey Turetskiy 2016-04-19 16:25:30 +00:00
parent f12cbe7dd6
commit f7d9b26384
4 changed files with 8 additions and 63 deletions

View File

@ -1292,8 +1292,6 @@ def m3dnow : Flag<["-"], "m3dnow">, Group<m_x86_Features_Group>;
def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[DriverOption, CoreOption]>;
def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[DriverOption, CoreOption]>;
def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>;
def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[DriverOption, CoreOption]>,
HelpText<"Use Intel MCU ABI">;
def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>;
def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>;
def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;

View File

@ -278,10 +278,6 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
DAL->append(A);
}
// Enforce -static if -miamcu is present.
if (Args.hasArg(options::OPT_miamcu))
DAL->AddFlagArg(0, Opts->getOption(options::OPT_static));
// Add a default value of -mlinker-version=, if one was given and the user
// didn't specify one.
#if defined(HOST_LINK_VERSION)
@ -300,8 +296,7 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
///
/// This routine provides the logic to compute a target triple from various
/// args passed to the driver and the default triple string.
static llvm::Triple computeTargetTriple(const Driver &D,
StringRef DefaultTargetTriple,
static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple,
const ArgList &Args,
StringRef DarwinArchName = "") {
// FIXME: Already done in Compilation *Driver::BuildCompilation
@ -346,9 +341,8 @@ static llvm::Triple computeTargetTriple(const Driver &D,
return Target;
// Handle pseudo-target flags '-m64', '-mx32', '-m32' and '-m16'.
Arg *A = Args.getLastArg(options::OPT_m64, options::OPT_mx32,
options::OPT_m32, options::OPT_m16);
if (A) {
if (Arg *A = Args.getLastArg(options::OPT_m64, options::OPT_mx32,
options::OPT_m32, options::OPT_m16)) {
llvm::Triple::ArchType AT = llvm::Triple::UnknownArch;
if (A->getOption().matches(options::OPT_m64)) {
@ -373,25 +367,6 @@ static llvm::Triple computeTargetTriple(const Driver &D,
Target.setArch(AT);
}
// Handle -miamcu flag.
if (Args.hasArg(options::OPT_miamcu)) {
if (Target.get32BitArchVariant().getArch() != llvm::Triple::x86)
D.Diag(diag::err_drv_unsupported_opt_for_target) << "-miamcu"
<< Target.str();
if (A && !A->getOption().matches(options::OPT_m32))
D.Diag(diag::err_drv_argument_not_allowed_with)
<< "-miamcu" << A->getBaseArg().getAsString(Args);
Target.setArch(llvm::Triple::x86);
Target.setArchName("i586");
Target.setEnvironment(llvm::Triple::UnknownEnvironment);
Target.setEnvironmentName("");
Target.setOS(llvm::Triple::ELFIAMCU);
Target.setVendor(llvm::Triple::UnknownVendor);
Target.setVendorName("intel");
}
return Target;
}
@ -526,8 +501,8 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
DerivedArgList *TranslatedArgs = TranslateInputArgs(*UArgs);
// Owned by the host.
const ToolChain &TC = getToolChain(
*UArgs, computeTargetTriple(*this, DefaultTargetTriple, *UArgs));
const ToolChain &TC =
getToolChain(*UArgs, computeTargetTriple(DefaultTargetTriple, *UArgs));
// The compilation takes ownership of Args.
Compilation *C = new Compilation(*this, TC, UArgs.release(), TranslatedArgs);
@ -2006,9 +1981,9 @@ InputInfo Driver::BuildJobsForActionNoCache(
const char *ArchName = BAA->getArchName();
if (ArchName)
TC = &getToolChain(C.getArgs(),
computeTargetTriple(*this, DefaultTargetTriple,
C.getArgs(), ArchName));
TC = &getToolChain(
C.getArgs(),
computeTargetTriple(DefaultTargetTriple, C.getArgs(), ArchName));
else
TC = &C.getDefaultToolChain();

View File

@ -2137,13 +2137,6 @@ void Clang::AddX86TargetArgs(const ArgList &Args,
<< A->getOption().getName() << Value;
}
}
// Set flags to support MCU ABI.
if (Args.hasArg(options::OPT_miamcu)) {
CmdArgs.push_back("-mfloat-abi");
CmdArgs.push_back("soft");
CmdArgs.push_back("-mstack-alignment=4");
}
}
void Clang::AddHexagonTargetArgs(const ArgList &Args,

View File

@ -1,21 +0,0 @@
// RUN: %clang -miamcu %s -### -o %t.o 2>&1 | FileCheck %s
// RUN: %clang -miamcu -m32 %s -### -o %t.o 2>&1 | FileCheck %s
// RUN: %clang -miamcu -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s
// RUN: %clang -miamcu -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64
// RUN: %clang -miamcu -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC
// RUN: %clang -miamcu -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86
// M64: error: invalid argument '-miamcu' not allowed with '-m64'
// DYNAMIC: error: invalid argument '-dynamic' not allowed with '-static'
// NOT-X86: error: unsupported option '-miamcu' for target 'armv8---eabi'
// CHECK: "-cc1"
// CHECK: "-triple" "i586-intel-elfiamcu"
// CHECK: "-static-define"
// CHECK: "-mfloat-abi" "soft"
// CHECK: "-mstack-alignment=4"
// CHECK: bin/gcc
// CHECK: "-static"