convert some vectors to smallvector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-02-10 08:33:11 +00:00
parent 8552faeb7e
commit f8edb62e22

View File

@ -396,7 +396,8 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
// Check constraints that this basic block imposes on all of the PHI nodes in
// it.
if (isa<PHINode>(BB.front())) {
std::vector<BasicBlock*> Preds(pred_begin(&BB), pred_end(&BB));
SmallVector<BasicBlock*, 8> Preds(pred_begin(&BB), pred_end(&BB));
SmallVector<std::pair<BasicBlock*, Value*>, 8> Values;
std::sort(Preds.begin(), Preds.end());
PHINode *PN;
for (BasicBlock::iterator I = BB.begin(); (PN = dyn_cast<PHINode>(I));++I) {
@ -410,7 +411,7 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
"parent basic block!", PN);
// Get and sort all incoming values in the PHI node...
std::vector<std::pair<BasicBlock*, Value*> > Values;
Values.clear();
Values.reserve(PN->getNumIncomingValues());
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
Values.push_back(std::make_pair(PN->getIncomingBlock(i),