Changeset 555 for proto


Ignore:
Timestamp:
Jul 30, 2010, 10:56:49 AM (9 years ago)
Author:
eamiri
Message:

a bug in dead code elimination fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/py2bitexpr.py

    r545 r555  
    313313    field_info = get_update_details(callee, ret_list)
    314314    return field_info
    315 
    316315
    317316def generate_expanded_code(loc):
     
    454453                        e1 = translate(ast_expr.args[1])
    455454                        return bitexpr.make_and(bitexpr.make_add(e0, e1), bitexpr.make_not(e1))
    456                 else: 
     455                else:
    457456                    raise PyBitError("Bad PyBit function call: %s\n" % ast.dump(ast_expr))
    458457        elif isinstance(ast_expr, ast.Compare):
     
    462461                else:   raise PyBitError("Bad condition in while loop: %s\n" % ast.dump(ast_expr))
    463462               
    464         else: 
     463        else:
    465464            raise PyBitError("Unknown expression %s\n" % ast.dump(ast_expr))
    466465
     
    587586            assert(1==0)
    588587    return table
     588
    589589##################################################################################
    590590def get_line(code, line):
     
    11991199def check_loc(loc, must_liv):
    12001200
    1201     effective_name = get_effective_name(loc.LHS.varname)
     1201    #effective_name = get_effective_name(loc.LHS.varname)
     1202    effective_name = loc.LHS.varname
    12021203    if effective_name in must_liv or loc.LHS.varname in must_liv:
    12031204        if isinstance(loc.RHS, bitexpr.Not):
     
    12771278        new_alives, bb = remove_dead(tree[first:], must_live)
    12781279        last = first
    1279 
    12801280    elif isinstance(tree[-1], bitexpr.If):
    12811281        new_alives, tree[-1].true_branch = eliminate_dead_code(tree[-1].true_branch, must_live)
     
    14561456## ***Changes needed here are the same as Pass 7 and Pass 10***
    14571457#################################################################################################################
    1458 
    14591458def generate_condition(expr):
    14601459    if isinstance(expr, bitexpr.isAllZero):
Note: See TracChangeset for help on using the changeset viewer.