[lld] r320652 - Inline a small function.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 13 14:53:59 PST 2017
Author: ruiu
Date: Wed Dec 13 14:53:59 2017
New Revision: 320652
URL: http://llvm.org/viewvc/llvm-project?rev=320652&view=rev
Log:
Inline a small function.
Differential Revision: https://reviews.llvm.org/D41204
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/InputFiles.h
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=320652&r1=320651&r2=320652&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Dec 13 14:53:59 2017
@@ -599,19 +599,14 @@ template <class ELFT> void ObjFile<ELFT>
this->Symbols.push_back(createSymbol(&Sym));
}
-template <class ELFT>
-InputSectionBase *ObjFile<ELFT>::getSection(uint32_t Index) const {
- if (Index == 0)
- return nullptr;
- if (Index >= this->Sections.size())
- fatal(toString(this) + ": invalid section index: " + Twine(Index));
- return this->Sections[Index];
-}
-
template <class ELFT> Symbol *ObjFile<ELFT>::createSymbol(const Elf_Sym *Sym) {
int Binding = Sym->getBinding();
- InputSectionBase *Sec = getSection(this->getSectionIndex(*Sym));
+ uint32_t SecIdx = this->getSectionIndex(*Sym);
+ if (SecIdx >= this->Sections.size())
+ fatal(toString(this) + ": invalid section index: " + Twine(SecIdx));
+
+ InputSectionBase *Sec = this->Sections[SecIdx];
uint8_t StOther = Sym->st_other;
uint8_t Type = Sym->getType();
uint64_t Value = Sym->st_value;
Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=320652&r1=320651&r2=320652&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Wed Dec 13 14:53:59 2017
@@ -194,7 +194,6 @@ public:
StringRef SourceFile;
private:
- InputSectionBase *getSection(uint32_t Index) const;
void
initializeSections(llvm::DenseSet<llvm::CachedHashStringRef> &ComdatGroups);
void initializeSymbols();
More information about the llvm-commits
mailing list