mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
DIBuilder: Extract header_begin() and header_end(), NFC
Use begin/end functions so that users don't need to know how these weird things work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc19b2fb2e
commit
db5a7969ce
@ -200,13 +200,16 @@ public:
|
||||
DIHeaderFieldIterator());
|
||||
}
|
||||
|
||||
DIHeaderFieldIterator header_begin() const { return getHeader(); }
|
||||
DIHeaderFieldIterator header_end() const { return StringRef(); }
|
||||
|
||||
DIHeaderFieldIterator getHeaderIterator(unsigned Index) const {
|
||||
// Since callers expect an empty string for out-of-range accesses, we can't
|
||||
// use std::advance() here.
|
||||
for (DIHeaderFieldIterator I(getHeader()), E; I != E; ++I, --Index)
|
||||
for (auto I = header_begin(), E = header_end(); I != E; ++I, --Index)
|
||||
if (!Index)
|
||||
return I;
|
||||
return StringRef();
|
||||
return header_end();
|
||||
}
|
||||
|
||||
StringRef getHeaderField(unsigned Index) const {
|
||||
@ -888,8 +891,7 @@ class DIExpressionIterator
|
||||
DIExpressionIterator(DIHeaderFieldIterator I) : I(I) {}
|
||||
public:
|
||||
DIExpressionIterator() {}
|
||||
DIExpressionIterator(const DIExpression Expr)
|
||||
: I(Expr.getHeader()) { ++I; }
|
||||
DIExpressionIterator(const DIExpression &Expr) : I(++Expr.header_begin()) {}
|
||||
uint64_t operator*() const { return I.getNumber<uint64_t>(); }
|
||||
DIExpressionIterator &operator++() {
|
||||
increment();
|
||||
|
Loading…
x
Reference in New Issue
Block a user