mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
speed up the verifier 8.5% by using a smallvector instead of vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
78287b400a
commit
8552faeb7e
@ -57,6 +57,7 @@
|
|||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
@ -809,11 +810,13 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||||
|
SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
|
||||||
const Type *ElTy =
|
const Type *ElTy =
|
||||||
GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
|
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);
|
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);
|
"GEP is not of right type for indices!", &GEP, ElTy);
|
||||||
visitInstruction(GEP);
|
visitInstruction(GEP);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user