diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/qbt/nodes.h | 5 | ||||
| -rw-r--r-- | include/qbt/unreachable.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/qbt/nodes.h b/include/qbt/nodes.h index 011d718..63bbc58 100644 --- a/include/qbt/nodes.h +++ b/include/qbt/nodes.h @@ -128,6 +128,8 @@ struct blk { /* used to temporarily store label targets */ const char *to; + /* used by reachability analysis */ + bool reachable; }; struct fn { @@ -253,6 +255,9 @@ struct label_map { #define blk_at(v, i)\ vect_at(struct blk *, v, i) +#define blk_back(v)\ + vect_at(struct blk *, v, vec_len(&v) - 1) + #define blk_pop(v)\ vect_pop(struct blk *, v) diff --git a/include/qbt/unreachable.h b/include/qbt/unreachable.h new file mode 100644 index 0000000..0f0c39e --- /dev/null +++ b/include/qbt/unreachable.h @@ -0,0 +1,8 @@ +#ifndef UNREACHABLE_H +#define UNREACHABLE_H + +#include <qbt/nodes.h> + +void unreachable(struct fn *f); + +#endif /* UNREACHABLE_H */ |
