diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:13:57 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:13:57 +0000 |
commit | c3907f387f0b2ec20913c6f869131c5ffd9f08df (patch) | |
tree | 372585b0521e4aa69b1ea388d0ee0e92821484ad /tools/lto/LTOModule.cpp | |
parent | 2a4005688c05e26439ce83c0b1da482e3c346ba9 (diff) | |
download | external_llvm-c3907f387f0b2ec20913c6f869131c5ffd9f08df.zip external_llvm-c3907f387f0b2ec20913c6f869131c5ffd9f08df.tar.gz external_llvm-c3907f387f0b2ec20913c6f869131c5ffd9f08df.tar.bz2 |
Inline Path::isBitcodeFile into only use and remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto/LTOModule.cpp')
-rw-r--r-- | tools/lto/LTOModule.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 807d860..263e8b3 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -32,7 +32,6 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" -#include "llvm/Support/PathV1.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" @@ -170,7 +169,10 @@ bool LTOModule::isBitcodeFile(const void *mem, size_t length) { } bool LTOModule::isBitcodeFile(const char *path) { - return llvm::sys::Path(path).isBitcodeFile(); + sys::fs::file_magic type; + if (sys::fs::identify_magic(path, type)) + return false; + return type == sys::fs::file_magic::bitcode; } /// isBitcodeFileForTarget - Returns 'true' if the file (or memory contents) is |