Record machine instructions in the vector for each basic block.
llvm-svn: 331
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
index 9cc054c..4b389b7 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -96,6 +96,20 @@
PrintMachineInstructions(method);
}
+ //
+ // Record instructions in the vector for each basic block
+ //
+ for (Method::iterator BI = method->begin(); BI != method->end(); ++BI)
+ {
+ MachineCodeForBasicBlock& bbMvec = (*BI)->getMachineInstrVec();
+ for (BasicBlock::iterator II = (*BI)->begin(); II != (*BI)->end(); ++II)
+ {
+ MachineCodeForVMInstr& mvec = (*II)->getMachineInstrVec();
+ for (unsigned i=0; i < mvec.size(); i++)
+ bbMvec.push_back(mvec[i]);
+ }
+ }
+
return false;
}