Added comment

http://reviews.llvm.org/D6402

Files:
  lib/Frontend/InitPreprocessor.cpp
  test/Preprocessor/init.c
Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -662,7 +662,12 @@
                    TI.getTypeWidth(TI.getWCharType()), TI, Builder);
   DefineTypeSizeof("__SIZEOF_WINT_T__",
                    TI.getTypeWidth(TI.getWIntType()), TI, Builder);
-  if (TI.hasInt128Type())
+  // This is a temporary workaround while MIPS64 has not yet fully supported
+  // 128-bit integers. But declaration of int128 type is necessary even though
+  // __SIZEOF_INT128__ is undefined because standard header files like limits.h
+  // throw error message if __int128 is not available.
+  if (TI.hasInt128Type() && !(TI.getTriple().getArch() == llvm::Triple::mips64el
+                   || TI.getTriple().getArch() == llvm::Triple::mips64))
     DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
 
   DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
Index: test/Preprocessor/init.c
===================================================================
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -3138,6 +3138,7 @@
 // MIPS64BE:#define __SIG_ATOMIC_WIDTH__ 32
 // MIPS64BE:#define __SIZEOF_DOUBLE__ 8
 // MIPS64BE:#define __SIZEOF_FLOAT__ 4
+// MIPS64BE-NOT:#define __SIZEOF_INT128__ 16
 // MIPS64BE:#define __SIZEOF_INT__ 4
 // MIPS64BE:#define __SIZEOF_LONG_DOUBLE__ 16
 // MIPS64BE:#define __SIZEOF_LONG_LONG__ 8
@@ -3345,6 +3346,7 @@
 // MIPS64EL:#define __SIG_ATOMIC_WIDTH__ 32
 // MIPS64EL:#define __SIZEOF_DOUBLE__ 8
 // MIPS64EL:#define __SIZEOF_FLOAT__ 4
+// MIPS64EL-NOT:#define __SIZEOF_INT128__ 16
 // MIPS64EL:#define __SIZEOF_INT__ 4
 // MIPS64EL:#define __SIZEOF_LONG_DOUBLE__ 16
 // MIPS64EL:#define __SIZEOF_LONG_LONG__ 8
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to