mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Add and use a helper elements() to StructType. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f69d31727
commit
633e9689bf
@ -275,6 +275,10 @@ public:
|
|||||||
element_iterator element_begin() const { return ContainedTys; }
|
element_iterator element_begin() const { return ContainedTys; }
|
||||||
element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
|
element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
|
||||||
|
|
||||||
|
ArrayRef<Type *> const elements() const {
|
||||||
|
return ArrayRef<Type*>(&*element_begin(), getNumElements());
|
||||||
|
}
|
||||||
|
|
||||||
/// isLayoutIdentical - Return true if this is layout identical to the
|
/// isLayoutIdentical - Return true if this is layout identical to the
|
||||||
/// specified struct.
|
/// specified struct.
|
||||||
bool isLayoutIdentical(StructType *Other) const;
|
bool isLayoutIdentical(StructType *Other) const;
|
||||||
|
@ -104,9 +104,8 @@ struct AnonStructTypeKeyInfo {
|
|||||||
bool isPacked;
|
bool isPacked;
|
||||||
KeyTy(const ArrayRef<Type*>& E, bool P) :
|
KeyTy(const ArrayRef<Type*>& E, bool P) :
|
||||||
ETypes(E), isPacked(P) {}
|
ETypes(E), isPacked(P) {}
|
||||||
KeyTy(const StructType* ST) :
|
KeyTy(const StructType *ST)
|
||||||
ETypes(ArrayRef<Type*>(ST->element_begin(), ST->element_end())),
|
: ETypes(ST->elements()), isPacked(ST->isPacked()) {}
|
||||||
isPacked(ST->isPacked()) {}
|
|
||||||
bool operator==(const KeyTy& that) const {
|
bool operator==(const KeyTy& that) const {
|
||||||
if (isPacked != that.isPacked)
|
if (isPacked != that.isPacked)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user