From b91b31c12df168816702a5e58ecdc56031b27ef6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 9 Aug 2002 20:05:34 +0000 Subject: [PATCH] We are using std::vector, so remove extraneous namespace prefixes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3275 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelection.cpp | 15 +++++++-------- .../SparcV9/InstrSelection/InstrSelection.cpp | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp index e6e42b8e39c..d8f89813622 100644 --- a/lib/CodeGen/InstrSelection/InstrSelection.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp @@ -56,7 +56,7 @@ namespace { TargetMachine &Target; void InsertCodeForPhis(Function &F); void InsertPhiElimInstructions(BasicBlock *BB, - const std::vector& CpVec); + const vector& CpVec); void SelectInstructionsForTree(InstrTreeNode* treeRoot, int goalnt); void PostprocessMachineCodeForTree(InstructionNode* instrNode, int ruleForNode, short* nts); @@ -186,7 +186,7 @@ InstructionSelection::InsertCodeForPhis(Function &F) void InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB, - const std::vector& CpVec) + const vector& CpVec) { Instruction *TermInst = (Instruction*)BB->getTerminator(); MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst); @@ -248,7 +248,7 @@ InstructionSelection::SelectInstructionsForTree(InstrTreeNode* treeRoot, // if (treeRoot->opLabel != VRegListOp) { - std::vector minstrVec; + vector minstrVec; InstructionNode* instrNode = (InstructionNode*)treeRoot; assert(instrNode->getNodeType() == InstrTreeNode::NTInstructionNode); @@ -315,13 +315,12 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode, // Instruction* vmInstr = instrNode->getInstruction(); MachineCodeForInstruction &mvec = MachineCodeForInstruction::get(vmInstr); - for (int i = (int) mvec.size()-1; i >= 0; i--) + for (unsigned i = mvec.size(); i != 0; --i) { - std::vector loadConstVec = - FixConstantOperandsForInstr(vmInstr, mvec[i], Target); + vector loadConstVec = + FixConstantOperandsForInstr(vmInstr, mvec[i-1], Target); - if (loadConstVec.size() > 0) - mvec.insert(mvec.begin()+i, loadConstVec.begin(), loadConstVec.end()); + mvec.insert(mvec.begin()+i-1, loadConstVec.begin(), loadConstVec.end()); } } diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index e6e42b8e39c..d8f89813622 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -56,7 +56,7 @@ namespace { TargetMachine &Target; void InsertCodeForPhis(Function &F); void InsertPhiElimInstructions(BasicBlock *BB, - const std::vector& CpVec); + const vector& CpVec); void SelectInstructionsForTree(InstrTreeNode* treeRoot, int goalnt); void PostprocessMachineCodeForTree(InstructionNode* instrNode, int ruleForNode, short* nts); @@ -186,7 +186,7 @@ InstructionSelection::InsertCodeForPhis(Function &F) void InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB, - const std::vector& CpVec) + const vector& CpVec) { Instruction *TermInst = (Instruction*)BB->getTerminator(); MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst); @@ -248,7 +248,7 @@ InstructionSelection::SelectInstructionsForTree(InstrTreeNode* treeRoot, // if (treeRoot->opLabel != VRegListOp) { - std::vector minstrVec; + vector minstrVec; InstructionNode* instrNode = (InstructionNode*)treeRoot; assert(instrNode->getNodeType() == InstrTreeNode::NTInstructionNode); @@ -315,13 +315,12 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode, // Instruction* vmInstr = instrNode->getInstruction(); MachineCodeForInstruction &mvec = MachineCodeForInstruction::get(vmInstr); - for (int i = (int) mvec.size()-1; i >= 0; i--) + for (unsigned i = mvec.size(); i != 0; --i) { - std::vector loadConstVec = - FixConstantOperandsForInstr(vmInstr, mvec[i], Target); + vector loadConstVec = + FixConstantOperandsForInstr(vmInstr, mvec[i-1], Target); - if (loadConstVec.size() > 0) - mvec.insert(mvec.begin()+i, loadConstVec.begin(), loadConstVec.end()); + mvec.insert(mvec.begin()+i-1, loadConstVec.begin(), loadConstVec.end()); } }