summaryrefslogtreecommitdiff
path: root/lib/Archive/ArchiveWriter.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-16 21:13:51 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-16 21:13:51 +0000
commit3c98e14bc9b747b66c048b008f371ac03323c913 (patch)
treecf0b70f9d896a177a0a0c027c60b02c083ca927e /lib/Archive/ArchiveWriter.cpp
parent6990433b56ab37a15991b1b01f46a0c2ce8adea5 (diff)
UnRevert "Revert the archive part of "Support/PathV2: Add identify_magic.""
This reverts commit dd103021a889a986a181ce36ed7b0e8dc9b645e1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/ArchiveWriter.cpp')
-rw-r--r--lib/Archive/ArchiveWriter.cpp8
1 files changed, 5 insertions, 3 deletions
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;