diff options
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
| -rw-r--r-- | lib/Bytecode/Writer/Writer.cpp | 18 | 
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index 9c9e1abcdd..7fa22b8101 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -225,9 +225,13 @@ void BytecodeWriter::outputFunction(const Function *F) {      // Output information about the constants in the function...      outputConstants(true); -    // Output basic block nodes... -    for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I) -      processBasicBlock(*I); +    {  // Output all of the instructions in the body of the function +      BytecodeBlock ILBlock(BytecodeFormat::InstructionList, Out); + +      for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E;++BB) +        for(BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I) +          processInstruction(*I); +    }      // If needed, output the symbol table for the function...      outputSymbolTable(F->getSymbolTable()); @@ -236,14 +240,6 @@ void BytecodeWriter::outputFunction(const Function *F) {    }  } - -void BytecodeWriter::processBasicBlock(const BasicBlock &BB) { -  BytecodeBlock FunctionBlock(BytecodeFormat::BasicBlock, Out); -  // Process all the instructions in the bb... -  for(BasicBlock::const_iterator I = BB.begin(), E = BB.end(); I != E; ++I) -    processInstruction(*I); -} -  void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {    BytecodeBlock FunctionBlock(BytecodeFormat::SymbolTable, Out);  | 
