|
@@ -316,6 +316,12 @@ def simplify_values(entry_point):
|
|
|
definition.redefine(
|
|
|
cfg_ir.Literal(
|
|
|
eval('%r %s %r' % (lhs.literal, def_val.operator, rhs.literal))))
|
|
|
+ elif isinstance(def_val, cfg_ir.Unary):
|
|
|
+ operand = cfg_ir.get_def_value(def_val.operand)
|
|
|
+ if isinstance(operand, cfg_ir.Literal):
|
|
|
+ definition.redefine(
|
|
|
+ cfg_ir.Literal(
|
|
|
+ eval('%s %r' % (def_val.operator, operand.literal))))
|
|
|
|
|
|
def inline_constants(entry_point):
|
|
|
"""Replaces reads of constant nodes by the literals they contain."""
|