Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: include/llvm/Object/ELF.h

Issue 9617030: Distinguish between ELF 32/64, little/big endian, in the type system of Binary.h (Closed) Base URL: https://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: x Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/llvm/Object/COFF.h ('k') | include/llvm/Object/MachO.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Object/ELF.h
===================================================================
--- include/llvm/Object/ELF.h (revision 152141)
+++ include/llvm/Object/ELF.h (working copy)
@@ -484,7 +484,8 @@
// Methods for type inquiry through isa, cast, and dyn_cast
bool isDyldType() const { return isDyldELFObject; }
static inline bool classof(const Binary *v) {
- return v->getType() == Binary::isELF;
+ return v->getType() == getELFType(target_endianness == support::little,
+ is64Bits);
}
static inline bool classof(const ELFObjectFile *v) { return true; }
};
@@ -1257,7 +1258,8 @@
template<support::endianness target_endianness, bool is64Bits>
ELFObjectFile<target_endianness, is64Bits>::ELFObjectFile(MemoryBuffer *Object
, error_code &ec)
- : ObjectFile(Binary::isELF, Object, ec)
+ : ObjectFile(getELFType(target_endianness == support::little, is64Bits),
+ Object, ec)
, isDyldELFObject(false)
, SectionHeaderTable(0)
, dot_shstrtab_sec(0)
« no previous file with comments | « include/llvm/Object/COFF.h ('k') | include/llvm/Object/MachO.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698