diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /lib/Archive/Archive.cpp | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r-- | lib/Archive/Archive.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp index bb57262..00778d9 100644 --- a/lib/Archive/Archive.cpp +++ b/lib/Archive/Archive.cpp @@ -31,7 +31,7 @@ ArchiveMember::getMemberSize() const { // If it has a long filename, include the name length if (hasLongFilename()) - result += path.toString().length() + 1; + result += path.str().length() + 1; // If its now odd lengthed, include the padding byte if (result % 2 != 0 ) @@ -76,38 +76,38 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) { path = newFile; // SVR4 symbol tables have an empty name - if (path.toString() == ARFILE_SVR4_SYMTAB_NAME) + if (path.str() == ARFILE_SVR4_SYMTAB_NAME) flags |= SVR4SymbolTableFlag; else flags &= ~SVR4SymbolTableFlag; // BSD4.4 symbol tables have a special name - if (path.toString() == ARFILE_BSD4_SYMTAB_NAME) + if (path.str() == ARFILE_BSD4_SYMTAB_NAME) flags |= BSD4SymbolTableFlag; else flags &= ~BSD4SymbolTableFlag; // LLVM symbol tables have a very specific name - if (path.toString() == ARFILE_LLVM_SYMTAB_NAME) + if (path.str() == ARFILE_LLVM_SYMTAB_NAME) flags |= LLVMSymbolTableFlag; else flags &= ~LLVMSymbolTableFlag; // String table name - if (path.toString() == ARFILE_STRTAB_NAME) + if (path.str() == ARFILE_STRTAB_NAME) flags |= StringTableFlag; else flags &= ~StringTableFlag; // If it has a slash then it has a path - bool hasSlash = path.toString().find('/') != std::string::npos; + bool hasSlash = path.str().find('/') != std::string::npos; if (hasSlash) flags |= HasPathFlag; else flags &= ~HasPathFlag; // If it has a slash or its over 15 chars then its a long filename format - if (hasSlash || path.toString().length() > 15) + if (hasSlash || path.str().length() > 15) flags |= HasLongFilenameFlag; else flags &= ~HasLongFilenameFlag; @@ -126,8 +126,11 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) { return true; } - // Determine what kind of file it is + // Determine what kind of file it is. switch (sys::IdentifyFileType(signature,4)) { + case sys::Bitcode_FileType: + flags |= BitcodeFlag; + break; default: flags &= ~BitcodeFlag; break; @@ -214,7 +217,7 @@ bool llvm::GetBitcodeSymbols(const sys::Path& fName, std::auto_ptr<MemoryBuffer> Buffer( MemoryBuffer::getFileOrSTDIN(fName.c_str())); if (!Buffer.get()) { - if (ErrMsg) *ErrMsg = "Could not open file '" + fName.toString() + "'"; + if (ErrMsg) *ErrMsg = "Could not open file '" + fName.str() + "'"; return true; } |