Make computeSymbolSizes never fail.

On ELF that was already the case since getting the size of a symbol
never fails.

On MachO and COFF we could fail trying to get the section of a symbol. But
we don't really need the section, just the section number to know if two
symbols are in the same section or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-06-24 19:57:32 +00:00
parent c9a4f3d5d9
commit a3af347f38
8 changed files with 54 additions and 24 deletions

View File

@ -188,12 +188,10 @@ static void dumpCXXData(const ObjectFile *Obj) {
uint8_t BytesInAddress = Obj->getBytesInAddress();
ErrorOr<std::vector<std::pair<SymbolRef, uint64_t>>> SymAddrOrErr =
std::vector<std::pair<SymbolRef, uint64_t>> SymAddr =
object::computeSymbolSizes(*Obj);
if (error(SymAddrOrErr.getError()))
return;
for (auto &P : *SymAddrOrErr) {
for (auto &P : SymAddr) {
object::SymbolRef Sym = P.first;
uint64_t SymSize = P.second;
StringRef SymName;