forked from OSchip/llvm-project
Revert the archive part of "Support/PathV2: Add identify_magic."
llvm-svn: 123593
This commit is contained in:
parent
2103e25e19
commit
c2caa2133c
|
@ -116,10 +116,11 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
|
|||
|
||||
// Get the signature and status info
|
||||
const char* signature = (const char*) data;
|
||||
SmallString<4> magic;
|
||||
std::string magic;
|
||||
if (!signature) {
|
||||
sys::fs::get_magic(path.str(), magic.capacity(), magic);
|
||||
path.getMagicNumber(magic,4);
|
||||
signature = magic.c_str();
|
||||
std::string err;
|
||||
const sys::FileStatus *FSinfo = path.getFileStatus(false, ErrMsg);
|
||||
if (FSinfo)
|
||||
info = *FSinfo;
|
||||
|
|
|
@ -181,11 +181,9 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where,
|
|||
flags |= ArchiveMember::HasPathFlag;
|
||||
if (hasSlash || filePath.str().length() > 15)
|
||||
flags |= ArchiveMember::HasLongFilenameFlag;
|
||||
|
||||
sys::LLVMFileType type;
|
||||
if (sys::fs::identify_magic(mbr->path.str(), type))
|
||||
type = sys::Unknown_FileType;
|
||||
switch (type) {
|
||||
std::string magic;
|
||||
mbr->path.getMagicNumber(magic,4);
|
||||
switch (sys::IdentifyFileType(magic.c_str(),4)) {
|
||||
case sys::Bitcode_FileType:
|
||||
flags |= ArchiveMember::BitcodeFlag;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue