mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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
This commit is contained in:
parent
0179706213
commit
9e26acb5b5
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include "llvm/Bitcode/ReaderWriter.h"
|
#include "llvm/Bitcode/ReaderWriter.h"
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
|
#include "llvm/Support/FileSystem.h"
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -205,14 +206,11 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine if this is a bitcode file
|
// Determine if this is a bitcode file
|
||||||
switch (sys::identifyFileType(StringRef(At, 4))) {
|
if (sys::fs::identify_magic(StringRef(At, 4)) ==
|
||||||
case sys::Bitcode_FileType:
|
sys::fs::file_magic::bitcode)
|
||||||
flags |= ArchiveMember::BitcodeFlag;
|
flags |= ArchiveMember::BitcodeFlag;
|
||||||
break;
|
else
|
||||||
default:
|
flags &= ~ArchiveMember::BitcodeFlag;
|
||||||
flags &= ~ArchiveMember::BitcodeFlag;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instantiate the ArchiveMember to be filled
|
// Instantiate the ArchiveMember to be filled
|
||||||
ArchiveMember* member = new ArchiveMember(this);
|
ArchiveMember* member = new ArchiveMember(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user