[llvm] r209605 - tools: inline simple single-use function
Saleem Abdulrasool
compnerd at compnerd.org
Sun May 25 13:26:41 PDT 2014
Author: compnerd
Date: Sun May 25 15:26:40 2014
New Revision: 209605
URL: http://llvm.org/viewvc/llvm-project?rev=209605&view=rev
Log:
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.
Modified:
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=209605&r1=209604&r2=209605&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Sun May 25 15:26:40 2014
@@ -171,22 +171,6 @@ static unsigned getNumUsedSlots(const Un
}
}
-// 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
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;
}
More information about the llvm-commits
mailing list