mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
These vectors are frequently large. Use std::vector instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -52,12 +52,12 @@ namespace {
|
|||||||
|
|
||||||
/// BBSizes - The size of each MachineBasicBlock in bytes of code, indexed
|
/// BBSizes - The size of each MachineBasicBlock in bytes of code, indexed
|
||||||
/// by MBB Number.
|
/// by MBB Number.
|
||||||
SmallVector<unsigned, 8> BBSizes;
|
std::vector<unsigned> BBSizes;
|
||||||
|
|
||||||
/// WaterList - A sorted list of basic blocks where islands could be placed
|
/// WaterList - A sorted list of basic blocks where islands could be placed
|
||||||
/// (i.e. blocks that don't fall through to the following block, due
|
/// (i.e. blocks that don't fall through to the following block, due
|
||||||
/// to a return, unreachable, or unconditional branch).
|
/// to a return, unreachable, or unconditional branch).
|
||||||
SmallVector<MachineBasicBlock*, 8> WaterList;
|
std::vector<MachineBasicBlock*> WaterList;
|
||||||
|
|
||||||
/// CPUser - One user of a constant pool, keeping the machine instruction
|
/// CPUser - One user of a constant pool, keeping the machine instruction
|
||||||
/// pointer, the constant pool being referenced, and the max displacement
|
/// pointer, the constant pool being referenced, and the max displacement
|
||||||
@@ -72,7 +72,7 @@ namespace {
|
|||||||
|
|
||||||
/// CPUsers - Keep track of all of the machine instructions that use various
|
/// CPUsers - Keep track of all of the machine instructions that use various
|
||||||
/// constant pools and their max displacement.
|
/// constant pools and their max displacement.
|
||||||
SmallVector<CPUser, 16> CPUsers;
|
std::vector<CPUser> CPUsers;
|
||||||
|
|
||||||
/// CPEntry - One per constant pool entry, keeping the machine instruction
|
/// CPEntry - One per constant pool entry, keeping the machine instruction
|
||||||
/// pointer, the constpool index, and the number of CPUser's which
|
/// pointer, the constpool index, and the number of CPUser's which
|
||||||
@@ -104,7 +104,7 @@ namespace {
|
|||||||
|
|
||||||
/// Branches - Keep track of all the immediate branch instructions.
|
/// Branches - Keep track of all the immediate branch instructions.
|
||||||
///
|
///
|
||||||
SmallVector<ImmBranch, 32> ImmBranches;
|
std::vector<ImmBranch> ImmBranches;
|
||||||
|
|
||||||
/// PushPopMIs - Keep track of all the Thumb push / pop instructions.
|
/// PushPopMIs - Keep track of all the Thumb push / pop instructions.
|
||||||
///
|
///
|
||||||
@@ -125,10 +125,10 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void DoInitialPlacement(MachineFunction &Fn,
|
void DoInitialPlacement(MachineFunction &Fn,
|
||||||
SmallVector<MachineInstr*, 16> &CPEMIs);
|
std::vector<MachineInstr*> &CPEMIs);
|
||||||
CPEntry *findConstPoolEntry(unsigned CPI, const MachineInstr *CPEMI);
|
CPEntry *findConstPoolEntry(unsigned CPI, const MachineInstr *CPEMI);
|
||||||
void InitialFunctionScan(MachineFunction &Fn,
|
void InitialFunctionScan(MachineFunction &Fn,
|
||||||
const SmallVector<MachineInstr*, 16> &CPEMIs);
|
const std::vector<MachineInstr*> &CPEMIs);
|
||||||
MachineBasicBlock *SplitBlockBeforeInstr(MachineInstr *MI);
|
MachineBasicBlock *SplitBlockBeforeInstr(MachineInstr *MI);
|
||||||
void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB);
|
void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB);
|
||||||
bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U);
|
bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U);
|
||||||
@@ -164,7 +164,7 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
|
|
||||||
// Perform the initial placement of the constant pool entries. To start with,
|
// Perform the initial placement of the constant pool entries. To start with,
|
||||||
// we put them all at the end of the function.
|
// we put them all at the end of the function.
|
||||||
SmallVector<MachineInstr*, 16> CPEMIs;
|
std::vector<MachineInstr*> CPEMIs;
|
||||||
if (!MCP.isEmpty())
|
if (!MCP.isEmpty())
|
||||||
DoInitialPlacement(Fn, CPEMIs);
|
DoInitialPlacement(Fn, CPEMIs);
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
/// DoInitialPlacement - Perform the initial placement of the constant pool
|
/// DoInitialPlacement - Perform the initial placement of the constant pool
|
||||||
/// entries. To start with, we put them all at the end of the function.
|
/// entries. To start with, we put them all at the end of the function.
|
||||||
void ARMConstantIslands::DoInitialPlacement(MachineFunction &Fn,
|
void ARMConstantIslands::DoInitialPlacement(MachineFunction &Fn,
|
||||||
SmallVector<MachineInstr*, 16> &CPEMIs){
|
std::vector<MachineInstr*> &CPEMIs){
|
||||||
// Create the basic block to hold the CPE's.
|
// Create the basic block to hold the CPE's.
|
||||||
MachineBasicBlock *BB = new MachineBasicBlock();
|
MachineBasicBlock *BB = new MachineBasicBlock();
|
||||||
Fn.getBasicBlockList().push_back(BB);
|
Fn.getBasicBlockList().push_back(BB);
|
||||||
@@ -276,7 +276,7 @@ ARMConstantIslands::CPEntry
|
|||||||
/// information about the sizes of each block, the location of all the water,
|
/// information about the sizes of each block, the location of all the water,
|
||||||
/// and finding all of the constant pool users.
|
/// and finding all of the constant pool users.
|
||||||
void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
|
void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
|
||||||
const SmallVector<MachineInstr*, 16> &CPEMIs) {
|
const std::vector<MachineInstr*> &CPEMIs) {
|
||||||
for (MachineFunction::iterator MBBI = Fn.begin(), E = Fn.end();
|
for (MachineFunction::iterator MBBI = Fn.begin(), E = Fn.end();
|
||||||
MBBI != E; ++MBBI) {
|
MBBI != E; ++MBBI) {
|
||||||
MachineBasicBlock &MBB = *MBBI;
|
MachineBasicBlock &MBB = *MBBI;
|
||||||
@@ -460,7 +460,7 @@ void ARMConstantIslands::UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB) {
|
|||||||
|
|
||||||
// Next, update WaterList. Specifically, we need to add NewMBB as having
|
// Next, update WaterList. Specifically, we need to add NewMBB as having
|
||||||
// available water after it.
|
// available water after it.
|
||||||
SmallVector<MachineBasicBlock*, 8>::iterator IP =
|
std::vector<MachineBasicBlock*>::iterator IP =
|
||||||
std::lower_bound(WaterList.begin(), WaterList.end(), NewBB,
|
std::lower_bound(WaterList.begin(), WaterList.end(), NewBB,
|
||||||
CompareMBBNumbers);
|
CompareMBBNumbers);
|
||||||
WaterList.insert(IP, NewBB);
|
WaterList.insert(IP, NewBB);
|
||||||
|
Reference in New Issue
Block a user