Mercurial > projects > ldc
diff lphobos/object.d @ 31:2841234d2aea trunk
[svn r35] * Attributes on struct fields/methods now work
* Updated object.d to 1.021
* Added -novalidate command line option. this is sometimes useful when debugging as it may let you read the .ll even if it's invalid.
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 16:44:07 +0200 |
parents | c53b6e3fe49a |
children | fd7ad91fd713 |
line wrap: on
line diff
--- a/lphobos/object.d Thu Oct 04 14:15:54 2007 +0200 +++ b/lphobos/object.d Thu Oct 04 16:44:07 2007 +0200 @@ -10,8 +10,13 @@ alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t; alias size_t hash_t; +alias char[] string; +alias wchar[] wstring; +alias dchar[] dstring; + extern (C) { int printf(char *, ...); + void trace_term(); } class Object @@ -24,13 +29,15 @@ final void notifyRegister(void delegate(Object) dg); final void notifyUnRegister(void delegate(Object) dg); + + static Object factory(char[] classname); } struct Interface { ClassInfo classinfo; void *[] vtbl; - ptrdiff_t offset; // offset to Interface 'this' from Object 'this' + int offset; // offset to Interface 'this' from Object 'this' } class ClassInfo : Object @@ -46,8 +53,13 @@ // 1: // IUnknown // 2: // has no possible pointers into GC memory // 4: // has offTi[] member + // 8: // has constructors void *deallocator; OffsetTypeInfo[] offTi; + void* defaultConstructor; // default Constructor + + static ClassInfo find(char[] classname); + Object create(); } struct OffsetTypeInfo @@ -141,15 +153,24 @@ TypeInfo[] elements; } +class TypeInfo_Const : TypeInfo +{ + TypeInfo next; +} + +class TypeInfo_Invariant : TypeInfo_Const +{ +} + // Recoverable errors class Exception : Object { - char[] msg; + string msg; - this(char[] msg); - void print(); - char[] toString(); + this(string msg); + override void print(); + override string toString(); } // Non-recoverable errors @@ -158,7 +179,7 @@ { Error next; - this(char[] msg); - this(char[] msg, Error next); + this(string msg); + this(string msg, Error next); }