def optimize(): """ Load the necessary files, instantiate each optimization class. """ global PARSE_FOLDER, input_folder, input_file if PARSE_FOLDER: for subdirectories, directories, files in os.walk(input_folder): for file in files: if BE_VERBOSE: print "Optimizing: ", file print "----------" parseAndStore(blockBuilder(input_folder + "/" + file)) else: if BE_VERBOSE: print "Optimizing: ", input_file print "----------" parseAndStore(blockBuilder(input_folder + "/" + input_file))
from blockBuilder import * b = blockBuilder("O0/acron.s") b.analyze() if (len(b.exceptions) > 0): print "Error: exceptions!" for e in b.exceptions: print "\t" + str(e) for block in b.basicBlocks: if len(block.operations) < 1: print "Error! block without code!" print "\t@line" + str(block.startLine)