From f12745f7a7e68c05c89ebd515b9b4faedce37dd0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 10 Jun 2013 15:27:39 +0000 Subject: Pass a StringRef to sys::identifyFileType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183669 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/Binary.cpp | 3 +-- lib/Object/ObjectFile.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/Object') diff --git a/lib/Object/Binary.cpp b/lib/Object/Binary.cpp index 012e328..5d816e1 100644 --- a/lib/Object/Binary.cpp +++ b/lib/Object/Binary.cpp @@ -45,8 +45,7 @@ error_code object::createBinary(MemoryBuffer *Source, OwningPtr scopedSource(Source); if (!Source) return make_error_code(errc::invalid_argument); - sys::LLVMFileType type = sys::IdentifyFileType(Source->getBufferStart(), - static_cast(Source->getBufferSize())); + sys::LLVMFileType type = sys::identifyFileType(Source->getBuffer()); error_code ec; switch (type) { case sys::Archive_FileType: { diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp index 5b3165d..c64af84 100644 --- a/lib/Object/ObjectFile.cpp +++ b/lib/Object/ObjectFile.cpp @@ -40,8 +40,7 @@ section_iterator ObjectFile::getRelocatedSection(DataRefImpl Sec) const { ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) { if (!Object || Object->getBufferSize() < 64) return 0; - sys::LLVMFileType type = sys::IdentifyFileType(Object->getBufferStart(), - static_cast(Object->getBufferSize())); + sys::LLVMFileType type = sys::identifyFileType(Object->getBuffer()); switch (type) { case sys::Unknown_FileType: return 0; -- cgit v1.1