1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

speed up the verifier 8.5% by using a smallvector instead of vector.

llvm-svn: 34144
This commit is contained in:
Chris Lattner 2007-02-10 08:30:29 +00:00
parent a0792c722e
commit 8eb2002881

View File

@ -57,6 +57,7 @@
#include "llvm/Support/InstVisitor.h"
#include "llvm/Support/Streams.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Compiler.h"
@ -809,11 +810,13 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) {
}
void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
const Type *ElTy =
GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
std::vector<Value*>(GEP.idx_begin(), GEP.idx_end()), true);
&Idxs[0], Idxs.size(), true);
Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP);
Assert2(PointerType::get(ElTy) == GEP.getType(),
Assert2(isa<PointerType>(GEP.getType()) &&
cast<PointerType>(GEP.getType())->getElementType() == ElTy,
"GEP is not of right type for indices!", &GEP, ElTy);
visitInstruction(GEP);
}