Permalink
Browse files

[svn r5] Initial commit. Most things are very rough.

  • Loading branch information...
1 parent 1c23dd2 commit 34699bbb07a8a83392a92b720aa6aacdd2b79649 @lindquist lindquist committed Sep 1, 2007
Showing with 84,269 additions and 0 deletions.
  1. +1,257 −0 dmd/Doxyfile
  2. +423 −0 dmd/access.c
  3. +256 −0 dmd/aggregate.h
  4. +220 −0 dmd/array.c
  5. +51 −0 dmd/arraytypes.h
  6. +117 −0 dmd/artistic.txt
  7. +1,249 −0 dmd/attrib.c
  8. +165 −0 dmd/attrib.h
  9. +1,419 −0 dmd/cast.c
  10. +1,267 −0 dmd/class.c
  11. +74 −0 dmd/complex_t.h
  12. +390 −0 dmd/cond.c
  13. +106 −0 dmd/cond.h
  14. +1,461 −0 dmd/constfold.c
  15. +482 −0 dmd/dchar.c
  16. +194 −0 dmd/dchar.h
  17. +1,260 −0 dmd/declaration.c
  18. +670 −0 dmd/declaration.h
  19. +214 −0 dmd/delegatize.c
  20. +1,925 −0 dmd/doc.c
  21. +19 −0 dmd/doc.h
  22. +971 −0 dmd/dsymbol.c
  23. +299 −0 dmd/dsymbol.h
  24. +144 −0 dmd/dump.c
  25. +1,366 −0 dmd/entity.c
  26. +314 −0 dmd/enum.c
  27. +74 −0 dmd/enum.h
  28. +8,584 −0 dmd/expression.c
  29. +1,410 −0 dmd/expression.h
  30. +2,659 −0 dmd/func.c
  31. +55 −0 dmd/gnuc.c
  32. +8 −0 dmd/gnuc.h
  33. +248 −0 dmd/gpl.txt
  34. +114 −0 dmd/hdrgen.c
  35. +34 −0 dmd/hdrgen.h
  36. +718 −0 dmd/html.c
  37. +43 −0 dmd/html.h
  38. +353 −0 dmd/id.c
  39. +182 −0 dmd/id.h
  40. +89 −0 dmd/identifier.c
  41. +46 −0 dmd/identifier.h
  42. +304 −0 dmd/idgen.c
  43. +440 −0 dmd/impcnvgen.c
  44. +178 −0 dmd/impcnvtab.c
  45. +268 −0 dmd/import.c
  46. +65 −0 dmd/import.h
  47. +272 −0 dmd/inifile.c
  48. +550 −0 dmd/init.c
  49. +129 −0 dmd/init.h
  50. +1,441 −0 dmd/inline.c
  51. +2,106 −0 dmd/interpret.c
  52. +2,778 −0 dmd/lexer.c
  53. +285 −0 dmd/lexer.h
  54. +504 −0 dmd/link.c
  55. +59 −0 dmd/lstring.c
  56. +72 −0 dmd/lstring.h
  57. +459 −0 dmd/macro.c
  58. +44 −0 dmd/macro.h
  59. +249 −0 dmd/mangle.c
  60. +1,164 −0 dmd/mars.c
  61. +297 −0 dmd/mars.h
  62. +144 −0 dmd/mem.c
  63. +51 −0 dmd/mem.h
  64. +981 −0 dmd/module.c
  65. +177 −0 dmd/module.h
  66. +5,216 −0 dmd/mtype.c
  67. +705 −0 dmd/mtype.h
  68. +748 −0 dmd/opover.c
  69. +750 −0 dmd/optimize.c
  70. +4,907 −0 dmd/parse.c
  71. +135 −0 dmd/parse.h
  72. +65 −0 dmd/port.h
  73. +27 −0 dmd/readme.txt
  74. +1,835 −0 dmd/root.c
  75. +349 −0 dmd/root.h
  76. +357 −0 dmd/scope.c
  77. +109 −0 dmd/scope.h
  78. +3,564 −0 dmd/statement.c
  79. +751 −0 dmd/statement.h
  80. +109 −0 dmd/staticassert.c
  81. +43 −0 dmd/staticassert.h
  82. +139 −0 dmd/stringtable.c
  83. +48 −0 dmd/stringtable.h
  84. +488 −0 dmd/struct.c
  85. +3,959 −0 dmd/template.c
  86. +324 −0 dmd/template.h
  87. +45 −0 dmd/total.h
  88. +323 −0 dmd/unialpha.c
  89. +193 −0 dmd/utf.c
  90. +26 −0 dmd/utf.h
  91. +181 −0 dmd/version.c
  92. +51 −0 dmd/version.h
  93. +65 −0 gen/elem.c
  94. +44 −0 gen/elem.h
  95. +8 −0 gen/enums.h
  96. +111 −0 gen/irstate.c
  97. +122 −0 gen/irstate.h
  98. +47 −0 gen/logger.c
  99. +48 −0 gen/logger.h
  100. +74 −0 gen/runtime.c
  101. +6 −0 gen/runtime.h
  102. 0 gen/symbol.h
  103. +215 −0 gen/tocsym.c
  104. +170 −0 gen/todt.c
  105. +2,910 −0 gen/toir.c
  106. +1,089 −0 gen/tollvm.c
  107. +44 −0 gen/tollvm.h
  108. +816 −0 gen/toobj.c
  109. +403 −0 gen/typinf.c
  110. +26 −0 lphobos/build.sh
  111. +4 −0 lphobos/clean.sh
  112. +79 −0 lphobos/crc32.d
  113. +2 −0 lphobos/dsss.conf
  114. +15 −0 lphobos/gcstats.d
  115. +67 −0 lphobos/internal/arrays.d
  116. +13 −0 lphobos/internal/contract.d
  117. +24 −0 lphobos/internal/moduleinit.d
  118. +15 −0 lphobos/internal/moduleinit_backend.ll
  119. +1,075 −0 lphobos/internal/objectimpl.d
  120. +150 −0 lphobos/llvm/intrinsic.d
  121. +164 −0 lphobos/object.d
  122. +112 −0 lphobos/std/c/fenv.d
  123. +478 −0 lphobos/std/c/linux/linux.d
  124. +25 −0 lphobos/std/c/linux/linuxextern.d
  125. +257 −0 lphobos/std/c/linux/pthread.d
  126. +396 −0 lphobos/std/c/linux/socket.d
  127. +151 −0 lphobos/std/c/locale.d
  128. +291 −0 lphobos/std/c/math.d
  129. +86 −0 lphobos/std/c/process.d
  130. +42 −0 lphobos/std/c/stdarg.d
  131. +23 −0 lphobos/std/c/stddef.d
  132. +300 −0 lphobos/std/c/stdio.d
  133. +90 −0 lphobos/std/c/stdlib.d
  134. +40 −0 lphobos/std/c/string.d
  135. +94 −0 lphobos/std/c/time.d
  136. +265 −0 lphobos/std/intrinsic.d
  137. +177 −0 lphobos/std/stdint.d
  138. +111 −0 lphobos/std/typeinfo/ti_Aint.d
  139. +39 −0 lphobos/std/typeinfo/ti_byte.d
  140. +43 −0 lphobos/std/typeinfo/ti_char.d
  141. +43 −0 lphobos/std/typeinfo/ti_int.d
  142. +42 −0 lphobos/std/typeinfo/ti_ptr.d
  143. +39 −0 lphobos/std/typeinfo/ti_short.d
  144. +43 −0 lphobos/std/typeinfo/ti_ubyte.d
  145. +43 −0 lphobos/std/typeinfo/ti_uint.d
  146. +39 −0 lphobos/std/typeinfo/ti_ushort.d
  147. +92 −0 lphobos/std/typeinfounsupported/ti_AC.d
  148. +103 −0 lphobos/std/typeinfounsupported/ti_Acdouble.d
  149. +101 −0 lphobos/std/typeinfounsupported/ti_Acfloat.d
  150. +104 −0 lphobos/std/typeinfounsupported/ti_Acreal.d
  151. +112 −0 lphobos/std/typeinfounsupported/ti_Adouble.d
  152. +111 −0 lphobos/std/typeinfounsupported/ti_Afloat.d
  153. +202 −0 lphobos/std/typeinfounsupported/ti_Ag.d
  154. +111 −0 lphobos/std/typeinfounsupported/ti_Aint.d
  155. +103 −0 lphobos/std/typeinfounsupported/ti_Along.d
  156. +113 −0 lphobos/std/typeinfounsupported/ti_Areal.d
  157. +126 −0 lphobos/std/typeinfounsupported/ti_Ashort.d
  158. +76 −0 lphobos/std/typeinfounsupported/ti_C.d
  159. +39 −0 lphobos/std/typeinfounsupported/ti_byte.d
  160. +67 −0 lphobos/std/typeinfounsupported/ti_cdouble.d
  161. +66 −0 lphobos/std/typeinfounsupported/ti_cfloat.d
  162. +43 −0 lphobos/std/typeinfounsupported/ti_char.d
  163. +68 −0 lphobos/std/typeinfounsupported/ti_creal.d
  164. +45 −0 lphobos/std/typeinfounsupported/ti_dchar.d
  165. +40 −0 lphobos/std/typeinfounsupported/ti_delegate.d
  166. +67 −0 lphobos/std/typeinfounsupported/ti_double.d
  167. +67 −0 lphobos/std/typeinfounsupported/ti_float.d
  168. +12 −0 lphobos/std/typeinfounsupported/ti_idouble.d
  169. +12 −0 lphobos/std/typeinfounsupported/ti_ifloat.d
  170. +43 −0 lphobos/std/typeinfounsupported/ti_int.d
  171. +12 −0 lphobos/std/typeinfounsupported/ti_ireal.d
  172. +43 −0 lphobos/std/typeinfounsupported/ti_long.d
  173. +42 −0 lphobos/std/typeinfounsupported/ti_ptr.d
  174. +67 −0 lphobos/std/typeinfounsupported/ti_real.d
  175. +39 −0 lphobos/std/typeinfounsupported/ti_short.d
  176. +43 −0 lphobos/std/typeinfounsupported/ti_ubyte.d
  177. +43 −0 lphobos/std/typeinfounsupported/ti_uint.d
  178. +43 −0 lphobos/std/typeinfounsupported/ti_ulong.d
  179. +39 −0 lphobos/std/typeinfounsupported/ti_ushort.d
  180. +44 −0 lphobos/std/typeinfounsupported/ti_void.d
  181. +44 −0 lphobos/std/typeinfounsupported/ti_wchar.d
  182. +34 −0 premake.lua
  183. +21 −0 test/a.d
  184. +21 −0 test/alignment.d
  185. +5 −0 test/arrayinit.d
  186. +39 −0 test/arrays.d
  187. +19 −0 test/arrays2.d
  188. +23 −0 test/assign.d
  189. +23 −0 test/b.d
  190. +75 −0 test/bitops.d
  191. +10 −0 test/c.d
  192. +17 −0 test/classes.d
  193. +23 −0 test/classes2.d
  194. +33 −0 test/classes3.d
  195. +36 −0 test/classes4.d
  196. +11 −0 test/comma.d
  197. +43 −0 test/cond.d
  198. +14 −0 test/condexp.d
  199. +16 −0 test/cyclic.d
  200. +48 −0 test/d.d
  201. +84 −0 test/dgs.d
  202. +34 −0 test/dotproduct.d
  203. +23 −0 test/e.d
  204. +11 −0 test/f.d
  205. +160 −0 test/floatcmp.d
  206. +11 −0 test/forwdecl.d
  207. +66 −0 test/funcptr.d
  208. +48 −0 test/funcs.d
  209. +11 −0 test/imports_1of2.d
  210. +11 −0 test/imports_2of2.d
  211. +30 −0 test/intrinsics.d
  212. +22 −0 test/pointers.d
  213. +28 −0 test/pt.d
  214. +33 −0 test/ptrarith.d
  215. +31 −0 test/sieve.d
  216. +34 −0 test/slices.d
  217. +14 −0 test/static_ctor.d
  218. +70 −0 test/staticarrays.d
  219. +24 −0 test/structinit.d
  220. +8 −0 test/structinit2.d
  221. +13 −0 test/structs.d
  222. +13 −0 test/structs2.d
  223. +45 −0 test/terms.d
  224. +9 −0 test/typeinfo.d
  225. +30 −0 test/v2d.d
  226. +15 −0 test/virtcall.d
  227. +29 −0 tester.sh
View
1,257 dmd/Doxyfile

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,256 @@
+
+// Compiler implementation of the D programming language
+// Copyright (c) 1999-2006 by Digital Mars
+// All Rights Reserved
+// written by Walter Bright
+// http://www.digitalmars.com
+// License for redistribution is by either the Artistic License
+// in artistic.txt, or the GNU General Public License in gnu.txt.
+// See the included readme.txt for details.
+
+#ifndef DMD_AGGREGATE_H
+#define DMD_AGGREGATE_H
+
+#ifdef __DMC__
+#pragma once
+#endif /* __DMC__ */
+
+#include "root.h"
+#include "dsymbol.h"
+
+struct Identifier;
+struct Type;
+struct TypeFunction;
+struct Expression;
+struct FuncDeclaration;
+struct CtorDeclaration;
+struct DtorDeclaration;
+struct InvariantDeclaration;
+struct NewDeclaration;
+struct DeleteDeclaration;
+struct InterfaceDeclaration;
+struct ClassInfoDeclaration;
+struct VarDeclaration;
+struct dt_t;
+
+namespace llvm
+{
+ class Type;
+ class Value;
+ class Constant;
+}
+
+struct AggregateDeclaration : ScopeDsymbol
+{
+ Type *type;
+ unsigned storage_class;
+ enum PROT protection;
+ Type *handle; // 'this' type
+ unsigned structsize; // size of struct
+ unsigned alignsize; // size of struct for alignment purposes
+ unsigned structalign; // struct member alignment in effect
+ int hasUnions; // set if aggregate has overlapping fields
+ Array fields; // VarDeclaration fields
+ unsigned sizeok; // set when structsize contains valid data
+ // 0: no size
+ // 1: size is correct
+ // 2: cannot determine size; fwd referenced
+ int isdeprecated; // !=0 if deprecated
+ Scope *scope; // !=NULL means context to use
+
+ // Special member functions
+ InvariantDeclaration *inv; // invariant
+ NewDeclaration *aggNew; // allocator
+ DeleteDeclaration *aggDelete; // deallocator
+
+#ifdef IN_GCC
+ Array methods; // flat list of all methods for debug information
+#endif
+
+ AggregateDeclaration(Loc loc, Identifier *id);
+ void semantic2(Scope *sc);
+ void semantic3(Scope *sc);
+ void inlineScan();
+ unsigned size(Loc loc);
+ static void alignmember(unsigned salign, unsigned size, unsigned *poffset);
+ Type *getType();
+ void addField(Scope *sc, VarDeclaration *v);
+ int isDeprecated(); // is aggregate deprecated?
+
+ void emitComment(Scope *sc);
+ void toDocBuffer(OutBuffer *buf);
+
+ // For access checking
+ virtual PROT getAccess(Dsymbol *smember); // determine access to smember
+ int isFriendOf(AggregateDeclaration *cd);
+ int hasPrivateAccess(Dsymbol *smember); // does smember have private access to members of this class?
+ void accessCheck(Loc loc, Scope *sc, Dsymbol *smember);
+
+ enum PROT prot();
+
+ // Back end
+ Symbol *stag; // tag symbol for debug data
+ Symbol *sinit;
+ Symbol *toInitializer();
+
+ bool llvmInProgress;
+ llvm::Type* llvmType;
+ llvm::Value* llvmVtbl;
+ llvm::Constant* llvmInitZ;
+ virtual unsigned offsetToIndex(unsigned os); // converts a DMD field offsets to LLVM struct index
+
+ AggregateDeclaration *isAggregateDeclaration() { return this; }
+};
+
+struct AnonymousAggregateDeclaration : AggregateDeclaration
+{
+ AnonymousAggregateDeclaration()
+ : AggregateDeclaration(0, NULL)
+ {
+ }
+
+ AnonymousAggregateDeclaration *isAnonymousAggregateDeclaration() { return this; }
+};
+
+struct StructDeclaration : AggregateDeclaration
+{
+ int zeroInit; // !=0 if initialize with 0 fill
+
+ StructDeclaration(Loc loc, Identifier *id);
+ Dsymbol *syntaxCopy(Dsymbol *s);
+ void semantic(Scope *sc);
+ void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
+ char *mangle();
+ char *kind();
+ void toDocBuffer(OutBuffer *buf);
+
+ PROT getAccess(Dsymbol *smember); // determine access to smember
+
+ void toObjFile(); // compile to .obj file
+ void toDt(dt_t **pdt);
+ void toDebug(); // to symbolic debug info
+
+ StructDeclaration *isStructDeclaration() { return this; }
+};
+
+struct UnionDeclaration : StructDeclaration
+{
+ UnionDeclaration(Loc loc, Identifier *id);
+ Dsymbol *syntaxCopy(Dsymbol *s);
+ char *kind();
+
+ UnionDeclaration *isUnionDeclaration() { return this; }
+};
+
+struct BaseClass
+{
+ Type *type; // (before semantic processing)
+ enum PROT protection; // protection for the base interface
+
+ ClassDeclaration *base;
+ int offset; // 'this' pointer offset
+ Array vtbl; // for interfaces: Array of FuncDeclaration's
+ // making up the vtbl[]
+
+ int baseInterfaces_dim;
+ BaseClass *baseInterfaces; // if BaseClass is an interface, these
+ // are a copy of the InterfaceDeclaration::interfaces
+
+ BaseClass();
+ BaseClass(Type *type, enum PROT protection);
+
+ int fillVtbl(ClassDeclaration *cd, Array *vtbl, int newinstance);
+ void copyBaseInterfaces(BaseClasses *);
+};
+
+#define CLASSINFO_SIZE (0x3C+12) // value of ClassInfo.size
+
+struct ClassDeclaration : AggregateDeclaration
+{
+ static ClassDeclaration *object;
+ static ClassDeclaration *classinfo;
+
+ ClassDeclaration *baseClass; // NULL only if this is Object
+ CtorDeclaration *ctor;
+ CtorDeclaration *defaultCtor; // default constructor
+ FuncDeclarations dtors; // Array of destructors
+ FuncDeclaration *staticCtor;
+ FuncDeclaration *staticDtor;
+ Array vtbl; // Array of FuncDeclaration's making up the vtbl[]
+ Array vtblFinal; // More FuncDeclaration's that aren't in vtbl[]
+
+ BaseClasses baseclasses; // Array of BaseClass's; first is super,
+ // rest are Interface's
+
+ int interfaces_dim;
+ BaseClass **interfaces; // interfaces[interfaces_dim] for this class
+ // (does not include baseClass)
+
+ BaseClasses *vtblInterfaces; // array of base interfaces that have
+ // their own vtbl[]
+
+ ClassInfoDeclaration *vclassinfo; // the ClassInfo object for this ClassDeclaration
+ int com; // !=0 if this is a COM class
+ int isauto; // !=0 if this is an auto class
+ int isabstract; // !=0 if abstract class
+
+ int isnested; // !=0 if is nested
+ VarDeclaration *vthis; // 'this' parameter if this class is nested
+
+ ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
+ Dsymbol *syntaxCopy(Dsymbol *s);
+ void semantic(Scope *sc);
+ void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
+ int isBaseOf2(ClassDeclaration *cd);
+
+ #define OFFSET_RUNTIME 0x76543210
+ virtual int isBaseOf(ClassDeclaration *cd, int *poffset);
+
+ Dsymbol *search(Loc, Identifier *ident, int flags);
+ FuncDeclaration *findFunc(Identifier *ident, TypeFunction *tf);
+ void interfaceSemantic(Scope *sc);
+ int isNested();
+ int isCOMclass();
+ int isAbstract();
+ virtual int vtblOffset();
+ char *kind();
+ char *mangle();
+ void toDocBuffer(OutBuffer *buf);
+
+ PROT getAccess(Dsymbol *smember); // determine access to smember
+
+ void addLocalClass(ClassDeclarations *);
+
+ // Back end
+ void toObjFile(); // compile to .obj file
+ void toDebug();
+ unsigned baseVtblOffset(BaseClass *bc);
+ Symbol *toSymbol();
+ Symbol *toVtblSymbol();
+ void toDt(dt_t **pdt);
+ void toDt2(dt_t **pdt, ClassDeclaration *cd);
+
+ Symbol *vtblsym;
+
+ virtual unsigned offsetToIndex(unsigned os);
+
+ ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; }
+};
+
+struct InterfaceDeclaration : ClassDeclaration
+{
+ InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
+ Dsymbol *syntaxCopy(Dsymbol *s);
+ void semantic(Scope *sc);
+ int isBaseOf(ClassDeclaration *cd, int *poffset);
+ int isBaseOf(BaseClass *bc, int *poffset);
+ char *kind();
+ int vtblOffset();
+
+ void toObjFile(); // compile to .obj file
+ Symbol *toSymbol();
+
+ InterfaceDeclaration *isInterfaceDeclaration() { return this; }
+};
+
+#endif /* DMD_AGGREGATE_H */
Oops, something went wrong.

0 comments on commit 34699bb

Please sign in to comment.