about summary refs log tree commit diff stats
path: root/example/expression
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2015-12-04 18:46:48 +0100
committerAjax <commial@gmail.com>2015-12-07 11:15:43 +0100
commit308a634b7c2c20692e85f5b72178e00d072b7bcd (patch)
tree3e091aef76acdf18d6592c2a058345d87489227b /example/expression
parent42d4998c1646e48fd9cb150d1aa0e9970b5717c8 (diff)
downloadmiasm-308a634b7c2c20692e85f5b72178e00d072b7bcd.tar.gz
miasm-308a634b7c2c20692e85f5b72178e00d072b7bcd.zip
IR: replace `.g` with a lazy built `.graph`, avoiding the need of `gen_graph`
Diffstat (limited to 'example/expression')
-rw-r--r--example/expression/asm_to_ir.py7
-rw-r--r--example/expression/get_read_write.py5
-rw-r--r--example/expression/graph_dataflow.py1
3 files changed, 4 insertions, 9 deletions
diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py
index 3ed59ffe..2f8999a4 100644
--- a/example/expression/asm_to_ir.py
+++ b/example/expression/asm_to_ir.py
@@ -45,13 +45,10 @@ for lbl, b in ir_arch.blocs.items():
     print b
 
 # Dead propagation
-ir_arch.gen_graph()
-out = ir_arch.graph()
-open('graph.dot', 'w').write(out)
+open('graph.dot', 'w').write(ir_arch.graph.dot())
 print '*' * 80
 ir_arch.dead_simp()
-out2 = ir_arch.graph()
-open('graph2.dot', 'w').write(out2)
+open('graph2.dot', 'w').write(ir_arch.graph.dot())
 
 # Display new IR
 print 'new ir blocs'
diff --git a/example/expression/get_read_write.py b/example/expression/get_read_write.py
index f0f48015..d98b461a 100644
--- a/example/expression/get_read_write.py
+++ b/example/expression/get_read_write.py
@@ -21,6 +21,5 @@ for lbl, b in ir_arch.blocs.items():
         print 'read:   ', [str(x) for x in o_r]
         print 'written:', [str(x) for x in o_w]
         print
-ir_arch.gen_graph()
-g = ir_arch.graph()
-open('graph_instr.dot', 'w').write(g)
+
+open('graph_instr.dot', 'w').write(ir_arch.graph.dot())
diff --git a/example/expression/graph_dataflow.py b/example/expression/graph_dataflow.py
index e263a40e..64801e52 100644
--- a/example/expression/graph_dataflow.py
+++ b/example/expression/graph_dataflow.py
@@ -114,7 +114,6 @@ def gen_bloc_data_flow_graph(ir_arch, ad, block_flow_cb):
     for irbloc in ir_arch.blocs.values():
         print irbloc
 
-    ir_arch.gen_graph()
     ir_arch.dead_simp()
 
     irbloc_0 = None