@Override public void build() throws CFGBuilderException { InstructionList instructionList = methodGen.getInstructionList(); optimize(instructionList); topLevelSubroutine = new Subroutine(instructionList.getStart()); subroutineWorkList.add(topLevelSubroutine); // Build top level subroutine and all JSR subroutines while (!subroutineWorkList.isEmpty()) { Subroutine subroutine = subroutineWorkList.removeFirst(); if (DEBUG) { System.out.println("Starting subroutine " + subroutine.getStartInstruction()); } build(subroutine); } // Inline everything into the top level subroutine cfg = inlineAll(); // Add a NOP instruction to the entry block. // This allows analyses to construct a Location // representing the entry to the method. BasicBlock entryBlock = cfg.getEntry(); InstructionList il = new InstructionList(); entryBlock.addInstruction(il.append(new NOP())); if (VERIFY_INTEGRITY) { cfg.checkIntegrity(); } if (true) { cfg.checkIntegrity(); } }
@Override public void build() throws CFGBuilderException { InstructionList instructionList = methodGen.getInstructionList(); optimize(instructionList); topLevelSubroutine = new Subroutine(instructionList.getStart()); subroutineWorkList.add(topLevelSubroutine); // Build top level subroutine and all JSR subroutines while (!subroutineWorkList.isEmpty()) { Subroutine subroutine = subroutineWorkList.removeFirst(); if (DEBUG) { System.out.println("Starting subroutine " + subroutine.getStartInstruction()); } build(subroutine); } // Inline everything into the top level subroutine cfg = inlineAll(); // Add a NOP instruction to the entry block. // This allows analyses to construct a Location // representing the entry to the method. BasicBlock entryBlock = cfg.getEntry(); InstructionList il = new InstructionList(); entryBlock.addInstruction(il.append(new NOP())); if (VERIFY_INTEGRITY) { cfg.checkIntegrity(); } if (true) { cfg.checkIntegrity(); } }