mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Replace linear search with logrithmic one.
llvm-svn: 20580
This commit is contained in:
parent
112de16cf5
commit
55e0a19572
@ -443,10 +443,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
|
|||||||
case Type::StructTyID: {
|
case Type::StructTyID: {
|
||||||
const StructType *STy = cast<StructType>(SubType);
|
const StructType *STy = cast<StructType>(SubType);
|
||||||
const StructLayout &SL = *TD.getStructLayout(STy);
|
const StructLayout &SL = *TD.getStructLayout(STy);
|
||||||
|
unsigned i = SL.getElementContainingOffset(Offset-O);
|
||||||
unsigned i = 0, e = SL.MemberOffsets.size();
|
|
||||||
for (; i+1 < e && SL.MemberOffsets[i+1] <= Offset-O; ++i)
|
|
||||||
/* empty */;
|
|
||||||
|
|
||||||
// The offset we are looking for must be in the i'th element...
|
// The offset we are looking for must be in the i'th element...
|
||||||
SubType = STy->getElementType(i);
|
SubType = STy->getElementType(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user