aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.h
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-26 06:42:39 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-01 00:18:44 +0200
commit8cc064e5c87bdebbdf6528cf77dd4a4ad6161fa2 (patch)
treec1dbf562c2815572c7c6aeba58a9df975fd5a87e /linearize.h
parentd64adff1bac01dbb9c574655540328be434779f6 (diff)
downloadsparse-dev-8cc064e5c87bdebbdf6528cf77dd4a4ad6161fa2.tar.gz
graph: build the CFG reverse postorder traversal
Do a DFS on the CFG and record the (reverse) postorder. Use this order for the normal BB traversal (ep->bbs). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.h')
-rw-r--r--linearize.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/linearize.h b/linearize.h
index 092e1ac2..c52c6ca5 100644
--- a/linearize.h
+++ b/linearize.h
@@ -265,7 +265,10 @@ struct instruction_list;
struct basic_block {
struct position pos;
unsigned long generation;
- int context;
+ union {
+ int context;
+ int postorder_nr; /* postorder number */
+ };
struct entrypoint *ep;
struct basic_block_list *parents; /* sources */
struct basic_block_list *children; /* destinations */