[llvm] r183759 - Convert another use of sys::identifyFileType.

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 11 11:05:26 PDT 2013


Author: rafael
Date: Tue Jun 11 13:05:26 2013
New Revision: 183759

URL: http://llvm.org/viewvc/llvm-project?rev=183759&view=rev
Log:
Convert another use of sys::identifyFileType.

No functionality change.

Modified:
    llvm/trunk/tools/lto/LTOModule.cpp

Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=183759&r1=183758&r2=183759&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Tue Jun 11 13:05:26 2013
@@ -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, ll
 /// 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) {





More information about the llvm-commits mailing list