From 76d3520f3e2d9c3ff306155a32ddedfcfa26ad16 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Mon, 30 Jul 2001 18:48:43 +0000 Subject: [PATCH] Record machine instructions in the vector for each basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelection.cpp | 14 ++++++++++++++ .../SparcV9/InstrSelection/InstrSelection.cpp | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp index 9cc054ca4de..4b389b732ce 100644 --- a/lib/CodeGen/InstrSelection/InstrSelection.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp @@ -96,6 +96,20 @@ bool SelectInstructionsForMethod(Method* method, TargetMachine &Target) { 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; } diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index 9cc054ca4de..4b389b732ce 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -96,6 +96,20 @@ bool SelectInstructionsForMethod(Method* method, TargetMachine &Target) { 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; } -- 2.34.1