From 0e62ce1a79a14e956814a97eb17b86fc1716afab Mon Sep 17 00:00:00 2001 From: Simon Dardis Date: Wed, 19 Jul 2017 13:34:08 +0000 Subject: [PATCH] Revert "Reland "[mips] Teach the driver to accept -m(no-)gpopt."" This reverts r308458. Investigating further buildbot breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308459 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticDriverKinds.td | 4 --- include/clang/Basic/DiagnosticGroups.td | 1 - include/clang/Driver/Options.td | 6 ----- lib/Driver/ToolChains/Clang.cpp | 27 -------------------- test/Driver/mips-features.c | 25 ------------------ test/Driver/mips-gpopt-warning.c | 6 ----- 6 files changed, 69 deletions(-) delete mode 100644 test/Driver/mips-gpopt-warning.c diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index f7fc49f30b..a28d631827 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -279,10 +279,6 @@ def warn_target_unsupported_nanlegacy : Warning< def warn_target_unsupported_compact_branches : Warning< "ignoring '-mcompact-branches=' option because the '%0' architecture does not" " support it">, InGroup; -def warn_drv_unsupported_gpopt : Warning< - "ignoring '-mgpopt' option as it cannot be used with %select{|the implicit" - " usage of}0-mabicalls">, - InGroup; def warn_drv_unable_to_find_directory_expected : Warning< "unable to find %0 directory, expected to be in '%1'">, diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 9a6f3334ab..53d8f36ecd 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -61,7 +61,6 @@ def DoublePromotion : DiagGroup<"double-promotion">; def EnumTooLarge : DiagGroup<"enum-too-large">; def UnsupportedNan : DiagGroup<"unsupported-nan">; def UnsupportedCB : DiagGroup<"unsupported-cb">; -def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">; def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">; def NullConversion : DiagGroup<"null-conversion">; def ImplicitConversionFloatingPointToBool : diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 0731ed62ef..753c178eec 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -2035,12 +2035,6 @@ def mfp64 : Flag<["-"], "mfp64">, Group, HelpText<"Use 64-bit floating point registers (MIPS only)">; def mfp32 : Flag<["-"], "mfp32">, Group, HelpText<"Use 32-bit floating point registers (MIPS only)">; -def mgpopt : Flag<["-"], "mgpopt">, Group, - HelpText<"Use GP relative accesses for symbols known to be in a small" - " data section (MIPS)">; -def mno_gpopt : Flag<["-"], "mno-gpopt">, Group, - HelpText<"Do not use GP relative accesses for symbols known to be in a small" - " data section (MIPS)">; def mnan_EQ : Joined<["-"], "mnan=">, Group; def mabicalls : Flag<["-"], "mabicalls">, Group, HelpText<"Enable SVR4-style position-independent code (Mips only)">; diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 35cc06e368..b82cc2d4fa 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -1462,33 +1462,6 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args, A->claim(); } - Arg *GPOpt = Args.getLastArg(options::OPT_mgpopt, options::OPT_mno_gpopt); - Arg *ABICalls = - Args.getLastArg(options::OPT_mabicalls, options::OPT_mno_abicalls); - - // -mabicalls is the default for many MIPS environments, even with -fno-pic. - // -mgpopt is the default for static, -fno-pic environments but these two - // options conflict. We want to be certain that -mno-abicalls -mgpopt is - // the only case where -mllvm -mgpopt is passed. - // NOTE: We need a warning here or in the backend to warn when -mgpopt is - // passed explicitly when compiling something with -mabicalls - // (implictly) in affect. Currently the warning is in the backend. - bool NoABICalls = - ABICalls && ABICalls->getOption().matches(options::OPT_mno_abicalls); - bool WantGPOpt = GPOpt && GPOpt->getOption().matches(options::OPT_mgpopt); - if (NoABICalls && (!GPOpt || WantGPOpt)) { - CmdArgs.push_back("-mllvm"); - CmdArgs.push_back("-mgpopt=1"); - } else { - CmdArgs.push_back("-mllvm"); - CmdArgs.push_back("-mgpopt=0"); - if ((!ABICalls || (!NoABICalls && ABICalls)) && WantGPOpt) - D.Diag(diag::warn_drv_unsupported_gpopt) << (ABICalls ? 0 : 1); - } - - if (GPOpt) - GPOpt->claim(); - if (Arg *A = Args.getLastArg(options::OPT_mcompact_branches_EQ)) { StringRef Val = StringRef(A->getValue()); if (mips::hasCompactBranches(CPUName)) { diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c index 008d90e22b..b228a2d578 100644 --- a/test/Driver/mips-features.c +++ b/test/Driver/mips-features.c @@ -10,31 +10,6 @@ // RUN: | FileCheck --check-prefix=CHECK-MNOABICALLS %s // CHECK-MNOABICALLS: "-target-feature" "+noabicalls" // -// -mgpopt -// RUN: %clang -target mips-linux-gnu -### -c %s -mno-gpopt -mgpopt 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MGPOPT-DEF-ABICALLS %s -// CHECK-MGPOPT-DEF-ABICALLS-NOT: "-mllvm" "-mgpopt" -// -// -mabicalls -mgpopt -// RUN: %clang -target mips-linux-gnu -### -c %s -mabicalls -mno-gpopt -mgpopt 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MGPOPT-EXPLICIT-ABICALLS %s -// CHECK-MGPOPT-EXPLICIT-ABICALLS-NOT: "-mllvm" "-mgpopt" -// -// -mno-abicalls -mgpopt -// RUN: %clang -target mips-linux-gnu -### -c %s -mno-abicalls -mno-gpopt -mgpopt 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MGPOPT %s -// CHECK-MGPOPT: "-mllvm" "-mgpopt=1" -// -// -mno-abicalls -mno-gpopt -// RUN: %clang -target mips-linux-gnu -### -c %s -mno-abicalls -mgpopt -mno-gpopt 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MNOGPOPT %s -// CHECK-MNOGPOPT: "-mllvm" "-mgpopt=0" -// -// -mno-abicalls -// RUN: %clang -target mips-linux-gnu -### -c %s -mno-abicalls 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MGPOPTDEF %s -// CHECK-MGPOPTDEF: "-mllvm" "-mgpopt=1" -// // -mips16 // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -mno-mips16 -mips16 2>&1 \ diff --git a/test/Driver/mips-gpopt-warning.c b/test/Driver/mips-gpopt-warning.c deleted file mode 100644 index a8ab887939..0000000000 --- a/test/Driver/mips-gpopt-warning.c +++ /dev/null @@ -1,6 +0,0 @@ -// REQUIRES: mips-registered-target -// RUN: %clang -### -c -target mips-mti-elf %s -mgpopt 2>&1 | FileCheck -check-prefix=IMPLICIT %s -// IMPLICIT: warning: ignoring '-mgpopt' option as it cannot be used with the implicit usage of-mabicalls - -// RUN: %clang -### -c -target mips-mti-elf %s -mgpopt -mabicalls 2>&1 | FileCheck -check-prefix=EXPLICIT %s -// EXPLICIT: warning: ignoring '-mgpopt' option as it cannot be used with -mabicalls -- 2.40.0