summaryrefslogtreecommitdiff
path: root/6/asm.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-03-20 00:38:35 -0700
committerOri Bernstein <ori@eigenstate.org>2017-03-20 00:38:35 -0700
commit6c574d4fc09d60095b4d74e865a67a8b1d2b2270 (patch)
treeb5a78da1bf32fa7d780c3f71baecf5b68e7afcf7 /6/asm.h
parent5cf18de659c44f4287c103dd81298c5f6b7e0951 (diff)
downloadmc-6c574d4fc09d60095b4d74e865a67a8b1d2b2270.tar.gz
Step by line in gdb.
I guess it's a good idea.
Diffstat (limited to '6/asm.h')
-rw-r--r--6/asm.h56
1 files changed, 29 insertions, 27 deletions
diff --git a/6/asm.h b/6/asm.h
index f9fa996..0c6e13e 100644
--- a/6/asm.h
+++ b/6/asm.h
@@ -131,39 +131,41 @@ struct Insn {
};
struct Func {
- char *name; /* function name */
- Type *type; /* type of function */
-
- Node **args; /* argument list */
- size_t nargs; /* number of args, including hidden ones */
- Htab *stkoff; /* Loc* -> int stkoff map */
- Htab *envoff; /* Loc* -> int envoff map */
- size_t stksz; /* stack size */
- Node *ret; /* return value */
-
- Cfg *cfg; /* flow graph */
- char isexport; /* is this exported from the asm? */
- char hasenv; /* do we have an environment? */
+ char *name; /* function name */
+ Srcloc loc; /* location of definition */
+ Type *type; /* type of function */
+
+ Node **args; /* argument list */
+ size_t nargs; /* number of args, including hidden ones */
+ Htab *stkoff; /* Loc* -> int stkoff map */
+ Htab *envoff; /* Loc* -> int envoff map */
+ size_t stksz; /* stack size */
+ Node *ret; /* return value */
+
+ Cfg *cfg; /* flow graph */
+ char isexport; /* is this exported from the asm? */
+ char hasenv; /* do we have an environment? */
};
struct Asmbb {
- int id; /* unique identifier */
- char **lbls; /* list of BB labels */
- size_t nlbls; /* number of labels */
- Insn **il; /* instructions */
- size_t ni; /* number of instructions */
-
- Bitset *pred; /* set of predecessor BB ids */
- Bitset *succ; /* set of successor BB ids */
- Bitset *use; /* registers used by this BB */
- Bitset *def; /* registers defined by this BB */
- Bitset *livein; /* variables live on entrance to BB */
- Bitset *liveout; /* variables live on exit from BB */
+ int id; /* unique identifier */
+ char **lbls; /* list of BB labels */
+ size_t nlbls; /* number of labels */
+ Insn **il; /* instructions */
+ size_t ni; /* number of instructions */
+
+ Bitset *pred; /* set of predecessor BB ids */
+ Bitset *succ; /* set of successor BB ids */
+ Bitset *use; /* registers used by this BB */
+ Bitset *def; /* registers defined by this BB */
+ Bitset *livein; /* variables live on entrance to BB */
+ Bitset *liveout; /* variables live on exit from BB */
};
/* instruction selection state */
struct Isel {
char *name;
+ char *cwd;
Cfg *cfg; /* cfg built with nodes */
@@ -255,8 +257,8 @@ void fillglobls(Stab *st, Htab *globls);
void simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob);
void selfunc(Isel *is, Func *fn, Htab *globls, Htab *strtab);
void gen(Node *file, char *out);
-void gengas(Node *file, char *out);
-void genp9(Node *file, char *out);
+void gengas(Node *file, FILE *fd);
+void genp9(Node *file, FILE *fd);
/* blob stuff */
Blob *mkblobpad(size_t sz);