Add a non-templated ELFObjectFileBase class.

Use it to implement some ELF only virtual interfaces instead of using error
prone series of dyn_casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-08-17 17:52:10 +00:00
parent 4c511cd88f
commit db7cdc8eb0
2 changed files with 40 additions and 61 deletions

View File

@ -17,6 +17,10 @@
namespace llvm {
using namespace object;
ELFObjectFileBase::ELFObjectFileBase(unsigned int Type,
std::unique_ptr<MemoryBuffer> Source)
: ObjectFile(Type, std::move(Source)) {}
ErrorOr<std::unique_ptr<ObjectFile>>
ObjectFile::createELFObjectFile(std::unique_ptr<MemoryBuffer> &Obj) {
std::pair<unsigned char, unsigned char> Ident =