aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Atanasyan <satanasyan@mips.com>2012-07-05 14:19:39 +0000
committerSimon Atanasyan <satanasyan@mips.com>2012-07-05 14:19:39 +0000
commit0b273efa37a38deab77dadf72540c9c07c63f8cf (patch)
tree2cc5322b72089bf0c3438136e46b5b887622fb3e /lib
parent125aa1fcfa01d01a0becf91ebbfd0e5705f6969d (diff)
MIPS: Add -mips16 / -mno-mips16 command line support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/Targets.cpp3
-rw-r--r--lib/Driver/Tools.cpp9
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index f094784c72..5d29417cb4 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -3708,7 +3708,8 @@ public:
if (Name == "soft-float" || Name == "single-float" ||
Name == "o32" || Name == "n32" || Name == "n64" || Name == "eabi" ||
Name == "mips32" || Name == "mips32r2" ||
- Name == "mips64" || Name == "mips64r2") {
+ Name == "mips64" || Name == "mips64r2" ||
+ Name == "mips16") {
Features[Name] = Enabled;
return true;
}
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index a5e2e401e2..1be4659f61 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -919,6 +919,15 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
CmdArgs.push_back("-mfloat-abi");
CmdArgs.push_back("hard");
}
+
+ if (Arg *A = Args.getLastArg(options::OPT_mips16,
+ options::OPT_mno_mips16)) {
+ CmdArgs.push_back("-target-feature");
+ if (A->getOption().matches(options::OPT_mips16))
+ CmdArgs.push_back("+mips16");
+ else
+ CmdArgs.push_back("-mips16");
+ }
}
/// getPPCTargetCPU - Get the (LLVM) name of the PowerPC cpu we are targeting.