[llvm-commits] CVS: llvm/lib/System/Win32/DynamicLibrary.inc

Anton Korobeynikov asl at math.spbu.ru
Mon Jun 25 00:12:37 PDT 2007



Changes in directory llvm/lib/System/Win32:

DynamicLibrary.inc updated: 1.18 -> 1.19
---
Log message:

Provide hook for alloca on VCPP. Patch by Scott Graham


---
Diffs of the changes:  (+18 -4)

 DynamicLibrary.inc |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)


Index: llvm/lib/System/Win32/DynamicLibrary.inc
diff -u llvm/lib/System/Win32/DynamicLibrary.inc:1.18 llvm/lib/System/Win32/DynamicLibrary.inc:1.19
--- llvm/lib/System/Win32/DynamicLibrary.inc:1.18	Tue Dec 19 09:24:18 2006
+++ llvm/lib/System/Win32/DynamicLibrary.inc	Mon Jun 25 02:12:14 2007
@@ -88,15 +88,21 @@
   }
 }
 
-#ifdef __MINGW32__
+// Stack probing routines are in the support library (e.g. libgcc), but we don't
+// have dynamic linking on windows. Provide a hook.
+#if defined(__MINGW32__) || defined (_MSC_VER)
   #define EXPLICIT_SYMBOL(SYM)                    \
     if (!strcmp(symbolName, #SYM)) return (void*)&SYM
   #define EXPLICIT_SYMBOL2(SYMFROM, SYMTO)        \
     if (!strcmp(symbolName, #SYMFROM)) return (void*)&SYMTO
   #define EXPLICIT_SYMBOL_DEF(SYM)                \
     extern "C" { extern void *SYM; }
-  
-  EXPLICIT_SYMBOL_DEF(_alloca);
+
+  #if defined(__MINGW32__)
+    EXPLICIT_SYMBOL_DEF(_alloca);
+  #elif defined(_MSC_VER)
+    EXPLICIT_SYMBOL_DEF(_alloca_probe);
+  #endif
 #endif
  
 bool DynamicLibrary::LoadLibraryPermanently(const char *filename,
@@ -133,7 +139,7 @@
       return (void *) ptr;
   }
 
-#ifdef __MINGW32__  
+#if defined(__MINGW32__)
   {
     EXPLICIT_SYMBOL(_alloca);
     EXPLICIT_SYMBOL2(alloca, _alloca);
@@ -141,6 +147,14 @@
 #undef EXPLICIT_SYMBOL2
 #undef EXPLICIT_SYMBOL_DEF    
   }
+#elif defined(_MSC_VER)
+  {
+    EXPLICIT_SYMBOL2(alloca, _alloca_probe);
+    EXPLICIT_SYMBOL2(_alloca, _alloca_probe);
+#undef EXPLICIT_SYMBOL
+#undef EXPLICIT_SYMBOL2
+#undef EXPLICIT_SYMBOL_DEF    
+  }  
 #endif
 
   return 0;






More information about the llvm-commits mailing list