From fa21ae52f0bec619c6de193c45e5f67f7ef5cf10 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 24 Jun 2015 19:32:52 +0000 Subject: [PATCH] Use Symbol::getValue to simplify object::computeSymbolSizes. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240575 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/SymbolSize.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Object/SymbolSize.cpp b/lib/Object/SymbolSize.cpp index 925a3d4df46..2da71f1fa24 100644 --- a/lib/Object/SymbolSize.cpp +++ b/lib/Object/SymbolSize.cpp @@ -53,13 +53,11 @@ llvm::object::computeSymbolSizes(const ObjectFile &O) { unsigned SymNum = 0; for (symbol_iterator I = O.symbol_begin(), E = O.symbol_end(); I != E; ++I) { SymbolRef Sym = *I; - uint64_t Address; - if (std::error_code EC = Sym.getAddress(Address)) - return EC; + uint64_t Value = Sym.getValue(); section_iterator SecI = O.section_end(); if (std::error_code EC = Sym.getSection(SecI)) return EC; - Addresses.push_back({I, Address, SymNum, *SecI}); + Addresses.push_back({I, Value, SymNum, *SecI}); ++SymNum; } for (const SectionRef Sec : O.sections()) {