From f7d9b263844c731f5872a502f33d03f48d38cf6c Mon Sep 17 00:00:00 2001 From: Andrey Turetskiy Date: Tue, 19 Apr 2016 16:25:30 +0000 Subject: [PATCH] Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots. llvm-svn: 266753 --- clang/include/clang/Driver/Options.td | 2 -- clang/lib/Driver/Driver.cpp | 41 ++++++--------------------- clang/lib/Driver/Tools.cpp | 7 ----- clang/test/Driver/miamcu-opt.c | 21 -------------- 4 files changed, 8 insertions(+), 63 deletions(-) delete mode 100644 clang/test/Driver/miamcu-opt.c diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9bc6bbc6979a..946f29dec39f 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1292,8 +1292,6 @@ def m3dnow : Flag<["-"], "m3dnow">, Group; def m64 : Flag<["-"], "m64">, Group, Flags<[DriverOption, CoreOption]>; def mx32 : Flag<["-"], "mx32">, Group, Flags<[DriverOption, CoreOption]>; def mabi_EQ : Joined<["-"], "mabi=">, Group; -def miamcu : Flag<["-"], "miamcu">, Group, Flags<[DriverOption, CoreOption]>, - HelpText<"Use Intel MCU ABI">; def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group; def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group; def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group; diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index c7a65fe58552..74121ecf51de 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -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 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(); diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 90541336702a..4dd860227dda 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -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, diff --git a/clang/test/Driver/miamcu-opt.c b/clang/test/Driver/miamcu-opt.c deleted file mode 100644 index 0c9a926999d2..000000000000 --- a/clang/test/Driver/miamcu-opt.c +++ /dev/null @@ -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"