X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FArchive%2FArchiveWriter.cpp;h=8fcc7aa29cc853ddbe9655088e56a20f24004626;hb=1b3f9198ab3880be34b6252423b9e388b5cd6a5e;hp=07a9aaf4fdbe174e12ea03ea5d783884bd77d4a7;hpb=dd103021a889a986a181ce36ed7b0e8dc9b645e1;p=oota-llvm.git diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp index 07a9aaf4fdb..8fcc7aa29cc 100644 --- a/lib/Archive/ArchiveWriter.cpp +++ b/lib/Archive/ArchiveWriter.cpp @@ -181,9 +181,11 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where, flags |= ArchiveMember::HasPathFlag; if (hasSlash || filePath.str().length() > 15) flags |= ArchiveMember::HasLongFilenameFlag; - std::string magic; - mbr->path.getMagicNumber(magic,4); - switch (sys::IdentifyFileType(magic.c_str(),4)) { + + sys::LLVMFileType type; + if (sys::fs::identify_magic(mbr->path.str(), type)) + type = sys::Unknown_FileType; + switch (type) { case sys::Bitcode_FileType: flags |= ArchiveMember::BitcodeFlag; break;