From: Rafael Espindola Date: Tue, 11 Jun 2013 17:28:56 +0000 (+0000) Subject: Convert another use of sys::identifyFileType. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9e26acb5b55f47a4a963c1535fd6b9cb640fa4b6;p=oota-llvm.git 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 --- diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 65505993c0c..6946ddb7681 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -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 #include @@ -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: - flags |= ArchiveMember::BitcodeFlag; - break; - default: - flags &= ~ArchiveMember::BitcodeFlag; - break; - } + if (sys::fs::identify_magic(StringRef(At, 4)) == + sys::fs::file_magic::bitcode) + flags |= ArchiveMember::BitcodeFlag; + else + flags &= ~ArchiveMember::BitcodeFlag; // Instantiate the ArchiveMember to be filled ArchiveMember* member = new ArchiveMember(this);