mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
Add and use a helper elements() to StructType. NFC.
llvm-svn: 222553
This commit is contained in:
parent
cfe609e473
commit
798ac6c06b
@ -275,6 +275,10 @@ public:
|
||||
element_iterator element_begin() const { return ContainedTys; }
|
||||
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
|
||||
/// specified struct.
|
||||
bool isLayoutIdentical(StructType *Other) const;
|
||||
|
@ -104,9 +104,8 @@ struct AnonStructTypeKeyInfo {
|
||||
bool isPacked;
|
||||
KeyTy(const ArrayRef<Type*>& E, bool P) :
|
||||
ETypes(E), isPacked(P) {}
|
||||
KeyTy(const StructType* ST) :
|
||||
ETypes(ArrayRef<Type*>(ST->element_begin(), ST->element_end())),
|
||||
isPacked(ST->isPacked()) {}
|
||||
KeyTy(const StructType *ST)
|
||||
: ETypes(ST->elements()), isPacked(ST->isPacked()) {}
|
||||
bool operator==(const KeyTy& that) const {
|
||||
if (isPacked != that.isPacked)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user