[cfe-commits] r169098 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp test/Driver/mips-features.c
Simon Atanasyan
satanasyan at mips.com
Sat Dec 1 10:27:21 PST 2012
Author: atanasyan
Date: Sat Dec 1 12:27:21 2012
New Revision: 169098
URL: http://llvm.org/viewvc/llvm-project?rev=169098&view=rev
Log:
[MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/mips-features.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=169098&r1=169097&r2=169098&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Sat Dec 1 12:27:21 2012
@@ -875,6 +875,8 @@
def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>;
def mips16 : Flag<["-"], "mips16">, Group<m_Group>;
def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_Group>;
+def mxgot : Flag<["-"], "mxgot">, Group<m_Group>;
+def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_Group>;
def mdsp : Flag<["-"], "mdsp">, Group<m_Group>;
def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_Group>;
def mdspr2 : Flag<["-"], "mdspr2">, Group<m_Group>;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=169098&r1=169097&r2=169098&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Dec 1 12:27:21 2012
@@ -990,6 +990,13 @@
options::OPT_mdspr2, options::OPT_mno_dspr2,
"dspr2");
+ if (Arg *A = Args.getLastArg(options::OPT_mxgot, options::OPT_mno_xgot)) {
+ if (A->getOption().matches(options::OPT_mxgot)) {
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-mxgot");
+ }
+ }
+
if (Arg *A = Args.getLastArg(options::OPT_G)) {
StringRef v = A->getValue();
CmdArgs.push_back("-mllvm");
Modified: cfe/trunk/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-features.c?rev=169098&r1=169097&r2=169098&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-features.c (original)
+++ cfe/trunk/test/Driver/mips-features.c Sat Dec 1 12:27:21 2012
@@ -38,6 +38,18 @@
// RUN: | FileCheck --check-prefix=CHECK-NOMDSPR2 %s
// CHECK-NOMDSPR2: "-target-feature" "-dspr2"
//
+// -mxgot
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mno-xgot -mxgot 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-XGOT %s
+// CHECK-XGOT: "-mllvm" "-mxgot"
+//
+// -mno-xgot
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mxgot -mno-xgot 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOXGOT %s
+// CHECK-NOXGOT-NOT: "-mllvm" "-mxgot"
+//
// -G
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -G 16 2>&1 \
More information about the cfe-commits
mailing list