aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Archive/ArchiveWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Archive/ArchiveWriter.cpp')
-rw-r--r--lib/Archive/ArchiveWriter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 8fcc7aa29c..07a9aaf4fd 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -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;