mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
Convert another use of sys::identifyFileType.
No functionality change. llvm-svn: 183759
This commit is contained in:
parent
53cd69f8b2
commit
919e60d2a1
@ -29,6 +29,7 @@
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Host.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/Path.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
|
||||
/// bitcode.
|
||||
bool LTOModule::isBitcodeFile(const void *mem, size_t length) {
|
||||
return llvm::sys::identifyFileType(StringRef((const char*)mem, length))
|
||||
== llvm::sys::Bitcode_FileType;
|
||||
return sys::fs::identify_magic(StringRef((const char *)mem, length)) ==
|
||||
sys::fs::file_magic::bitcode;
|
||||
}
|
||||
|
||||
bool LTOModule::isBitcodeFile(const char *path) {
|
||||
|
Loading…
Reference in New Issue
Block a user