added "symbols_init" from object to initialize t_int, t_char, ...
authorMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 16 Aug 1983 17:17:16 +0000 (09:17 -0800)
committerMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 16 Aug 1983 17:17:16 +0000 (09:17 -0800)
SCCS-vsn: old/dbx/symbols.c 1.11

usr/src/old/dbx/symbols.c

index e51e89e..2196706 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)symbols.c 1.10 %G%";
+static char sccsid[] = "@(#)symbols.c 1.11 %G%";
 
 /*
  * Symbol management.
 
 /*
  * Symbol management.
@@ -167,19 +167,23 @@ public Symbol symbol_alloc()
 public symbol_dump(func)
 Symbol func;
 {
 public symbol_dump(func)
 Symbol func;
 {
-  register Symbol s;
-  register Integer i;
+    register Symbol s;
+    register Integer i;
 
 
-       printf(" symbols in %s \n",symname(func));
-       for(i=0; i< HASHTABLESIZE; i++)
-          for(s=hashtab[i]; s != nil; s=s->next_sym)  {
-               if (s->block == func) psym(s);
-               }
+    printf(" symbols in %s \n",symname(func));
+    for (i = 0; i< HASHTABLESIZE; i++) {
+       for (s = hashtab[i]; s != nil; s = s->next_sym) {
+           if (s->block == func) {
+               psym(s);
+           }
+       }
+    }
 }
 
 /*
  * Free all the symbols currently allocated.
  */
 }
 
 /*
  * Free all the symbols currently allocated.
  */
+
 public symbol_free()
 {
     Sympool s, t;
 public symbol_free()
 {
     Sympool s, t;
@@ -286,6 +290,19 @@ Frame frame;
     }
 }
 
     }
 }
 
+/*
+ * Create base types.
+ */
+
+public symbols_init()
+{
+    t_boolean = maketype("$boolean", 0L, 1L);
+    t_int = maketype("$integer", 0x80000000L, 0x7fffffffL);
+    t_char = maketype("$char", 0L, 127L);
+    t_real = maketype("$real", 8L, 0L);
+    t_nil = maketype("$nil", 0L, 0L);
+}
+
 /*
  * Create a builtin type.
  * Builtin types are circular in that btype->type->type = btype.
 /*
  * Create a builtin type.
  * Builtin types are circular in that btype->type->type = btype.
@@ -859,9 +876,6 @@ register Node p;
            }
            break;
 
            }
            break;
 
-       /*
-        * Perform a cast if the call is of the form "type(expr)".
-        */
        case O_CALL:
            p1 = p->value.arg[0];
            p->nodetype = rtype(p1->nodetype)->type;
        case O_CALL:
            p1 = p->value.arg[0];
            p->nodetype = rtype(p1->nodetype)->type;