From 28f0ed5c9de4a68f34c0219d4ab83652c4647150 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Sat, 15 Jan 2011 20:39:36 +0000 Subject: Support/PathV2: Add identify_magic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Archive/ArchiveWriter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/Archive/ArchiveWriter.cpp') diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp index 07a9aaf4fd..8fcc7aa29c 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; -- cgit v1.2.3