From 52c87a2468ce235717a13e31f65cdf32683bf430 Mon Sep 17 00:00:00 2001 From: Caroline Leman Date: Tue, 28 Apr 2015 15:37:32 +0200 Subject: IR: Improve dead code elimination Dead code analysis computed using Ken Kennedy Algorithm Ref: A survey of data flow analysis techniques, IBM Thomas J. Watson Research Division, 1979 --- miasm2/expression/expression.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'miasm2/expression/expression.py') diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index 154da7cc..2b51ef61 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -152,6 +152,11 @@ class Expr(object): def get_w(self): return self.arg.get_w() + def is_function_call(self): + """Returns true if the considered Expr is a function call + """ + return False + def __repr__(self): if self._repr is None: self._repr = self._exprrepr() @@ -512,6 +517,9 @@ class ExprAff(Expr): else: return self._dst.get_w() + def is_function_call(self): + return isinstance(self.src, ExprOp) and self.src.op.startswith('call') + def _exprhash(self): return hash((EXPRAFF, hash(self._dst), hash(self._src))) -- cgit 1.4.1