diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-25 20:26:40 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-25 20:26:40 +0000 |
commit | 53046f3c5f5a747bfcb4e5700ed5e3b5b2506afe (patch) | |
tree | e71eed64d16215e996328c7be548262d7f03a2a5 | |
parent | ec944ceaf5eeb4b16bf1798dc958c0d90090e52f (diff) | |
download | llvm-53046f3c5f5a747bfcb4e5700ed5e3b5b2506afe.tar.gz llvm-53046f3c5f5a747bfcb4e5700ed5e3b5b2506afe.tar.bz2 llvm-53046f3c5f5a747bfcb4e5700ed5e3b5b2506afe.tar.xz |
tools: inline simple single-use function
This inlines the single use function in preparation for splitting the Win64EH
printing out of the COFFDumper into its own entity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209605 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/llvm-readobj/COFFDumper.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index 9f00fe1984..1a360f5bed 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -171,22 +171,6 @@ static unsigned getNumUsedSlots(const UnwindCode &UnwindCode) { } } -// Given a symbol sym this functions returns the address and section of it. -static error_code resolveSectionAndAddress(const COFFObjectFile *Obj, - const SymbolRef &Sym, - const coff_section *&ResolvedSection, - uint64_t &ResolvedAddr) { - if (error_code EC = Sym.getAddress(ResolvedAddr)) - return EC; - - section_iterator iter(Obj->section_begin()); - if (error_code EC = Sym.getSection(iter)) - return EC; - - ResolvedSection = Obj->getCOFFSection(*iter); - return object_error::success; -} - // Given a a section and an offset into this section the function returns the // symbol used for the relocation at the offset. error_code COFFDumper::resolveSymbol(const coff_section *Section, @@ -471,10 +455,14 @@ error_code COFFDumper::resolveRelocation(const coff_section *Section, if (error_code EC = resolveSymbol(Section, Offset, Sym)) return EC; - if (error_code EC = resolveSectionAndAddress(Obj, Sym, ResolvedSection, - ResolvedAddress)) + if (error_code EC = Sym.getAddress(ResolvedAddr)) + return EC; + + section_iterator SI(Obj->section_begin()); + if (error_code EC = Sym.getSection(SI)) return EC; + ResolvedSection = Obj->getCOFFSection(*SI); return object_error::success; } |