diff options
-rw-r--r-- | decl.c | 1 | ||||
-rw-r--r-- | deps.mk | 10 | ||||
-rw-r--r-- | map.c | 1 | ||||
-rw-r--r-- | map.h | 12 | ||||
-rw-r--r-- | qbe.c | 2 | ||||
-rw-r--r-- | scope.c | 1 | ||||
-rw-r--r-- | tree.c | 1 | ||||
-rw-r--r-- | tree.h | 8 | ||||
-rw-r--r-- | util.h | 25 |
9 files changed, 30 insertions, 31 deletions
@@ -8,7 +8,6 @@ #include <string.h> #include "util.h" #include "cc.h" -#include "map.h" static struct list tentativedefns = {&tentativedefns, &tentativedefns}; @@ -1,18 +1,18 @@ $(objdir)/driver.o: driver.c util.h config.h $(objdir)/util.o: util.c util.h -$(objdir)/decl.o: decl.c util.h cc.h map.h +$(objdir)/decl.o: decl.c util.h cc.h $(objdir)/eval.o: eval.c util.h cc.h $(objdir)/expr.o: expr.c util.h cc.h $(objdir)/init.o: init.c util.h cc.h $(objdir)/main.o: main.c util.h arg.h cc.h -$(objdir)/map.o: map.c util.h map.h +$(objdir)/map.o: map.c util.h $(objdir)/pp.o: pp.c util.h cc.h $(objdir)/scan.o: scan.c util.h cc.h -$(objdir)/scope.o: scope.c util.h cc.h map.h +$(objdir)/scope.o: scope.c util.h cc.h $(objdir)/siphash.o: siphash.c $(objdir)/stmt.o: stmt.c util.h cc.h $(objdir)/token.o: token.c util.h cc.h -$(objdir)/tree.o: tree.c util.h tree.h +$(objdir)/tree.o: tree.c util.h $(objdir)/type.o: type.c util.h cc.h $(objdir)/util.o: util.c util.h -$(objdir)/qbe.o: qbe.c util.h cc.h map.h tree.h ops.h +$(objdir)/qbe.o: qbe.c util.h cc.h ops.h @@ -4,7 +4,6 @@ #include <stdlib.h> #include <string.h> #include "util.h" -#include "map.h" struct map { size_t len, cap; @@ -1,12 +0,0 @@ -struct mapkey { - uint64_t hash; - const char *str; - size_t len; -}; - -void mapkey(struct mapkey *, const char *, size_t); - -struct map *mkmap(size_t); -void delmap(struct map *, void(void *)); -void **mapput(struct map *, struct mapkey *); -void *mapget(struct map *, struct mapkey *); @@ -7,8 +7,6 @@ #include <inttypes.h> #include "util.h" #include "cc.h" -#include "map.h" -#include "tree.h" struct name { char *str; @@ -4,7 +4,6 @@ #include <string.h> #include "util.h" #include "cc.h" -#include "map.h" struct scope filescope; @@ -3,7 +3,6 @@ #include <stddef.h> #include <stdint.h> #include "util.h" -#include "tree.h" #define MAXH (sizeof(void *) * 8 * 3 / 2) @@ -1,8 +0,0 @@ -struct treenode { - uint64_t key; - void *child[2]; - int height; - _Bool new; /* set by treeinsert if this node was newly allocated */ -}; - -void *treeinsert(void **, uint64_t, size_t); @@ -7,6 +7,19 @@ struct array { size_t len, cap; }; +struct mapkey { + uint64_t hash; + const char *str; + size_t len; +}; + +struct treenode { + uint64_t key; + void *child[2]; + int height; + _Bool new; /* set by treeinsert if this node was newly allocated */ +}; + extern char *argv0; #define LEN(a) (sizeof(a) / sizeof((a)[0])) @@ -31,3 +44,15 @@ void *arrayadd(struct array *, size_t); void arrayaddptr(struct array *, void *); void arrayaddbuf(struct array *, const void *, size_t); #define arrayforeach(a, m) for (m = (a)->val; m != (void *)((char *)(a)->val + (a)->len); ++m) + +/* map */ + +void mapkey(struct mapkey *, const char *, size_t); +struct map *mkmap(size_t); +void delmap(struct map *, void(void *)); +void **mapput(struct map *, struct mapkey *); +void *mapget(struct map *, struct mapkey *); + +/* tree */ + +void *treeinsert(void **, uint64_t, size_t); |