addElfSymbols and readJustSymbolsFile still has duplicate code, but
I didn't come up with a good idea to eliminate them. Since this patch
is an improvement, I'm sending this for review.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Rui Ueyama via Phabricator via llvm-commits
<llvm-commits@lists.llvm.org> writes:
-template <class ELFT> std::vector<StringRef> LazyObjFile::getElfSymbols() {
- typedef typename ELFT::Shdr Elf_Shdr;
- typedef typename ELFT::Sym Elf_Sym;
- typedef typename ELFT::SymRange Elf_Sym_Range;
+template <class ELFT> void LazyObjFile::addElfSymbols() {
+ StringRef ObjName = MB.getBufferIdentifier();
+ ELFFile<ELFT> Obj = check(ELFFile<ELFT>::create(MB.getBuffer()));
+ ArrayRef<typename ELFT::Shdr> Sections = CHECK(Obj.sections(), ObjName);
Why change CHECK(..., this) to CHECK(..., ObjName)?
LGTM with that.
Cheers,
Rafael