Convert another use of sys::identifyFileType.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 11 Jun 2013 15:09:43 +0000 (15:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 11 Jun 2013 15:09:43 +0000 (15:09 +0000)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183746 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Archive/Archive.cpp

index 2b92d0ff8278ff0450f2ec35e08a229b7da4d363..b909b39527052c4d85ca17f65617198cd0fd4695 100644 (file)
@@ -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;
 }