[PATCH 20/29] sssa: add needed new members

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The incoming new method to construct the SSA needs
a few new members for pseudos, basic_blocks & symbols.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 linearize.h | 12 +++++++++++-
 symbol.h    |  1 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/linearize.h b/linearize.h
index a550035d3..30f34aa8f 100644
--- a/linearize.h
+++ b/linearize.h
@@ -6,6 +6,7 @@
 #include "token.h"
 #include "parse.h"
 #include "symbol.h"
+#include "ptrmap.h"
 
 struct instruction;
 DECLARE_PTR_LIST(pseudo_ptr_list, pseudo_t);
@@ -18,6 +19,7 @@ struct pseudo_user {
 DECLARE_ALLOCATOR(pseudo_user);
 DECLARE_PTR_LIST(pseudo_user_list, struct pseudo_user);
 
+DECLARE_PTRMAP(phi_map, struct basic_block *, pseudo_t);
 
 enum pseudo_type {
 	PSEUDO_VOID,
@@ -90,6 +92,7 @@ struct instruction {
 		};
 		struct /* phi_node */ {
 			struct pseudo_list *phi_list;
+			struct symbol *var;		/* SSSA only */
 		};
 		struct /* phi source */ {
 			pseudo_t phi_src;
@@ -231,7 +234,14 @@ struct basic_block {
 	struct basic_block_list *parents; /* sources */
 	struct basic_block_list *children; /* destinations */
 	struct instruction_list *insns;	/* Linear list of instructions */
-	struct pseudo_list *needs, *defines;
+	union {
+		struct {		// SSA construction
+			unsigned int sealed:1;
+		};
+		struct {		// liveness
+			struct pseudo_list *needs, *defines;
+		};
+	};
 	union {
 		unsigned int nr;	/* unique id for label's names */
 		void *priv;
diff --git a/symbol.h b/symbol.h
index 3f075c5bc..05a0d801c 100644
--- a/symbol.h
+++ b/symbol.h
@@ -184,6 +184,7 @@ struct symbol {
 			struct expression *initializer;
 			struct entrypoint *ep;
 			long long value;		/* Initial value */
+			struct phi_map *phi_map;
 			struct symbol *definition;
 		};
 	};
-- 
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux