[lld] r250031 - Make getStaticELFKind a member function now that we can.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 05:14:30 PDT 2015
Author: rafael
Date: Mon Oct 12 07:14:30 2015
New Revision: 250031
URL: http://llvm.org/viewvc/llvm-project?rev=250031&view=rev
Log:
Make getStaticELFKind a member function now that we can.
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=250031&r1=250030&r2=250031&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon Oct 12 07:14:30 2015
@@ -67,7 +67,7 @@ ELFFileBase<ELFT>::getNonLocalSymbols()
template <class ELFT>
ObjectFile<ELFT>::ObjectFile(MemoryBufferRef M)
- : ELFFileBase<ELFT>(Base::ObjectKind, getStaticELFKind<ELFT>(), M) {}
+ : ELFFileBase<ELFT>(Base::ObjectKind, Base::getStaticELFKind(), M) {}
template <class ELFT>
typename ObjectFile<ELFT>::Elf_Sym_Range ObjectFile<ELFT>::getLocalSymbols() {
@@ -260,7 +260,7 @@ std::vector<MemoryBufferRef> ArchiveFile
template <class ELFT>
SharedFile<ELFT>::SharedFile(MemoryBufferRef M)
- : ELFFileBase<ELFT>(Base::SharedKind, getStaticELFKind<ELFT>(), M) {
+ : ELFFileBase<ELFT>(Base::SharedKind, Base::getStaticELFKind(), M) {
AsNeeded = Config->AsNeeded;
}
Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=250031&r1=250030&r2=250031&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Mon Oct 12 07:14:30 2015
@@ -70,16 +70,7 @@ public:
StringRef getStringTable() const { return StringTable; }
protected:
- const ELFKind EKind;
- llvm::object::ELFFile<ELFT> ELFObj;
- const Elf_Shdr *Symtab = nullptr;
- StringRef StringTable;
- void initStringTable();
- Elf_Sym_Range getNonLocalSymbols();
- Elf_Sym_Range getSymbolsHelper(bool);
-};
-
-template <class ELFT> static ELFKind getStaticELFKind() {
+ static ELFKind getStaticELFKind() {
if (!ELFT::Is64Bits) {
if (ELFT::TargetEndianness == llvm::support::little)
return ELF32LEKind;
@@ -90,6 +81,15 @@ template <class ELFT> static ELFKind get
return ELF64BEKind;
}
+const ELFKind EKind;
+llvm::object::ELFFile<ELFT> ELFObj;
+const Elf_Shdr *Symtab = nullptr;
+StringRef StringTable;
+void initStringTable();
+Elf_Sym_Range getNonLocalSymbols();
+Elf_Sym_Range getSymbolsHelper(bool);
+};
+
// .o file.
template <class ELFT> class ObjectFile : public ELFFileBase<ELFT> {
typedef ELFFileBase<ELFT> Base;
@@ -106,7 +106,7 @@ template <class ELFT> class ObjectFile :
public:
static bool classof(const InputFile *F) {
return F->kind() == Base::ObjectKind &&
- cast<ELFFileBase<ELFT>>(F)->getELFKind() == getStaticELFKind<ELFT>();
+ cast<ELFFileBase<ELFT>>(F)->getELFKind() == Base::getStaticELFKind();
}
ArrayRef<SymbolBody *> getSymbols() { return this->SymbolBodies; }
@@ -183,7 +183,7 @@ public:
static bool classof(const InputFile *F) {
return F->kind() == Base::SharedKind &&
- cast<ELFFileBase<ELFT>>(F)->getELFKind() == getStaticELFKind<ELFT>();
+ cast<ELFFileBase<ELFT>>(F)->getELFKind() == Base::getStaticELFKind();
}
explicit SharedFile(MemoryBufferRef M);
More information about the llvm-commits
mailing list