aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Archive/Archive.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 2b92d0ff..b909b39 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -129,14 +129,12 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
}
// Determine what kind of file it is.
- switch (sys::identifyFileType(StringRef(signature, 4))) {
- case sys::Bitcode_FileType:
- flags |= BitcodeFlag;
- break;
- default:
- flags &= ~BitcodeFlag;
- break;
- }
+ if (sys::fs::identify_magic(StringRef(signature, 4)) ==
+ sys::fs::file_magic::bitcode)
+ flags |= BitcodeFlag;
+ else
+ flags &= ~BitcodeFlag;
+
return false;
}