llvm.org GIT mirror llvm / 5861893
Object: constize Archive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141448 91177308-0d34-0410-b5e6-96231b3b80d8 Michael J. Spencer 8 years ago
2 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
2323 class Archive : public Binary {
2424 public:
2525 class Child {
26 Archive *Parent;
26 const Archive *Parent;
2727 StringRef Data;
2828
2929 public:
30 Child(Archive *p, StringRef d) : Parent(p), Data(d) {}
30 Child(const Archive *p, StringRef d) : Parent(p), Data(d) {}
3131
3232 bool operator ==(const Child &other) const {
3333 return (Parent == other.Parent) && (Data.begin() == other.Data.begin());
7070
7171 Archive(MemoryBuffer *source, error_code &ec);
7272
73 child_iterator begin_children();
74 child_iterator end_children();
73 child_iterator begin_children() const;
74 child_iterator end_children() const;
7575
7676 // Cast methods.
7777 static inline bool classof(Archive const *v) { return true; }
155155 ec = object_error::success;
156156 }
157157
158 Archive::child_iterator Archive::begin_children() {
158 Archive::child_iterator Archive::begin_children() const {
159159 const char *Loc = Data->getBufferStart() + Magic.size();
160160 size_t Size = sizeof(ArchiveMemberHeader) +
161161 ToHeader(Loc)->getSize();
162162 return Child(this, StringRef(Loc, Size));
163163 }
164164
165 Archive::child_iterator Archive::end_children() {
165 Archive::child_iterator Archive::end_children() const {
166166 return Child(this, StringRef(0, 0));
167167 }
168168