]> granicus.if.org Git - clang/commitdiff
[MIPS] Add -mxgot/-mno-xgot command line options
authorSimon Atanasyan <satanasyan@mips.com>
Sat, 1 Dec 2012 18:27:21 +0000 (18:27 +0000)
committerSimon Atanasyan <satanasyan@mips.com>
Sat, 1 Dec 2012 18:27:21 +0000 (18:27 +0000)
to enable/disable support of GOT larger than 64k.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169098 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/mips-features.c

index 932e78943d5c045748c6239861a481f46712e335..8e31cab3567cd2a187ca65c1ec68c56b8798d65e 100644 (file)
@@ -875,6 +875,8 @@ def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
 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>;
index 89e7d8f16c1e298cf4b2fd53a0b990037966bcd5..16218e1fc542346df8a64d16a7d720acfe281bf3 100644 (file)
@@ -990,6 +990,13 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
                    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");
index 28048e7740f2c4a44180129212cc92a188ec909b..3bebffc11bb30ee27e126077ba8882ce21fadc69 100644 (file)
 // 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 \