Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2013-06-11 17:28:56 +00:00
parent 0179706213
commit 9e26acb5b5

View File

@ -17,6 +17,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cstdio>
#include <cstdlib>
@ -205,14 +206,11 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error)
}
// Determine if this is a bitcode file
switch (sys::identifyFileType(StringRef(At, 4))) {
case sys::Bitcode_FileType:
if (sys::fs::identify_magic(StringRef(At, 4)) ==
sys::fs::file_magic::bitcode)
flags |= ArchiveMember::BitcodeFlag;
break;
default:
else
flags &= ~ArchiveMember::BitcodeFlag;
break;
}
// Instantiate the ArchiveMember to be filled
ArchiveMember* member = new ArchiveMember(this);