[llvm-commits] [vmkit] r48875 - in /vmkit/trunk/lib/Mvm: Allocator/Makefile.am Allocator/gcchunk.cc Allocator/gcerror.h Allocator/gcmapper.cc CommonThread/Makefile.am CommonThread/cterror.h CommonThread/ctlock.cc GCMmap2/Makefile.am GCMmap2/ctosdep.h Makefile.am

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Mar 27 04:18:49 PDT 2008


Author: geoffray
Date: Thu Mar 27 06:18:48 2008
New Revision: 48875

URL: http://llvm.org/viewvc/llvm-project?rev=48875&view=rev
Log:
Build cleanup and add pedantic, ansi and warning compilation flags



Modified:
    vmkit/trunk/lib/Mvm/Allocator/Makefile.am
    vmkit/trunk/lib/Mvm/Allocator/gcchunk.cc
    vmkit/trunk/lib/Mvm/Allocator/gcerror.h
    vmkit/trunk/lib/Mvm/Allocator/gcmapper.cc
    vmkit/trunk/lib/Mvm/CommonThread/Makefile.am
    vmkit/trunk/lib/Mvm/CommonThread/cterror.h
    vmkit/trunk/lib/Mvm/CommonThread/ctlock.cc
    vmkit/trunk/lib/Mvm/GCMmap2/Makefile.am
    vmkit/trunk/lib/Mvm/GCMmap2/ctosdep.h
    vmkit/trunk/lib/Mvm/Makefile.am

Modified: vmkit/trunk/lib/Mvm/Allocator/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Allocator/Makefile.am?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Allocator/Makefile.am (original)
+++ vmkit/trunk/lib/Mvm/Allocator/Makefile.am Thu Mar 27 06:18:48 2008
@@ -2,7 +2,7 @@
 noinst_PROGRAMS = mainuvm_alloc
 
 libuvm_alloc_a_SOURCES = gcalloc.cc gcalloc.h gcchunk.cc gcchunk.h gcerror.cc gcerror.h gcmapper.cc gcmapper.h osdep.h
-libuvm_alloc_a_CXXFLAGS = -O2
+libuvm_alloc_a_CXXFLAGS = -O2 -W -Wall -Werror -ansi -pedantic -Wno-variadic-macros
 
 mainuvm_alloc_SOURCES = main.cc
 mainuvm_alloc_CXXFLAGS =

Modified: vmkit/trunk/lib/Mvm/Allocator/gcchunk.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Allocator/gcchunk.cc?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Allocator/gcchunk.cc (original)
+++ vmkit/trunk/lib/Mvm/Allocator/gcchunk.cc Thu Mar 27 06:18:48 2008
@@ -91,7 +91,7 @@
 void GCHash::destroy() {
 	if(inited) {
 		if(nb_link)
-			gcwarning("Can't destroy GC hash map: you have clients connected on it\n");
+			gcwarning2("Can't destroy GC hash map: you have clients connected on it\n");
 		else {
 			inited = 0;
 			unsigned int i;

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

==============================================================================
--- vmkit/trunk/lib/Mvm/Allocator/gcerror.h (original)
+++ vmkit/trunk/lib/Mvm/Allocator/gcerror.h Thu Mar 27 06:18:48 2008
@@ -27,6 +27,12 @@
                                   printf(msg, ##args); \
                                 } while(0)
 
+#define gcwarning2(msg)         do { \
+                                  printf("In %s (%s line %d):\n\t", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
+                                  printf(msg); \
+                                } while(0)
+
+
 #endif
 
 

Modified: vmkit/trunk/lib/Mvm/Allocator/gcmapper.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Allocator/gcmapper.cc?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Allocator/gcmapper.cc (original)
+++ vmkit/trunk/lib/Mvm/Allocator/gcmapper.cc Thu Mar 27 06:18:48 2008
@@ -127,7 +127,7 @@
 
  	for(nb_area=0, cur=base_area.next(); cur!=&base_area; cur=cur->next(), nb_area++);
 
- 	GCMappedArea	areas[nb_area];
+ 	GCMappedArea* areas = (GCMappedArea*)alloca(sizeof(GCMappedArea) * nb_area);
 
  	for(i=0, cur=base_area.next(); cur!=&base_area; cur=cur->next(), i++)
  		areas[i] = *cur;

Modified: vmkit/trunk/lib/Mvm/CommonThread/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/Makefile.am?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/CommonThread/Makefile.am (original)
+++ vmkit/trunk/lib/Mvm/CommonThread/Makefile.am Thu Mar 27 06:18:48 2008
@@ -6,6 +6,6 @@
 ALLOCLIBS = $(ALLOCDIR)/libuvm_alloc.a
 
 libuvm_common_thread_a_SOURCES = cterror.h ctthread.cc cterror.cc ctlock.cc
-libuvm_common_thread_a_CXXFLAGS = -frepo -O2
+libuvm_common_thread_a_CXXFLAGS = -frepo -O2 -W -Wall -Werror -ansi -pedantic -Wno-unused-parameter
 
 CLEANFILES = *~ *.bak .*.sw?

Modified: vmkit/trunk/lib/Mvm/CommonThread/cterror.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/cterror.h?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/CommonThread/cterror.h (original)
+++ vmkit/trunk/lib/Mvm/CommonThread/cterror.h Thu Mar 27 06:18:48 2008
@@ -15,7 +15,7 @@
 extern void (*pgcdomsgf)(const char *, unsigned int l, const char *, const char *, ...);
 extern void (**gcdomsgf)(const char *, unsigned int l, const char *, const char *, ...);
 
-#define ctfatal(msg, args...) (*gcdomsgf)(__FILE__, __LINE__, __PRETTY_FUNCTION__, msg, ##args)
+#define ctfatal(msg) (*gcdomsgf)(__FILE__, __LINE__, __PRETTY_FUNCTION__, msg)
 
 #endif
 

Modified: vmkit/trunk/lib/Mvm/CommonThread/ctlock.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctlock.cc?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/CommonThread/ctlock.cc (original)
+++ vmkit/trunk/lib/Mvm/CommonThread/ctlock.cc Thu Mar 27 06:18:48 2008
@@ -52,7 +52,7 @@
 # endif
 
   return result;
-#else
+#elif defined(__i386__)
 	// asm ("bts $1, %1; sbbl %0, %0":"=r" (result):"m" (*ptr):"memory");
 	unsigned int old;
 	int c=0;
@@ -64,6 +64,8 @@
 		if(!(++c & 0xf))
 			Thread::yield();
 	} while(1);
+#else
+#error "I do not know  how to do an atomic test and pass on your machine"
 #endif
 }
 

Modified: vmkit/trunk/lib/Mvm/GCMmap2/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/Makefile.am?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/Makefile.am (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/Makefile.am Thu Mar 27 06:18:48 2008
@@ -12,7 +12,7 @@
 if HAVE_PTHREAD
 libuvm_gc_mmap2_a_SOURCES += gcthread.cc
 endif
-libuvm_gc_mmap2_a_CXXFLAGS =$(INCLUDEDIRS) -O2
+libuvm_gc_mmap2_a_CXXFLAGS =$(INCLUDEDIRS) -O2 -W -Wall -ansi -pedantic -Wno-unused-parameter -Wno-variadic-macros
 
 mainuvm_gc_mmap2_SOURCES = main.cc
 mainuvm_gc_mmap2_CXXFLAGS = -O2

Modified: vmkit/trunk/lib/Mvm/GCMmap2/ctosdep.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/ctosdep.h?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/ctosdep.h (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/ctosdep.h Thu Mar 27 06:18:48 2008
@@ -11,14 +11,8 @@
 #define _CT_OSDEP_H_
 
 #include <sys/types.h>
-
-__BEGIN_DECLS
-
-extern void *				malloc(size_t);
-extern void					free(void *);
-extern int 					printf(const char *, ...);
-
-__END_DECLS
+#include <cstdio>
+#include <cstdlib>
 
 #define tmalloc					malloc
 #define tfree						free

Modified: vmkit/trunk/lib/Mvm/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Makefile.am?rev=48875&r1=48874&r2=48875&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Makefile.am (original)
+++ vmkit/trunk/lib/Mvm/Makefile.am Thu Mar 27 06:18:48 2008
@@ -2,7 +2,6 @@
 DIST_SUBDIRS = CommonThread Allocator GCMmap2
 
 bin_PROGRAMS = main
-uvmdatadir=$(pkgdatadir)/lib
 
 THREADDIR=CommonThread
 ALLOCDIR=Allocator
@@ -12,7 +11,6 @@
 LIBTHREAD=$(THREADDIR)/libuvm_ at vvmthreadtype@_thread.a
 LIBALLOC=$(ALLOCDIR)/libuvm_alloc.a
 LIBGC=$(GCDIR)/libuvm_gc_ at vvmgctype@.a @GC_LIBS@
-MAIN_O=main-main.o
 LIBSUVM=$(LIBGC) $(LIBALLOC) $(LIBTHREAD)
 PREFIX=@prefix@
 





More information about the llvm-commits mailing list