aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-02-18 22:21:20 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-02-24 10:49:15 +0100
commite22588735b2ed54a08d1b3fb593cc3a26afb320b (patch)
treeeabe76ccc942877e8d74749861410f314fc06e1f
parent6114de42604a7b8c8e98ae7e55a359622cfc8826 (diff)
downloadsparse-dev-e22588735b2ed54a08d1b3fb593cc3a26afb320b.tar.gz
move liveness interface to its own header
Currently, the interface for liveness analysis is declared in the flow.h header file. There is no a real need to move it to its own file but it's the dual of the previous patch and help a bit to make the code structure clearer. Move the prototype for liveness analysis to its own header. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--flow.h4
-rw-r--r--liveness.c1
-rw-r--r--liveness.h11
-rw-r--r--optimize.c1
4 files changed, 13 insertions, 4 deletions
diff --git a/flow.h b/flow.h
index 8e96f62f..9a9260d9 100644
--- a/flow.h
+++ b/flow.h
@@ -41,10 +41,6 @@ void convert_load_instruction(struct instruction *, pseudo_t);
void rewrite_load_instruction(struct instruction *, struct pseudo_list *);
int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local);
-extern void clear_liveness(struct entrypoint *ep);
-extern void track_pseudo_liveness(struct entrypoint *ep);
-extern void track_pseudo_death(struct entrypoint *ep);
-
extern void vrfy_flow(struct entrypoint *ep);
extern int pseudo_in_list(struct pseudo_list *list, pseudo_t pseudo);
diff --git a/liveness.c b/liveness.c
index 42497965..25214b5e 100644
--- a/liveness.c
+++ b/liveness.c
@@ -7,6 +7,7 @@
#include <assert.h>
+#include "liveness.h"
#include "parse.h"
#include "expression.h"
#include "linearize.h"
diff --git a/liveness.h b/liveness.h
new file mode 100644
index 00000000..882167ce
--- /dev/null
+++ b/liveness.h
@@ -0,0 +1,11 @@
+#ifndef LIVENESS_H
+#define LIVENESS_H
+
+struct entrypoint;
+
+/* liveness.c */
+void clear_liveness(struct entrypoint *ep);
+void track_pseudo_liveness(struct entrypoint *ep);
+void track_pseudo_death(struct entrypoint *ep);
+
+#endif
diff --git a/optimize.c b/optimize.c
index 8cf24351..317d7d4d 100644
--- a/optimize.c
+++ b/optimize.c
@@ -7,6 +7,7 @@
#include "optimize.h"
#include "linearize.h"
+#include "liveness.h"
#include "flow.h"