Pass a StringRef to sys::identifyFileType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-06-10 15:27:39 +00:00
parent b972457783
commit f12745f7a7
9 changed files with 15 additions and 18 deletions

View File

@@ -45,8 +45,7 @@ error_code object::createBinary(MemoryBuffer *Source,
OwningPtr<MemoryBuffer> scopedSource(Source);
if (!Source)
return make_error_code(errc::invalid_argument);
sys::LLVMFileType type = sys::IdentifyFileType(Source->getBufferStart(),
static_cast<unsigned>(Source->getBufferSize()));
sys::LLVMFileType type = sys::identifyFileType(Source->getBuffer());
error_code ec;
switch (type) {
case sys::Archive_FileType: {