r200223 - [Mips] Fix __mips macro definition.
Simon Atanasyan
simon at atanasyan.com
Mon Jan 27 05:59:12 PST 2014
Author: atanasyan
Date: Mon Jan 27 07:59:11 2014
New Revision: 200223
URL: http://llvm.org/viewvc/llvm-project?rev=200223&view=rev
Log:
[Mips] Fix __mips macro definition.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/init.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=200223&r1=200222&r2=200223&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Jan 27 07:59:11 2014
@@ -4876,8 +4876,11 @@ public:
virtual void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
- DefineStd(Builder, "mips", Opts);
+ Builder.defineMacro("__mips__");
Builder.defineMacro("_mips");
+ if (Opts.GNUMode)
+ Builder.defineMacro("mips");
+
Builder.defineMacro("__REGISTER_PREFIX__", "");
switch (FloatABI) {
@@ -5085,6 +5088,8 @@ public:
MacroBuilder &Builder) const {
MipsTargetInfoBase::getTargetDefines(Opts, Builder);
+ Builder.defineMacro("__mips", "32");
+
if (ABI == "o32") {
Builder.defineMacro("__mips_o32");
Builder.defineMacro("_ABIO32", "1");
@@ -5204,6 +5209,7 @@ public:
MacroBuilder &Builder) const {
MipsTargetInfoBase::getTargetDefines(Opts, Builder);
+ Builder.defineMacro("__mips", "64");
Builder.defineMacro("__mips64");
Builder.defineMacro("__mips64__");
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=200223&r1=200222&r2=200223&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Mon Jan 27 07:59:11 2014
@@ -973,7 +973,7 @@
// MIPS32BE:#define __WINT_WIDTH__ 32
// MIPS32BE:#define __clang__ 1
// MIPS32BE:#define __llvm__ 1
-// MIPS32BE:#define __mips 1
+// MIPS32BE:#define __mips 32
// MIPS32BE:#define __mips__ 1
// MIPS32BE:#define __mips_fpr 32
// MIPS32BE:#define __mips_hard_float 1
@@ -1089,7 +1089,7 @@
// MIPS32EL:#define __WINT_WIDTH__ 32
// MIPS32EL:#define __clang__ 1
// MIPS32EL:#define __llvm__ 1
-// MIPS32EL:#define __mips 1
+// MIPS32EL:#define __mips 32
// MIPS32EL:#define __mips__ 1
// MIPS32EL:#define __mips_fpr 32
// MIPS32EL:#define __mips_hard_float 1
@@ -1205,7 +1205,7 @@
// MIPS64BE:#define __WINT_WIDTH__ 32
// MIPS64BE:#define __clang__ 1
// MIPS64BE:#define __llvm__ 1
-// MIPS64BE:#define __mips 1
+// MIPS64BE:#define __mips 64
// MIPS64BE:#define __mips64 1
// MIPS64BE:#define __mips64__ 1
// MIPS64BE:#define __mips__ 1
@@ -1323,7 +1323,7 @@
// MIPS64EL:#define __WINT_WIDTH__ 32
// MIPS64EL:#define __clang__ 1
// MIPS64EL:#define __llvm__ 1
-// MIPS64EL:#define __mips 1
+// MIPS64EL:#define __mips 64
// MIPS64EL:#define __mips64 1
// MIPS64EL:#define __mips64__ 1
// MIPS64EL:#define __mips__ 1
More information about the cfe-commits
mailing list