projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add and use a helper elements() to StructType. NFC.
[oota-llvm.git]
/
include
/
llvm
/
IR
/
DerivedTypes.h
diff --git
a/include/llvm/IR/DerivedTypes.h
b/include/llvm/IR/DerivedTypes.h
index 534d1e54160c60ff3212b1e3c16815264312bad3..175d45afdfcefac0075ee7ff01986ab9b9ab56cf 100644
(file)
--- a/
include/llvm/IR/DerivedTypes.h
+++ b/
include/llvm/IR/DerivedTypes.h
@@
-275,6
+275,10
@@
public:
element_iterator element_begin() const { return ContainedTys; }
element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
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;
/// isLayoutIdentical - Return true if this is layout identical to the
/// specified struct.
bool isLayoutIdentical(StructType *Other) const;