diff trunk/src/dil/TypeSystem.d @ 536:0781ac288537

Added some semantic() methods. Renamed member typ of dil.TypeSystem.Type to tid. Added 'Undefined' to struct Types. Removed charLiteral and added 'dchar character' to class CharExpression.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 18 Dec 2007 15:14:41 +0100
parents c8c3aec130f7
children faf16f4e7fc8
line wrap: on
line diff
--- a/trunk/src/dil/TypeSystem.d	Tue Dec 18 00:32:30 2007 +0100
+++ b/trunk/src/dil/TypeSystem.d	Tue Dec 18 15:14:41 2007 +0100
@@ -12,14 +12,14 @@
 abstract class Type : Symbol
 {
   Type next;
-  TYP typ;
+  TYP tid; /// The ID of the type.
 
   this(){}
 
-  this(Type next, TYP typ)
+  this(Type next, TYP tid)
   {
     this.next = next;
-    this.typ = typ;
+    this.tid = tid;
   }
 
   TypePointer ptrTo()
@@ -249,7 +249,7 @@
 
   size_t getSize(Type type)
   {
-    auto size = metaInfoTable[type.typ].size;
+    auto size = metaInfoTable[type.tid].size;
     if (size == SIZE_NOT_AVAILABLE)
       return type.sizeOf_();
     return size;
@@ -270,6 +270,7 @@
 
   TypeBasic Size_t, Ptrdiff_t;
   TypePointer Void_ptr;
+  TypeBasic Undefined;
 
   /// Allocates an instance of TypeBasic and assigns it to typeName.
   template newTB(char[] typeName)
@@ -314,5 +315,6 @@
       Ptrdiff_t = Int;
     }
     Void_ptr = Void.ptrTo;
+    Undefined = new TypeBasic(TYP.Error);
   }
 }