<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 12, 2015 at 5:14 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Mon Oct 12 07:14:30 2015<br>
New Revision: 250031<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=250031&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=250031&view=rev</a><br>
Log:<br>
Make getStaticELFKind a member function now that we can.<br>
<br>
Modified:<br>
lld/trunk/ELF/InputFiles.cpp<br>
lld/trunk/ELF/InputFiles.h<br>
<br>
Modified: lld/trunk/ELF/InputFiles.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=250031&r1=250030&r2=250031&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=250031&r1=250030&r2=250031&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/InputFiles.cpp (original)<br>
+++ lld/trunk/ELF/InputFiles.cpp Mon Oct 12 07:14:30 2015<br>
@@ -67,7 +67,7 @@ ELFFileBase<ELFT>::getNonLocalSymbols()<br>
<br>
template <class ELFT><br>
ObjectFile<ELFT>::ObjectFile(MemoryBufferRef M)<br>
- : ELFFileBase<ELFT>(Base::ObjectKind, getStaticELFKind<ELFT>(), M) {}<br>
+ : ELFFileBase<ELFT>(Base::ObjectKind, Base::getStaticELFKind(), M) {}<br>
<br>
template <class ELFT><br>
typename ObjectFile<ELFT>::Elf_Sym_Range ObjectFile<ELFT>::getLocalSymbols() {<br>
@@ -260,7 +260,7 @@ std::vector<MemoryBufferRef> ArchiveFile<br>
<br>
template <class ELFT><br>
SharedFile<ELFT>::SharedFile(MemoryBufferRef M)<br>
- : ELFFileBase<ELFT>(Base::SharedKind, getStaticELFKind<ELFT>(), M) {<br>
+ : ELFFileBase<ELFT>(Base::SharedKind, Base::getStaticELFKind(), M) {<br>
AsNeeded = Config->AsNeeded;<br>
}<br>
<br>
<br>
Modified: lld/trunk/ELF/InputFiles.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=250031&r1=250030&r2=250031&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=250031&r1=250030&r2=250031&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/InputFiles.h (original)<br>
+++ lld/trunk/ELF/InputFiles.h Mon Oct 12 07:14:30 2015<br>
@@ -70,16 +70,7 @@ public:<br>
StringRef getStringTable() const { return StringTable; }<br>
<br>
protected:<br>
- const ELFKind EKind;<br>
- llvm::object::ELFFile<ELFT> ELFObj;<br>
- const Elf_Shdr *Symtab = nullptr;<br>
- StringRef StringTable;<br>
- void initStringTable();<br>
- Elf_Sym_Range getNonLocalSymbols();<br>
- Elf_Sym_Range getSymbolsHelper(bool);<br>
-};<br>
-<br>
-template <class ELFT> static ELFKind getStaticELFKind() {<br>
+ static ELFKind getStaticELFKind() {<br>
if (!ELFT::Is64Bits) {<br>
if (ELFT::TargetEndianness == llvm::support::little)<br>
return ELF32LEKind;<br>
@@ -90,6 +81,15 @@ template <class ELFT> static ELFKind get<br>
return ELF64BEKind;<br>
}<br>
<br>
+const ELFKind EKind;<br>
+llvm::object::ELFFile<ELFT> ELFObj;<br>
+const Elf_Shdr *Symtab = nullptr;<br>
+StringRef StringTable;<br>
+void initStringTable();<br>
+Elf_Sym_Range getNonLocalSymbols();<br>
+Elf_Sym_Range getSymbolsHelper(bool);<br>
+};<br></blockquote><div><br></div><div>You want to indent this code.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
// .o file.<br>
template <class ELFT> class ObjectFile : public ELFFileBase<ELFT> {<br>
typedef ELFFileBase<ELFT> Base;<br>
@@ -106,7 +106,7 @@ template <class ELFT> class ObjectFile :<br>
public:<br>
static bool classof(const InputFile *F) {<br>
return F->kind() == Base::ObjectKind &&<br>
- cast<ELFFileBase<ELFT>>(F)->getELFKind() == getStaticELFKind<ELFT>();<br>
+ cast<ELFFileBase<ELFT>>(F)->getELFKind() == Base::getStaticELFKind();<br>
}<br>
<br>
ArrayRef<SymbolBody *> getSymbols() { return this->SymbolBodies; }<br>
@@ -183,7 +183,7 @@ public:<br>
<br>
static bool classof(const InputFile *F) {<br>
return F->kind() == Base::SharedKind &&<br>
- cast<ELFFileBase<ELFT>>(F)->getELFKind() == getStaticELFKind<ELFT>();<br>
+ cast<ELFFileBase<ELFT>>(F)->getELFKind() == Base::getStaticELFKind();<br>
}<br>
<br>
explicit SharedFile(MemoryBufferRef M);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>