diff dmd/aggregate.h @ 1602:a413ae7329bf

Merge DMD r243: some harmonization with D2 dmd --- dmd/aggregate.h | 24 ++++- dmd/attrib.c | 63 ++++++---- dmd/attrib.h | 10 +- dmd/declaration.h | 5 +- dmd/func.c | 337 ++++++++++++++++++++++------------------------------- dmd/mars.c | 2 +- dmd/mars.h | 7 + dmd/mtype.h | 13 ++- dmd/parse.c | 32 ++++- dmd/parse.h | 14 ++- dmd/scope.h | 2 +- 11 files changed, 263 insertions(+), 246 deletions(-)
author Leandro Lucarella <llucax@gmail.com>
date Wed, 06 Jan 2010 15:18:19 -0300
parents def7a1d494fd
children ae8a94d87ca9
line wrap: on
line diff
--- a/dmd/aggregate.h	Mon Dec 28 02:23:54 2009 +0000
+++ b/dmd/aggregate.h	Wed Jan 06 15:18:19 2010 -0300
@@ -16,6 +16,7 @@
 #endif /* __DMC__ */
 
 #include "root.h"
+
 #include "dsymbol.h"
 
 #include <vector>
@@ -49,7 +50,7 @@
 struct AggregateDeclaration : ScopeDsymbol
 {
     Type *type;
-    unsigned storage_class;
+    StorageClass storage_class;
     enum PROT protection;
     Type *handle;		// 'this' type
     unsigned structsize;	// size of struct
@@ -63,6 +64,10 @@
 				// 2: cannot determine size; fwd referenced
     int isdeprecated;		// !=0 if deprecated
 
+#if DMDV2
+    int isnested;		// !=0 if is nested
+    VarDeclaration *vthis;	// 'this' parameter if this aggregate is nested
+#endif
     // Special member functions
     InvariantDeclaration *inv;		// invariant
     NewDeclaration *aggNew;		// allocator
@@ -92,6 +97,7 @@
     void addField(Scope *sc, VarDeclaration *v);
     int isDeprecated();		// is aggregate deprecated?
     FuncDeclaration *buildDtor(Scope *sc);
+    int isNested();
 
     void emitComment(Scope *sc);
     void toJsonBuffer(OutBuffer *buf);
@@ -147,7 +153,15 @@
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
     char *mangle();
     const char *kind();
+#if DMDV1
     Expression *cloneMembers();
+#endif
+#if DMDV2
+    int needOpAssign();
+    FuncDeclaration *buildOpAssign(Scope *sc);
+    FuncDeclaration *buildPostBlit(Scope *sc);
+    FuncDeclaration *buildCpCtor(Scope *sc);
+#endif
     void toDocBuffer(OutBuffer *buf);
 
     PROT getAccess(Dsymbol *smember);	// determine access to smember
@@ -209,8 +223,10 @@
     static ClassDeclaration *classinfo;
 
     ClassDeclaration *baseClass;	// NULL only if this is Object
+#if DMDV1
     CtorDeclaration *ctor;
     CtorDeclaration *defaultCtor;	// default constructor
+#endif
     FuncDeclaration *staticCtor;
     FuncDeclaration *staticDtor;
     Array vtbl;				// Array of FuncDeclaration's making up the vtbl[]
@@ -231,10 +247,10 @@
 					// it derives from IUnknown)
     int isscope;			// !=0 if this is a scope class
     int isabstract;			// !=0 if abstract class
-
+#if DMDV1
     int isnested;			// !=0 if is nested
     VarDeclaration *vthis;		// 'this' parameter if this class is nested
-
+#endif
     int inuse;				// to prevent recursive attempts
 
     ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
@@ -252,7 +268,9 @@
 #endif
     FuncDeclaration *findFunc(Identifier *ident, TypeFunction *tf);
     void interfaceSemantic(Scope *sc);
+#if DMDV1
     int isNested();
+#endif
     int isCOMclass();
     virtual int isCOMinterface();
 #if DMDV2