[llvm] r183746 - Convert another use of sys::identifyFileType.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jun 11 08:09:43 PDT 2013
Author: rafael
Date: Tue Jun 11 10:09:43 2013
New Revision: 183746
URL: http://llvm.org/viewvc/llvm-project?rev=183746&view=rev
Log:
Convert another use of sys::identifyFileType.
No functionality change.
Modified:
llvm/trunk/lib/Archive/Archive.cpp
Modified: llvm/trunk/lib/Archive/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=183746&r1=183745&r2=183746&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/Archive.cpp (original)
+++ llvm/trunk/lib/Archive/Archive.cpp Tue Jun 11 10:09:43 2013
@@ -129,14 +129,12 @@ bool ArchiveMember::replaceWith(const sy
}
// 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;
}
More information about the llvm-commits
mailing list