[llvm-commits] [llvm] r123593 - in /llvm/trunk/lib/Archive: Archive.cpp ArchiveWriter.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Sun Jan 16 11:56:42 PST 2011
Author: mspencer
Date: Sun Jan 16 13:56:42 2011
New Revision: 123593
URL: http://llvm.org/viewvc/llvm-project?rev=123593&view=rev
Log:
Revert the archive part of "Support/PathV2: Add identify_magic."
Modified:
llvm/trunk/lib/Archive/Archive.cpp
llvm/trunk/lib/Archive/ArchiveWriter.cpp
Modified: llvm/trunk/lib/Archive/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=123593&r1=123592&r2=123593&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/Archive.cpp (original)
+++ llvm/trunk/lib/Archive/Archive.cpp Sun Jan 16 13:56:42 2011
@@ -116,10 +116,11 @@
// Get the signature and status info
const char* signature = (const char*) data;
- SmallString<4> magic;
+ std::string magic;
if (!signature) {
- sys::fs::get_magic(path.str(), magic.capacity(), magic);
+ path.getMagicNumber(magic,4);
signature = magic.c_str();
+ std::string err;
const sys::FileStatus *FSinfo = path.getFileStatus(false, ErrMsg);
if (FSinfo)
info = *FSinfo;
Modified: llvm/trunk/lib/Archive/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveWriter.cpp?rev=123593&r1=123592&r2=123593&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveWriter.cpp Sun Jan 16 13:56:42 2011
@@ -181,11 +181,9 @@
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;
More information about the llvm-commits
mailing list