[llvm-commits] [vmkit] r48818 - in /vmkit/trunk: include/mvm/Threads/Cond.h lib/Mvm/Allocator/osdep.h lib/Mvm/EscapeAnalysis.cpp lib/Mvm/Sigsegv.cc

Nicolas Geoffray nicolas.geoffray at lip6.fr
Wed Mar 26 03:21:07 PDT 2008


Author: geoffray
Date: Wed Mar 26 05:21:06 2008
New Revision: 48818

URL: http://llvm.org/viewvc/llvm-project?rev=48818&view=rev
Log:
Make Mvm compile on MacOSX. Patch from Owen!



Modified:
    vmkit/trunk/include/mvm/Threads/Cond.h
    vmkit/trunk/lib/Mvm/Allocator/osdep.h
    vmkit/trunk/lib/Mvm/EscapeAnalysis.cpp
    vmkit/trunk/lib/Mvm/Sigsegv.cc

Modified: vmkit/trunk/include/mvm/Threads/Cond.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Cond.h?rev=48818&r1=48817&r2=48818&view=diff

==============================================================================
--- vmkit/trunk/include/mvm/Threads/Cond.h (original)
+++ vmkit/trunk/include/mvm/Threads/Cond.h Wed Mar 26 05:21:06 2008
@@ -17,6 +17,8 @@
 #include "mvm/GC/GC.h"
 #include "mvm/Threads/Locks.h"
 
+#include <cstdlib>
+
 namespace mvm {
 
 class Cond {
@@ -27,7 +29,7 @@
   static Cond *allocCond(void);
   void broadcast(void);
   void wait(Lock *l);
-  int timed_wait(Lock *l, struct timeval *tv);
+  int timed_wait(Lock *l, timeval *tv);
   void signal(void);
 };
 

Modified: vmkit/trunk/lib/Mvm/Allocator/osdep.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Allocator/osdep.h?rev=48818&r1=48817&r2=48818&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Allocator/osdep.h (original)
+++ vmkit/trunk/lib/Mvm/Allocator/osdep.h Wed Mar 26 05:21:06 2008
@@ -17,24 +17,8 @@
 #define PAGE_SHIFT		12
 #define PAGE_SIZE			(1 << PAGE_SHIFT)
 
-/* stdio.h */
-#include <stdio.h>
-
-__BEGIN_DECLS
-
-/* stdio.h */
-extern int   printf(const char *, ...);
-extern int   fprintf(FILE *, const char *, ...);
-extern int   vfprintf(FILE *, const char *, va_list);
-
-
-/* stdlib.h */
-extern void exit(int) throw ();
-
-/* string.h */
-extern void *memcpy(void *, const void *, size_t) throw ();
-//extern void  bzero(void *, size_t);
-
-__END_DECLS
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #endif

Modified: vmkit/trunk/lib/Mvm/EscapeAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/EscapeAnalysis.cpp?rev=48818&r1=48817&r2=48818&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/EscapeAnalysis.cpp (original)
+++ vmkit/trunk/lib/Mvm/EscapeAnalysis.cpp Wed Mar 26 05:21:06 2008
@@ -14,6 +14,8 @@
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 
+#include <map>
+
 using namespace llvm;
 
 namespace {

Modified: vmkit/trunk/lib/Mvm/Sigsegv.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Sigsegv.cc?rev=48818&r1=48817&r2=48818&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Sigsegv.cc (original)
+++ vmkit/trunk/lib/Mvm/Sigsegv.cc Wed Mar 26 05:21:06 2008
@@ -38,17 +38,15 @@
 	void *caller_ip = caller->ip; 
 
 # if defined(__MACH__)
-  //.gregs[REG_EIP]; /* comme si c'était lui qui était sur la pile... */
-	caller->ip = (void *)((ucontext_t*)context)->uc_mcontext->ss.eip;
+  //.gregs[REG_EIP]; /* just like it's on the stack.. */
+	caller->ip = (void *)((ucontext_t*)context)->uc_mcontext->__ss.__eip;
 # else
   /* comme si c'était lui qui était sur la pile... */
 	caller->ip = (void *)((ucontext_t*)context)->uc_mcontext.gregs[REG_EIP]; 
 # endif
 #endif
 	
-	/* Il faut libérer le gc si il s'est planté tout seul pendant une collection.
-	   Ca le laisse dans un état TRES instable, c'est à dire que plus aucune
-     collection n'est possible */
+	/* Free the GC if it sisgegv'd. No other collection is possible */
 	gc::die_if_sigsegv_occured_during_collection(addr);
 	
 	//	sys_exit(0);
@@ -58,7 +56,7 @@
 		signal(SIGSEGV, SIG_DFL);
 	
 #if defined(__i386__)
-	caller->ip = caller_ip; /* restaure the caller ip */
+	caller->ip = caller_ip; /* restore the caller ip */
 #endif
 }
 





More information about the llvm-commits mailing list