mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
add iteration support to TinyPtrVector for clang's use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
840635741f
commit
79976a4072
@ -58,6 +58,28 @@ public:
|
||||
return Val. template get<VecTy*>()->size();
|
||||
}
|
||||
|
||||
typedef const EltTy *iterator;
|
||||
iterator begin() const {
|
||||
if (empty())
|
||||
return 0;
|
||||
|
||||
if (Val.template is<EltTy>())
|
||||
return Val.template getAddrOf<EltTy>();
|
||||
|
||||
return Val.template get<VecTy *>()->begin();
|
||||
|
||||
}
|
||||
iterator end() const {
|
||||
if (empty())
|
||||
return 0;
|
||||
|
||||
if (Val.template is<EltTy>())
|
||||
return begin() + 1;
|
||||
|
||||
return Val.template get<VecTy *>()->end();
|
||||
}
|
||||
|
||||
|
||||
EltTy operator[](unsigned i) const {
|
||||
assert(!Val.isNull() && "can't index into an empty vector");
|
||||
if (EltTy V = Val.template dyn_cast<EltTy>()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user