[cfe-commits] [PATCH] Pre-define __mips64 / __mips64__ for MIPS64 target.

Brad Smith brad at comstyle.com
Wed Aug 29 08:48:58 PDT 2012


Hi,

While getting LLVM going on OpenBSD's 64-bit MIPS ports we noticed
that Clang doesn't define __mips64 / __mips64__ as gcc does. The
attached patch fixes this.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp	(revision 162840)
+++ lib/Basic/Targets.cpp	(working copy)
@@ -4053,6 +4053,8 @@
                                 MacroBuilder &Builder) const {
     DefineStd(Builder, "mips", Opts);
     Builder.defineMacro("_mips");
+    Builder.defineMacro("__mips64");
+    Builder.defineMacro("__mips64__");
     DefineStd(Builder, "MIPSEB", Opts);
     Builder.defineMacro("_MIPSEB");
     Builder.defineMacro("__REGISTER_PREFIX__", "");
@@ -4080,6 +4082,8 @@
                                 MacroBuilder &Builder) const {
     DefineStd(Builder, "mips", Opts);
     Builder.defineMacro("_mips");
+    Builder.defineMacro("__mips64");
+    Builder.defineMacro("__mips64__");
     DefineStd(Builder, "MIPSEL", Opts);
     Builder.defineMacro("_MIPSEL");
     Builder.defineMacro("__REGISTER_PREFIX__", "");
Index: test/Preprocessor/init.c
===================================================================
--- test/Preprocessor/init.c	(revision 162840)
+++ test/Preprocessor/init.c	(working copy)
@@ -794,6 +794,8 @@
 // MIPS64BE:#define __mips__ 1
 // MIPS64BE:#define __mips_hard_float 1
 // MIPS64BE:#define __mips_n64 1
+// MIPS64BE:#define __mips64 1
+// MIPS64BE:#define __mips64__ 1
 // MIPS64BE:#define _mips 1
 // MIPS64BE:#define mips 1
 //
@@ -907,6 +909,8 @@
 // MIPS64EL:#define __mips__ 1
 // MIPS64EL:#define __mips_hard_float 1
 // MIPS64EL:#define __mips_n64 1
+// MIPS64EL:#define __mips64 1
+// MIPS64EL:#define __mips64__ 1
 // MIPS64EL:#define _mips 1
 // MIPS64EL:#define mips 1
 //


More information about the cfe-commits mailing list