view dmdpatch.patch @ 178:e3afd1303184

Many small bugs fixed Made all classes derive from TObject to detect memory leaks (functionality is disabled for now) Began work on overriding backend memory allocations (to avoid memory leaks)
author korDen
date Sun, 17 Oct 2010 07:42:00 +0400
parents 31c086f76669
children 190ba98276b3
line wrap: on
line source

# HG changeset patch
# User trass3r
# Date 1284418540 -7200
# Node ID a4ec24e030fdda493d8d1249ef966e0beed13e1e
# Parent  0ebf1721e4d32cfb38376c6688a767627aa63758
t

diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/class.c
--- a/src/dmd/class.c	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/class.c	Tue Sep 14 00:55:40 2010 +0200
@@ -61,7 +61,7 @@
     if (id)
     {	// Look for special class names
 
-	if (id == Id::__sizeof || id == Id::alignof || id == Id::mangleof)
+	if (id == Id::__sizeof || id == Id::__alignof || id == Id::mangleof)
 	    error("illegal class name");
 
 	// BUG: What if this is the wrong TypeInfo, i.e. it is nested?
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/dsymbol.c
--- a/src/dmd/dsymbol.c	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/dsymbol.c	Tue Sep 14 00:55:40 2010 +0200
@@ -488,7 +488,7 @@
 	}
 	if (sd->isAggregateDeclaration() || sd->isEnumDeclaration())
 	{
-	    if (ident == Id::__sizeof || ident == Id::alignof || ident == Id::mangleof)
+	    if (ident == Id::__sizeof || ident == Id::__alignof || ident == Id::mangleof)
 		error(".%s property cannot be redefined", ident->toChars());
 	}
 	return 1;
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/expression.c
--- a/src/dmd/expression.c	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/expression.c	Tue Sep 14 00:55:40 2010 +0200
@@ -5953,7 +5953,7 @@
     }
     else if (t1b->ty == Tpointer &&
 	     ident != Id::init && ident != Id::__sizeof &&
-	     ident != Id::alignof && ident != Id::offsetof &&
+	     ident != Id::__alignof && ident != Id::offsetof &&
 	     ident != Id::mangleof && ident != Id::stringof)
     {	/* Rewrite:
          *   p.ident
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/idgen.c
--- a/src/dmd/idgen.c	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/idgen.c	Tue Sep 14 00:55:40 2010 +0200
@@ -44,7 +44,7 @@
     { "init" },
     { "size" },
     { "__sizeof", "sizeof" },
-    { "alignof" },
+    { "__alignof", "alignof" },
     { "mangleof" },
     { "stringof" },
     { "tupleof" },
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/mtype.c
--- a/src/dmd/mtype.c	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/mtype.c	Tue Sep 14 00:55:40 2010 +0200
@@ -1610,7 +1610,7 @@
 	error(loc, ".size property should be replaced with .sizeof");
 	e = new ErrorExp();
     }
-    else if (ident == Id::alignof)
+    else if (ident == Id::__alignof)
     {
 	e = new IntegerExp(loc, alignsize(), Type::tsize_t);
     }
@@ -1749,7 +1749,7 @@
     assert(sym);
 
     if (ident != Id::__sizeof &&
-	ident != Id::alignof &&
+	ident != Id::__alignof &&
 	ident != Id::init &&
 	ident != Id::mangleof &&
 	ident != Id::stringof &&
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/win32.mak
--- a/src/dmd/win32.mak	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/dmd/win32.mak	Tue Sep 14 00:55:40 2010 +0200
@@ -8,7 +8,8 @@
 DMDSVN=\svnproj\dmd\trunk\src
 SCROOT=$D\dm
 INCLUDE=$(SCROOT)\include
-CC=\dm\bin\dmc
+CC=$(SCROOT)\bin\dmc
+LIB=$(SCROOT)\bin\lib
 LIBNT=$(SCROOT)\lib
 SNN=$(SCROOT)\lib\snn
 DIR=\dmd2
@@ -24,7 +25,7 @@
 XFLG=
 MODEL=n
 OPT=
-DEBUG=-gl -D
+DEBUG=-g -D
 #PREC=-H -HItotal.h -HO
 PREC=
 LFLAGS=
@@ -59,11 +60,17 @@
 	$(MAKE) OPT=-o "DEBUG=" LFLAGS=-L/delexe dmd.exe
 #	$(MAKE) OPT=-o "DEBUG=" LFLAGS=-L/ma/co/delexe dmd.exe
 
+lib:
+	$(MAKE) OPT=-o "DEBUG=" dmd.lib
+
 ################ NT COMMAND LINE DEBUG #########################
 
 debdmd:
 	$(MAKE) OPT= "DEBUG=-D -g" LFLAGS=-L/ma/co dmd.exe
 
+deblib:
+	$(MAKE) OPT= "DEBUG=-D -g" dmd.lib
+
 #########################################
 
 # D front end
@@ -155,8 +162,11 @@
 #########################################
 
 $(TARGET).exe : $(OBJS) win32.mak
-	dmc -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS)
+	$(CC) -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS)
 
+$(TARGET).lib : $(OBJS) win32.mak
+	$(LIB) -c -p128 $(TARGET).lib $(OBJ8) $(ROOTOBJS) msc.obj tk.obj util.obj entity.obj ph.obj eh.obj
+	$(LIB) -d $(TARGET).lib iasm.obj
 
 ##################### INCLUDE MACROS #####################
 
@@ -171,11 +181,11 @@
 	msgsx
 
 msgsx.exe : msgsx.c
-	dmc msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS)
+	$(CC) msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS)
 
 elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c : \
 	$C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c
-	dmc -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS) #-L$(LINKS)
+	$(CC) -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS) #-L$(LINKS)
 	optabgen
 
 impcnvtab.c : impcnvgen.c
@@ -183,7 +193,7 @@
 	impcnvgen
 
 id.h id.c : idgen.c
-	dmc -cpp idgen
+	$(CC) -cpp idgen
 	idgen
 
 ##################### SPECIAL BUILDS #####################
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/druntime/win32.mak
--- a/src/druntime/win32.mak	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/druntime/win32.mak	Tue Sep 14 00:55:40 2010 +0200
@@ -1,5 +1,5 @@
 
-DMD=dmd
+DMD=..\..\windows\bin\dmd
 
 CC=dmc
 
@@ -300,7 +300,7 @@
 # NOTE: a pre-compiled minit.obj has been provided in dmd for Win32 and
 #       minit.asm is not used by dmd for Linux
 
-OBJS= errno_c.obj complex.obj critical.obj deh.obj monitor.obj src\rt\minit.obj
+OBJS= errno_c.obj complex.obj critical.obj deh.obj monitor.obj minit.obj
 OBJS_TO_DELETE= errno_c.obj complex.obj critical.obj deh.obj monitor.obj
 
 DOCS=\
diff -r 0ebf1721e4d3 -r a4ec24e030fd src/phobos/win32.mak
--- a/src/phobos/win32.mak	Mon Sep 13 15:46:31 2010 +0200
+++ b/src/phobos/win32.mak	Tue Sep 14 00:55:40 2010 +0200
@@ -51,7 +51,7 @@
 
 DMD=$(DIR)\bin\dmd
 #DMD=..\dmd
-DMD=dmd
+DMD=..\..\windows\bin\dmd
 
 ## Location of where to write the html documentation files