diff options
author | Simon Atanasyan <satanasyan@mips.com> | 2012-12-01 18:27:21 +0000 |
---|---|---|
committer | Simon Atanasyan <satanasyan@mips.com> | 2012-12-01 18:27:21 +0000 |
commit | bda07ace55e40bd1a620051156fa9b13ad3936aa (patch) | |
tree | 5de95eed33a6fef21b959f1c3797acf236cc781c | |
parent | 9d5a78d5a0c724f35af5ea2f17b2b88b32335e24 (diff) |
[MIPS] Add -mxgot/-mno-xgot command line options
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
-rw-r--r-- | include/clang/Driver/Options.td | 2 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 7 | ||||
-rw-r--r-- | test/Driver/mips-features.c | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 932e78943d..8e31cab356 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -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>; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 89e7d8f16c..16218e1fc5 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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"); diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c index 28048e7740..3bebffc11b 100644 --- a/test/Driver/mips-features.c +++ b/test/Driver/mips-features.c @@ -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 \ |