Permalink
Browse files

Merged dmd 2.059beta

  • Loading branch information...
2 parents 50bbeb7 + f223766 commit bca73ec8b9756ece771790fa8422cc730f732647 @AlexeyProkhin AlexeyProkhin committed Apr 5, 2012
Showing with 6,896 additions and 2,230 deletions.
  1. +16 −8 dmd2/aggregate.h
  2. +23 −0 dmd2/aliasthis.c
  3. +144 −164 dmd2/attrib.c
  4. +6 −3 dmd2/attrib.h
  5. +10 −9 dmd2/builtin.c
  6. +231 −48 dmd2/cast.c
  7. +57 −34 dmd2/class.c
  8. +14 −0 dmd2/clone.c
  9. +14 −12 dmd2/complex_t.h
  10. +9 −9 dmd2/constfold.c
  11. +1 −1 dmd2/cppmangle.c
  12. +117 −16 dmd2/declaration.c
  13. +19 −1 dmd2/declaration.h
  14. +4 −1 dmd2/delegatize.c
  15. +2,088 −0 dmd2/dmd_msc.vcproj
  16. +3 −0 dmd2/doc.c
  17. +61 −9 dmd2/dsymbol.c
  18. +8 −1 dmd2/dsymbol.h
  19. +1 −1 dmd2/dump.c
  20. +20 −1 dmd2/enum.c
  21. +3 −0 dmd2/enum.h
  22. +713 −918 dmd2/expression.c
  23. +29 −13 dmd2/expression.h
  24. +104 −40 dmd2/func.c
  25. +4 −5 dmd2/html.c
  26. +1 −0 dmd2/html.h
  27. +1 −1 dmd2/identifier.c
  28. +1 −1 dmd2/idgen.c
  29. +50 −23 dmd2/import.c
  30. +63 −66 dmd2/init.c
  31. +16 −0 dmd2/inline.c
  32. +299 −90 dmd2/interpret.c
  33. +63 −19 dmd2/lexer.c
  34. +5 −1 dmd2/lexer.h
  35. +14 −0 dmd2/lib.h
  36. +2 −2 dmd2/mangle.c
  37. +47 −33 dmd2/mars.c
  38. +12 −3 dmd2/mars.h
  39. +21 −14 dmd2/module.c
  40. +1 −1 dmd2/module.h
  41. +319 −126 dmd2/mtype.c
  42. +18 −8 dmd2/mtype.h
  43. +31 −45 dmd2/opover.c
  44. +6 −6 dmd2/optimize.c
  45. +24 −10 dmd2/parse.c
  46. +2 −2 dmd2/root/dchar.h
  47. +636 −0 dmd2/root/longdouble.c
  48. +254 −0 dmd2/root/longdouble.h
  49. +2 −0 dmd2/root/lstring.h
  50. +19 −160 dmd2/root/port.c
  51. +7 −5 dmd2/root/port.h
  52. +7 −0 dmd2/root/response.c
  53. +3 −3 dmd2/root/root.c
  54. +2 −4 dmd2/root/root.h
  55. +1 −1 dmd2/root/speller.c
  56. +2 −2 dmd2/scope.c
  57. +9 −2 dmd2/scope.h
  58. +168 −25 dmd2/statement.c
  59. +2 −0 dmd2/statement.h
  60. +104 −89 dmd2/struct.c
  61. +319 −181 dmd2/template.c
  62. +9 −6 dmd2/template.h
  63. +8 −2 dmd2/traits.c
  64. +1 −0 dmd2/vcbuild/alloca.h
  65. +13 −0 dmd2/vcbuild/builddmd.bat
  66. +44 −0 dmd2/vcbuild/dmc_cl.bat
  67. +5 −0 dmd2/vcbuild/fenv.h
  68. +336 −0 dmd2/vcbuild/ldfpu.asm
  69. +206 −0 dmd2/vcbuild/stdint.h
  70. +30 −0 dmd2/vcbuild/warnings.h
  71. +1 −0 gen/cl_helpers.cpp
  72. +1 −1 gen/optimizer.cpp
  73. +1 −1 gen/pragma.cpp
  74. +1 −1 gen/tocall.cpp
  75. +8 −0 ir/irtypeclass.cpp
  76. +1 −1 runtime/druntime
  77. +1 −1 runtime/phobos
View
@@ -1,6 +1,6 @@
// Compiler implementation of the D programming language
-// Copyright (c) 1999-2011 by Digital Mars
+// Copyright (c) 1999-2012 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@@ -40,6 +40,13 @@ struct TypeInfoClassDeclaration;
struct VarDeclaration;
struct dt_t;
+enum Sizeok
+{
+ SIZEOKnone, // size of aggregate is not computed yet
+ SIZEOKdone, // size of aggregate is set correctly
+ SIZEOKfwd, // error in computing size of aggregate
+};
+
#if IN_LLVM
struct ClassInfoDeclaration;
namespace llvm
@@ -63,10 +70,7 @@ struct AggregateDeclaration : ScopeDsymbol
unsigned structalign; // struct member alignment in effect
int hasUnions; // set if aggregate has overlapping fields
VarDeclarations fields; // VarDeclaration fields
- unsigned sizeok; // set when structsize contains valid data
- // 0: no size
- // 1: size is correct
- // 2: cannot determine size; fwd referenced
+ enum Sizeok sizeok; // set when structsize contains valid data
Dsymbol *deferred; // any deferred semantic2() or semantic3() symbol
bool isdeprecated; // !=0 if deprecated
@@ -91,7 +95,8 @@ struct AggregateDeclaration : ScopeDsymbol
FuncDeclaration *dtor; // aggregate destructor
#ifdef IN_GCC
- Array methods; // flat list of all methods for debug information
+ Expressions *attributes; // GCC decl/type attributes
+ FuncDeclarations methods; // flat list of all methods for debug information
#endif
AggregateDeclaration(Loc loc, Identifier *id);
@@ -100,8 +105,10 @@ struct AggregateDeclaration : ScopeDsymbol
void inlineScan();
unsigned size(Loc loc);
static void alignmember(unsigned salign, unsigned size, unsigned *poffset);
+ static unsigned placeField(unsigned *nextoffset,
+ unsigned memsize, unsigned memalignsize, unsigned memalign,
+ unsigned *paggsize, unsigned *paggalignsize, bool isunion);
Type *getType();
- void addField(Scope *sc, VarDeclaration *v);
int firstFieldInUnion(int indx); // first field in union that includes indx
int numFieldsInUnion(int firstIndex); // #fields in union starting at index
int isDeprecated(); // is aggregate deprecated?
@@ -167,7 +174,7 @@ struct StructDeclaration : AggregateDeclaration
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
char *mangle();
const char *kind();
- void finalizeSize();
+ void finalizeSize(Scope *sc);
#if DMDV1
Expression *cloneMembers();
#endif
@@ -235,6 +242,7 @@ struct BaseClass
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
#else
#define CLASSINFO_SIZE (0x3C+12+4) // value of ClassInfo.size
+#define CLASSINFO_SIZE_64 (0x98) // value of ClassInfo.size
#endif
struct ClassDeclaration : AggregateDeclaration
View
@@ -17,9 +17,32 @@
#include "scope.h"
#include "aggregate.h"
#include "dsymbol.h"
+#include "mtype.h"
#if DMDV2
+Expression *resolveAliasThis(Scope *sc, Expression *e)
+{
+ Type *t = e->type->toBasetype();
+ AggregateDeclaration *ad;
+
+ if (t->ty == Tclass)
+ { ad = ((TypeClass *)t)->sym;
+ goto L1;
+ }
+ else if (t->ty == Tstruct)
+ { ad = ((TypeStruct *)t)->sym;
+ L1:
+ if (ad && ad->aliasthis)
+ {
+ e = new DotIdExp(e->loc, e, ad->aliasthis->ident);
+ e = e->semantic(sc);
+ e = resolveProperties(sc, e);
+ }
+ }
+
+ return e;
+}
AliasThis::AliasThis(Loc loc, Identifier *ident)
: Dsymbol(NULL) // it's anonymous (no identifier)
Oops, something went wrong.

0 comments on commit bca73ec

Please sign in to comment.