mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Replace linear search with logrithmic one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e7ea48cb61
commit
2787e03d0e
@ -443,10 +443,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
|
||||
case Type::StructTyID: {
|
||||
const StructType *STy = cast<StructType>(SubType);
|
||||
const StructLayout &SL = *TD.getStructLayout(STy);
|
||||
|
||||
unsigned i = 0, e = SL.MemberOffsets.size();
|
||||
for (; i+1 < e && SL.MemberOffsets[i+1] <= Offset-O; ++i)
|
||||
/* empty */;
|
||||
unsigned i = SL.getElementContainingOffset(Offset-O);
|
||||
|
||||
// The offset we are looking for must be in the i'th element...
|
||||
SubType = STy->getElementType(i);
|
||||
|
Loading…
Reference in New Issue
Block a user