[llvm-commits] [127089] Anton Korobeynikov's fixincludes patch for mingw32

dpatel at apple.com dpatel at apple.com
Wed May 9 23:21:25 PDT 2007


Revision: 127089
Author:   dpatel
Date:     2007-05-09 23:21:25 -0700 (Wed, 09 May 2007)

Log Message:
-----------
Anton Korobeynikov's fixincludes patch for mingw32

Modified Paths:
--------------
    apple-local/branches/llvm/fixincludes/fixincl.x
    apple-local/branches/llvm/fixincludes/inclhack.def
    apple-local/branches/llvm/fixincludes/mkfixinc.sh

Modified: apple-local/branches/llvm/fixincludes/fixincl.x
===================================================================
--- apple-local/branches/llvm/fixincludes/fixincl.x	2007-05-10 04:40:54 UTC (rev 127088)
+++ apple-local/branches/llvm/fixincludes/fixincl.x	2007-05-10 06:21:25 UTC (rev 127089)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday July  8, 2005 at 03:33:04 PM PDT
+ * It has been AutoGen-ed  Thursday May 10, 2007 at 03:18:13 AM MSD
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Jul  8 15:33:04 PDT 2005
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 10 03:18:13 MSD 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 195 fixup descriptions.
+ * This file contains 196 fixup descriptions.
  *
  * See README for more information.
  *
@@ -26,7 +26,8 @@
  *  
  *  You may redistribute it and/or modify it under the terms of the
  *  GNU General Public License, as published by the Free Software
- *  Foundation; either version 2, or (at your option) any later version.
+ *  Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
  *  
  *  inclhack is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,10 +35,10 @@
  *  See the GNU General Public License for more details.
  *  
  *  You should have received a copy of the GNU General Public License
- *  along with inclhack.  See the file "COPYING".  If not,
- *  write to:  The Free Software Foundation, Inc.,
- *             59 Temple Place - Suite 330,
- *             Boston,  MA  02111-1307, USA.
+ *  along with inclhack.  If not, write to:
+ *  	The Free Software Foundation, Inc.,
+ *  	51 Franklin Street, Fifth Floor
+ *  	Boston, MA  02110-1301, USA.
  */
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -4050,6 +4051,43 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Mingw_Inline_Fp_Math fix
+ */
+tSCC zMingw_Inline_Fp_MathName[] =
+     "mingw_inline_fp_math";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zMingw_Inline_Fp_MathList[] =
+  "|complex.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzMingw_Inline_Fp_MathMachs[] = {
+        "i[34567]86-*-mingw*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zMingw_Inline_Fp_MathSelect0[] =
+       "[ \\t]*__asm__[ \\t]*\\(\\\"fpatan";
+
+#define    MINGW_INLINE_FP_MATH_TEST_CT  1
+static tTestDesc aMingw_Inline_Fp_MathTests[] = {
+  { TT_EGREP,    zMingw_Inline_Fp_MathSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Mingw_Inline_Fp_Math
+ */
+static const char* apzMingw_Inline_Fp_MathPatch[] = { "sed",
+    "-e", "/^\\#ifdef[ \\t]*__GNUC__$/,/^\\#endif[ \\t]*\\/*[ \\t]*__GNUC__[ \\t]*$/ { :ack N; /\\n[ \\t]*:/! b ack; s/\\(\\n[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atan((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*float[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atanf((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*long[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atanl((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\\"st[(]1[)]\\\"[)];[ \\t]*\\)$/\\1\\n#endif/g }",
+    "-e", "s/\\(\\#include[ \\t]*<_mingw.h>\\)/\\1\\n\\#include <math.h>/",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Nested_Auth_Des fix
  */
 tSCC zNested_Auth_DesName[] =
@@ -7932,9 +7970,9 @@
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          234
+#define REGEX_COUNT          235
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            195
+#define FIX_COUNT            196
 
 /*
  *  Enumerate the fixes
@@ -8037,6 +8075,7 @@
     MACHINE_NAME_FIXIDX,
     MATH_EXCEPTION_FIXIDX,
     MATH_HUGE_VAL_FROM_DBL_MAX_FIXIDX,
+    MINGW_INLINE_FP_MATH_FIXIDX,
     NESTED_AUTH_DES_FIXIDX,
     NESTED_MOTOROLA_FIXIDX,
     NESTED_SYS_LIMITS_FIXIDX,
@@ -8623,6 +8662,11 @@
      MATH_HUGE_VAL_FROM_DBL_MAX_TEST_CT, FD_MACH_ONLY | FD_SHELL_SCRIPT,
      aMath_Huge_Val_From_Dbl_MaxTests,   apzMath_Huge_Val_From_Dbl_MaxPatch, 0 },
 
+  {  zMingw_Inline_Fp_MathName,    zMingw_Inline_Fp_MathList,
+     apzMingw_Inline_Fp_MathMachs,
+     MINGW_INLINE_FP_MATH_TEST_CT, FD_MACH_ONLY,
+     aMingw_Inline_Fp_MathTests,   apzMingw_Inline_Fp_MathPatch, 0 },
+
   {  zNested_Auth_DesName,    zNested_Auth_DesList,
      apzNested_Auth_DesMachs,
      NESTED_AUTH_DES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,

Modified: apple-local/branches/llvm/fixincludes/inclhack.def
===================================================================
--- apple-local/branches/llvm/fixincludes/inclhack.def	2007-05-10 04:40:54 UTC (rev 127088)
+++ apple-local/branches/llvm/fixincludes/inclhack.def	2007-05-10 06:21:25 UTC (rev 127089)
@@ -2299,6 +2299,22 @@
 };
 
 
+/* APPLE LOCAL begin LLVM */
+/* We need to fix complex.h not to include inline FP assembly.
+ * This is needed to workaround PR879
+ */
+fix = {
+    hackname  = mingw_inline_fp_math;
+    files     = complex.h;
+    mach      = 'i[34567]86-*-mingw*';
+    select    = '[ \t]*__asm__[ \t]*\(\"fpatan';
+    sed       = "/^\\#ifdef[ \\t]*__GNUC__$/,/^\\#endif[ \\t]*\\/*[ \\t]*__GNUC__[ \\t]*$/ { :ack N; /\\n[ \\t]*:/! b ack; s/\\(\\n[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atan((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*float[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atanf((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*long[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\n    res = atanl((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\\"st[(]1[)]\\\"[)];[ \\t]*\\)$/\\1\\n#endif/g }";
+    sed       = "s/\\(\\#include[ \\t]*<_mingw.h>\\)/\\1\\n\\#include <math.h>\/";
+    test_text = '  __asm__  ("fpatan;"'
+                '	   : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");';
+};
+/* APPLE local end LLVM */
+ 
 /*
  *  nested comment
  */

Modified: apple-local/branches/llvm/fixincludes/mkfixinc.sh
===================================================================
--- apple-local/branches/llvm/fixincludes/mkfixinc.sh	2007-05-10 04:40:54 UTC (rev 127088)
+++ apple-local/branches/llvm/fixincludes/mkfixinc.sh	2007-05-10 06:21:25 UTC (rev 127089)
@@ -20,7 +20,6 @@
     i?86-*-moss* | \
     i?86-*-pe | \
     i?86-*-cygwin* | \
-    i?86-*-mingw32* | \
     i?86-*-uwin* | \
     i?86-*-interix* | \
     powerpc-*-eabiaix* | \





More information about the llvm-commits mailing list