return true;
}
- // Determine what kind of file it is.
- if (sys::fs::identify_magic(StringRef(signature, 4)) ==
- sys::fs::file_magic::bitcode)
- flags |= BitcodeFlag;
- else
- flags &= ~BitcodeFlag;
-
return false;
}
enum Flags {
SVR4SymbolTableFlag = 1, ///< Member is a SVR4 symbol table
BSD4SymbolTableFlag = 2, ///< Member is a BSD4 symbol table
- BitcodeFlag = 4, ///< Member is bitcode
HasLongFilenameFlag = 8, ///< Member uses the long filename syntax
StringTableFlag = 16 ///< Member is an ar(1) format string table
};
/// @brief Determine if this member is the ar(1) string table.
bool isStringTable() const { return flags&StringTableFlag; }
- /// @returns true iff the archive member is a bitcode file.
- /// @brief Determine if this member is a bitcode file.
- bool isBitcode() const { return flags&BitcodeFlag; }
-
/// Long filenames are an artifact of the ar(1) file format which allows
/// up to sixteen characters in its header and doesn't allow a path
/// separator character (/). To avoid this, a "long format" member name is
break;
}
- // Determine if this is a bitcode file
- if (sys::fs::identify_magic(StringRef(At, 4)) ==
- sys::fs::file_magic::bitcode)
- flags |= ArchiveMember::BitcodeFlag;
- else
- flags &= ~ArchiveMember::BitcodeFlag;
-
// Instantiate the ArchiveMember to be filled
ArchiveMember* member = new ArchiveMember(this);
sys::fs::file_magic type;
if (sys::fs::identify_magic(mbr->path, type))
type = sys::fs::file_magic::unknown;
- switch (type) {
- case sys::fs::file_magic::bitcode:
- flags |= ArchiveMember::BitcodeFlag;
- break;
- default:
- break;
- }
mbr->flags = flags;
members.insert(where,mbr);
return false;
bool Create = false; ///< 'c' modifier
bool TruncateNames = false; ///< 'f' modifier
bool InsertBefore = false; ///< 'i' modifier
-bool DontSkipBitcode = false; ///< 'k' modifier
bool UseCount = false; ///< 'N' modifier
bool OriginalDates = false; ///< 'o' modifier
bool FullPath = false; ///< 'P' modifier
case 'x': ++NumOperations; Operation = Extract; break;
case 'c': Create = true; break;
case 'f': TruncateNames = true; break;
- case 'k': DontSkipBitcode = true; break;
case 'l': /* accepted but unused */ break;
case 'o': OriginalDates = true; break;
case 's': break; // Ignore for now.
const char* data = reinterpret_cast<const char*>(I->getData());
// Skip things that don't make sense to print
- if (I->isSVR4SymbolTable() ||
- I->isBSD4SymbolTable() || (!DontSkipBitcode && I->isBitcode()))
+ if (I->isSVR4SymbolTable() || I->isBSD4SymbolTable())
continue;
if (Verbose)
if (Verbose) {
// FIXME: Output should be this format:
// Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile
- if (I->isBitcode())
- outs() << "b";
- else
- outs() << " ";
+ outs() << " ";
unsigned mode = I->getMode();
printMode((mode >> 6) & 007);
printMode((mode >> 3) & 007);