git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242100
91177308-0d34-0410-b5e6-
96231b3b80d8
bool hasSymbolTable() const;
child_iterator getSymbolTableChild() const { return SymbolTable; }
bool hasSymbolTable() const;
child_iterator getSymbolTableChild() const { return SymbolTable; }
+ StringRef getSymbolTable() const { return SymbolTable->getBuffer(); }
uint32_t getNumberOfSymbols() const;
private:
uint32_t getNumberOfSymbols() const;
private:
}
StringRef Archive::Symbol::getName() const {
}
StringRef Archive::Symbol::getName() const {
- return Parent->SymbolTable->getBuffer().begin() + StringIndex;
+ return Parent->getSymbolTable().begin() + StringIndex;
}
ErrorOr<Archive::child_iterator> Archive::Symbol::getMember() const {
}
ErrorOr<Archive::child_iterator> Archive::Symbol::getMember() const {
- const char *Buf = Parent->SymbolTable->getBuffer().begin();
+ const char *Buf = Parent->getSymbolTable().begin();
const char *Offsets = Buf;
if (Parent->kind() == K_MIPS64)
Offsets += sizeof(uint64_t);
const char *Offsets = Buf;
if (Parent->kind() == K_MIPS64)
Offsets += sizeof(uint64_t);
// and the second being the offset into the archive of the member that
// define the symbol. After that the next uint32_t is the byte count of
// the string table followed by the string table.
// and the second being the offset into the archive of the member that
// define the symbol. After that the next uint32_t is the byte count of
// the string table followed by the string table.
- const char *Buf = Parent->SymbolTable->getBuffer().begin();
+ const char *Buf = Parent->getSymbolTable().begin();
uint32_t RanlibCount = 0;
RanlibCount = read32le(Buf) / 8;
// If t.SymbolIndex + 1 will be past the count of symbols (the RanlibCount)
uint32_t RanlibCount = 0;
RanlibCount = read32le(Buf) / 8;
// If t.SymbolIndex + 1 will be past the count of symbols (the RanlibCount)
}
} else {
// Go to one past next null.
}
} else {
// Go to one past next null.
- t.StringIndex =
- Parent->SymbolTable->getBuffer().find('\0', t.StringIndex) + 1;
+ t.StringIndex = Parent->getSymbolTable().find('\0', t.StringIndex) + 1;
}
++t.SymbolIndex;
return t;
}
++t.SymbolIndex;
return t;
if (!hasSymbolTable())
return symbol_iterator(Symbol(this, 0, 0));
if (!hasSymbolTable())
return symbol_iterator(Symbol(this, 0, 0));
- const char *buf = SymbolTable->getBuffer().begin();
+ const char *buf = getSymbolTable().begin();
if (kind() == K_GNU) {
uint32_t symbol_count = 0;
symbol_count = read32be(buf);
if (kind() == K_GNU) {
uint32_t symbol_count = 0;
symbol_count = read32be(buf);
symbol_count = read32le(buf);
buf += 4 + (symbol_count * 2); // Skip indices.
}
symbol_count = read32le(buf);
buf += 4 + (symbol_count * 2); // Skip indices.
}
- uint32_t string_start_offset = buf - SymbolTable->getBuffer().begin();
+ uint32_t string_start_offset = buf - getSymbolTable().begin();
return symbol_iterator(Symbol(this, 0, string_start_offset));
}
return symbol_iterator(Symbol(this, 0, string_start_offset));
}
}
uint32_t Archive::getNumberOfSymbols() const {
}
uint32_t Archive::getNumberOfSymbols() const {
- const char *buf = SymbolTable->getBuffer().begin();
+ const char *buf = getSymbolTable().begin();
if (kind() == K_GNU)
return read32be(buf);
if (kind() == K_MIPS64)
if (kind() == K_GNU)
return read32be(buf);
if (kind() == K_MIPS64)