summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-07-25 19:47:35 -0400
committerOri Bernstein <ori@eigenstate.org>2012-07-25 19:47:35 -0400
commit4ece888b582d2cb2b9e74cdebcede99a57b55e07 (patch)
tree4815157fe542abfff5a7b0c6c8db51d61fe188ed /util
parent62f197bc9c8a7d3493596e55462d7eb9bbe21ae1 (diff)
downloadmc-4ece888b582d2cb2b9e74cdebcede99a57b55e07.tar.gz
Merge the symtabs correctly.
Due to naming issues, we were only putting in sub-symtabs. Not good.
Diffstat (limited to 'util')
-rw-r--r--util/muse.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/util/muse.c b/util/muse.c
index ecb6e9b..dcb2556 100644
--- a/util/muse.c
+++ b/util/muse.c
@@ -24,7 +24,8 @@ static void usage(char *prog)
{
printf("%s [-hIdos] [-o outfile] [-m] inputs\n", prog);
printf("\t-h\tprint this help\n");
- printf("\t-m\ttreat the inputs as usefiles and merge them\n");
+ printf("\t-m\ttreat the inputs as usefiles and merge them into outfile\n");
+ printf("\t\tThe outfile must be the same name as each package merged.\n");
printf("\t-I path\tAdd 'path' to use search path\n");
printf("\t-d\tPrint debug dumps\n");
printf("\t-o out\tOutput to outfile\n");
@@ -105,21 +106,26 @@ int main(int argc, char **argv)
}
}
- for (i = optind; i < argc; i++) {
+ if (merge) {
file = mkfile(argv[i]);
file->file.exports = mkstab();
file->file.globls = mkstab();
- if (merge)
+ updatens(file->file.exports, outfile);
+ for (i = optind; i < argc; i++)
mergeuse(argv[i]);
- else if (debugopt['s'])
- dumpuse(argv[i]);
- else
- genuse(argv[i]);
- }
- if (merge) {
f = fopen(outfile, "w");
writeuse(f, file);
fclose(f);
+ } else {
+ for (i = optind; i < argc; i++) {
+ file = mkfile(argv[i]);
+ file->file.exports = mkstab();
+ file->file.globls = mkstab();
+ if (debugopt['s'])
+ dumpuse(argv[i]);
+ else
+ genuse(argv[i]);
+ }
}
return 0;