mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Don't treat bitcode files specially in llvm-ar.
We really want bitcode files to behave as regular object files in archives, so we don't need to track that a member is bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185681 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -125,13 +125,6 @@ bool ArchiveMember::replaceWith(StringRef newFile, std::string* ErrMsg) {
|
|||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,6 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
|
|||||||
enum Flags {
|
enum Flags {
|
||||||
SVR4SymbolTableFlag = 1, ///< Member is a SVR4 symbol table
|
SVR4SymbolTableFlag = 1, ///< Member is a SVR4 symbol table
|
||||||
BSD4SymbolTableFlag = 2, ///< Member is a BSD4 symbol table
|
BSD4SymbolTableFlag = 2, ///< Member is a BSD4 symbol table
|
||||||
BitcodeFlag = 4, ///< Member is bitcode
|
|
||||||
HasLongFilenameFlag = 8, ///< Member uses the long filename syntax
|
HasLongFilenameFlag = 8, ///< Member uses the long filename syntax
|
||||||
StringTableFlag = 16 ///< Member is an ar(1) format string table
|
StringTableFlag = 16 ///< Member is an ar(1) format string table
|
||||||
};
|
};
|
||||||
@ -121,10 +120,6 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
|
|||||||
/// @brief Determine if this member is the ar(1) string table.
|
/// @brief Determine if this member is the ar(1) string table.
|
||||||
bool isStringTable() const { return flags&StringTableFlag; }
|
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
|
/// 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
|
/// up to sixteen characters in its header and doesn't allow a path
|
||||||
/// separator character (/). To avoid this, a "long format" member name is
|
/// separator character (/). To avoid this, a "long format" member name is
|
||||||
|
@ -162,13 +162,6 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error)
|
|||||||
break;
|
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
|
// Instantiate the ArchiveMember to be filled
|
||||||
ArchiveMember* member = new ArchiveMember(this);
|
ArchiveMember* member = new ArchiveMember(this);
|
||||||
|
|
||||||
|
@ -183,13 +183,6 @@ bool Archive::addFileBefore(StringRef filePath, iterator where,
|
|||||||
sys::fs::file_magic type;
|
sys::fs::file_magic type;
|
||||||
if (sys::fs::identify_magic(mbr->path, type))
|
if (sys::fs::identify_magic(mbr->path, type))
|
||||||
type = sys::fs::file_magic::unknown;
|
type = sys::fs::file_magic::unknown;
|
||||||
switch (type) {
|
|
||||||
case sys::fs::file_magic::bitcode:
|
|
||||||
flags |= ArchiveMember::BitcodeFlag;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
mbr->flags = flags;
|
mbr->flags = flags;
|
||||||
members.insert(where,mbr);
|
members.insert(where,mbr);
|
||||||
return false;
|
return false;
|
||||||
|
@ -99,7 +99,6 @@ bool AddBefore = false; ///< 'b' modifier
|
|||||||
bool Create = false; ///< 'c' modifier
|
bool Create = false; ///< 'c' modifier
|
||||||
bool TruncateNames = false; ///< 'f' modifier
|
bool TruncateNames = false; ///< 'f' modifier
|
||||||
bool InsertBefore = false; ///< 'i' modifier
|
bool InsertBefore = false; ///< 'i' modifier
|
||||||
bool DontSkipBitcode = false; ///< 'k' modifier
|
|
||||||
bool UseCount = false; ///< 'N' modifier
|
bool UseCount = false; ///< 'N' modifier
|
||||||
bool OriginalDates = false; ///< 'o' modifier
|
bool OriginalDates = false; ///< 'o' modifier
|
||||||
bool FullPath = false; ///< 'P' modifier
|
bool FullPath = false; ///< 'P' modifier
|
||||||
@ -219,7 +218,6 @@ ArchiveOperation parseCommandLine() {
|
|||||||
case 'x': ++NumOperations; Operation = Extract; break;
|
case 'x': ++NumOperations; Operation = Extract; break;
|
||||||
case 'c': Create = true; break;
|
case 'c': Create = true; break;
|
||||||
case 'f': TruncateNames = true; break;
|
case 'f': TruncateNames = true; break;
|
||||||
case 'k': DontSkipBitcode = true; break;
|
|
||||||
case 'l': /* accepted but unused */ break;
|
case 'l': /* accepted but unused */ break;
|
||||||
case 'o': OriginalDates = true; break;
|
case 'o': OriginalDates = true; break;
|
||||||
case 's': break; // Ignore for now.
|
case 's': break; // Ignore for now.
|
||||||
@ -323,8 +321,7 @@ bool doPrint(std::string* ErrMsg) {
|
|||||||
const char* data = reinterpret_cast<const char*>(I->getData());
|
const char* data = reinterpret_cast<const char*>(I->getData());
|
||||||
|
|
||||||
// Skip things that don't make sense to print
|
// Skip things that don't make sense to print
|
||||||
if (I->isSVR4SymbolTable() ||
|
if (I->isSVR4SymbolTable() || I->isBSD4SymbolTable())
|
||||||
I->isBSD4SymbolTable() || (!DontSkipBitcode && I->isBitcode()))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Verbose)
|
if (Verbose)
|
||||||
@ -373,9 +370,6 @@ doDisplayTable(std::string* ErrMsg) {
|
|||||||
if (Verbose) {
|
if (Verbose) {
|
||||||
// FIXME: Output should be this format:
|
// FIXME: Output should be this format:
|
||||||
// Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile
|
// Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile
|
||||||
if (I->isBitcode())
|
|
||||||
outs() << "b";
|
|
||||||
else
|
|
||||||
outs() << " ";
|
outs() << " ";
|
||||||
unsigned mode = I->getMode();
|
unsigned mode = I->getMode();
|
||||||
printMode((mode >> 6) & 007);
|
printMode((mode >> 6) & 007);
|
||||||
|
Reference in New Issue
Block a user