Convert another use of sys::identifyFileType.

No functionality change.

llvm-svn: 183759
This commit is contained in:
Rafael Espindola 2013-06-11 18:05:26 +00:00
parent 8de8607c7d
commit 46ed353313
1 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@
#include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/SubtargetFeature.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Host.h" #include "llvm/Support/Host.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h" #include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h" #include "llvm/Support/SourceMgr.h"
@ -163,8 +164,8 @@ LTOModule::LTOModule(llvm::Module *m, llvm::TargetMachine *t)
/// isBitcodeFile - Returns 'true' if the file (or memory contents) is LLVM /// isBitcodeFile - Returns 'true' if the file (or memory contents) is LLVM
/// bitcode. /// bitcode.
bool LTOModule::isBitcodeFile(const void *mem, size_t length) { bool LTOModule::isBitcodeFile(const void *mem, size_t length) {
return llvm::sys::identifyFileType(StringRef((const char*)mem, length)) return sys::fs::identify_magic(StringRef((const char *)mem, length)) ==
== llvm::sys::Bitcode_FileType; sys::fs::file_magic::bitcode;
} }
bool LTOModule::isBitcodeFile(const char *path) { bool LTOModule::isBitcodeFile(const char *path) {