diff options
author | Simon Atanasyan <satanasyan@mips.com> | 2012-07-05 16:06:06 +0000 |
---|---|---|
committer | Simon Atanasyan <satanasyan@mips.com> | 2012-07-05 16:06:06 +0000 |
commit | 1176bcdb21945c7913d684973887e6f588a49236 (patch) | |
tree | 6a94440c6c464bca5e55c493c772461aca2ae9b8 /lib/Basic/Targets.cpp | |
parent | bbd9916bd91eafb97cc73c2def158b6e5c124d1b (diff) |
MIPS: Define __mips16 macro if -mips16 option is provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 713396c3ab..3eaa65177c 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -3599,6 +3599,7 @@ namespace { class MipsTargetInfoBase : public TargetInfo { static const Builtin::Info BuiltinInfo[]; std::string CPU; + bool IsMips16; enum MipsFloatABI { HardFloat, SingleFloat, SoftFloat } FloatABI; @@ -3612,6 +3613,7 @@ public: const std::string& CPUStr) : TargetInfo(triple), CPU(CPUStr), + IsMips16(false), FloatABI(HardFloat), ABI(ABIStr) {} @@ -3643,6 +3645,9 @@ public: break; } + if (IsMips16) + Builder.defineMacro("__mips16", Twine(1)); + Builder.defineMacro("_MIPS_SZPTR", Twine(getPointerWidth(0))); Builder.defineMacro("_MIPS_SZINT", Twine(getIntWidth())); Builder.defineMacro("_MIPS_SZLONG", Twine(getLongWidth())); @@ -3722,6 +3727,7 @@ public: } virtual void HandleTargetFeatures(std::vector<std::string> &Features) { + IsMips16 = false; FloatABI = HardFloat; for (std::vector<std::string>::iterator it = Features.begin(), @@ -3730,6 +3736,8 @@ public: FloatABI = SingleFloat; else if (*it == "+soft-float") FloatABI = SoftFloat; + else if (*it == "+mips16") + IsMips16 = true; } // Remove front-end specific option. |