aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2013-04-14 14:07:51 +0000
committerSimon Atanasyan <simon@atanasyan.com>2013-04-14 14:07:51 +0000
commit321ae79aae228aa069795e78449a95fa35e2abfd (patch)
treeaa86070c2b9f7dad716972674a856346bb444eda /lib/Basic
parenta8141614514634c7bd0ee4bc96e19fb3c10f72f2 (diff)
[Mips] Support -mmicromips / -mno-micromips command line options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/Targets.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 9689193869..95334e010a 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -4405,6 +4405,7 @@ class MipsTargetInfoBase : public TargetInfo {
static const Builtin::Info BuiltinInfo[];
std::string CPU;
bool IsMips16;
+ bool IsMicromips;
bool IsSingleFloat;
enum MipsFloatABI {
HardFloat, SoftFloat
@@ -4423,6 +4424,7 @@ public:
: TargetInfo(triple),
CPU(CPUStr),
IsMips16(false),
+ IsMicromips(false),
IsSingleFloat(false),
FloatABI(HardFloat),
DspRev(NoDSP),
@@ -4461,6 +4463,9 @@ public:
if (IsMips16)
Builder.defineMacro("__mips16", Twine(1));
+ if (IsMicromips)
+ Builder.defineMacro("__mips_micromips", Twine(1));
+
switch (DspRev) {
default:
break;
@@ -4550,7 +4555,8 @@ public:
Name == "o32" || Name == "n32" || Name == "n64" || Name == "eabi" ||
Name == "mips32" || Name == "mips32r2" ||
Name == "mips64" || Name == "mips64r2" ||
- Name == "mips16" || Name == "dsp" || Name == "dspr2") {
+ Name == "mips16" || Name == "micromips" ||
+ Name == "dsp" || Name == "dspr2") {
Features[Name] = Enabled;
return true;
} else if (Name == "32") {
@@ -4565,6 +4571,7 @@ public:
virtual void HandleTargetFeatures(std::vector<std::string> &Features) {
IsMips16 = false;
+ IsMicromips = false;
IsSingleFloat = false;
FloatABI = HardFloat;
DspRev = NoDSP;
@@ -4577,6 +4584,8 @@ public:
FloatABI = SoftFloat;
else if (*it == "+mips16")
IsMips16 = true;
+ else if (*it == "+micromips")
+ IsMicromips = true;
else if (*it == "+dsp")
DspRev = std::max(DspRev, DSP1);
else if (*it == "+dspr2")