summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-05-02 11:24:45 -0400
committerOri Bernstein <ori@eigenstate.org>2013-05-02 11:24:45 -0400
commit507c0dc4eb7b20d87dc7ac06316e4620057e47ab (patch)
treeb86f499c1deacc6300ab6715e552356b53efa230
parent889d5c6fde975ec10bb39d08de9e7d47ec68387a (diff)
downloadmc-507c0dc4eb7b20d87dc7ac06316e4620057e47ab.tar.gz
Remove useless exported functions.
-rw-r--r--parse/parse.h8
-rw-r--r--parse/use.c34
2 files changed, 8 insertions, 34 deletions
diff --git a/parse/parse.h b/parse/parse.h
index d800dcc..301d1f9 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -435,14 +435,6 @@ void *lpop(void *l, size_t *len);
void ldel(void *l, size_t *len, size_t idx);
void lfree(void *l, size_t *len);
-/* serialization/usefiles */
-void typickle(Type *t, FILE *fd);
-void sympickle(Node *s, FILE *fd);
-void pickle(Node *n, FILE *fd);
-Type *tyunpickle(FILE *fd);
-Node *symunpickle(FILE *fd);
-Node *unpickle(FILE *fd);
-
/* serializing/unserializing */
void be64(vlong v, byte buf[8]);
vlong host64(byte buf[8]);
diff --git a/parse/use.c b/parse/use.c
index a16e85a..1a9d494 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -17,6 +17,8 @@ static void wrstab(FILE *fd, Stab *val);
static Stab *rdstab(FILE *fd);
static void wrsym(FILE *fd, Node *val);
static Node *rdsym(FILE *fd);
+static void pickle(Node *n, FILE *fd);
+static Node *unpickle(FILE *fd);
/* Outputs a symbol table to file in a way that can be
* read back usefully. Only writes declarations, types
@@ -156,16 +158,6 @@ static Node *rdsym(FILE *fd)
return n;
}
-Type *tyunpickle(FILE *fd)
-{
- return rdtype(fd);
-}
-
-Node *symunpickle(FILE *fd)
-{
- return rdsym(fd);
-}
-
/* Writes types to a file. Errors on
* internal only types like Tyvar that
* will not be meaningful in another file */
@@ -273,23 +265,13 @@ static Type *rdtype(FILE *fd)
return ty;
}
-void typickle(Type *t, FILE *fd)
-{
- wrtype(fd, t);
-}
-
-void sympickle(Node *s, FILE *fd)
-{
- wrsym(fd, s);
-}
-
/* Pickles a node to a file. The format
* is more or less equivalen to to
* simplest serialization of the
* in-memory representation. Minimal
* checking is done, so a bad type can
* crash the compiler */
-void pickle(Node *n, FILE *fd)
+static void pickle(Node *n, FILE *fd)
{
size_t i;
@@ -406,7 +388,7 @@ void pickle(Node *n, FILE *fd)
/* Unpickles a node from a file. Minimal checking
* is done. Specifically, no checks are done for
* sane arities, a bad file can crash the compiler */
-Node *unpickle(FILE *fd)
+static Node *unpickle(FILE *fd)
{
size_t i;
Ntype type;
@@ -588,11 +570,11 @@ int loaduse(FILE *f, Stab *st)
switch(c) {
case 'G':
case 'D':
- dcl = symunpickle(f);
+ dcl = rdsym(f);
putdcl(s, dcl);
break;
case 'T':
- t = tyunpickle(f);
+ t = rdtype(f);
assert(t->type == Tyname || t->type == Tygeneric);
puttype(s, t->name, t);
u = tybase(t);
@@ -666,7 +648,7 @@ void writeuse(FILE *f, Node *file)
t = gettype(st, k[i]);
assert(t->type == Tyname || t->type == Tygeneric);
wrbyte(f, 'T');
- typickle(t, f);
+ wrtype(f, t);
}
free(k);
k = htkeys(st->dcl, &n);
@@ -676,7 +658,7 @@ void writeuse(FILE *f, Node *file)
wrbyte(f, 'G');
else
wrbyte(f, 'D');
- sympickle(s, f);
+ wrsym(f, s);
}
free(k);
wrbyte(f, 'Z');