diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-14 22:19:09 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-14 22:19:09 +0000 |
commit | 9170a1737706ec2aa8e60d428f46468f3c069c2d (patch) | |
tree | 347e01aa2f6b668a4440377f5c65fc7a5b563914 /lld | |
parent | 4b83cb5390c7c66a74bc39a9ec85d804695b14c3 (diff) | |
download | llvm-9170a1737706ec2aa8e60d428f46468f3c069c2d.zip llvm-9170a1737706ec2aa8e60d428f46468f3c069c2d.tar.gz llvm-9170a1737706ec2aa8e60d428f46468f3c069c2d.tar.bz2 |
Update for llvm api change.
llvm-svn: 242216
Diffstat (limited to 'lld')
-rw-r--r-- | lld/lib/ReaderWriter/FileArchive.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp index db81ac4..3250a5f 100644 --- a/lld/lib/ReaderWriter/FileArchive.cpp +++ b/lld/lib/ReaderWriter/FileArchive.cpp @@ -50,7 +50,10 @@ public: Archive::child_iterator ci = member->second; // Don't return a member already returned - const char *memberStart = ci->getBuffer().data(); + ErrorOr<StringRef> buf = ci->getBuffer(); + if (!buf) + return nullptr; + const char *memberStart = buf->data(); if (_membersInstantiated.count(memberStart)) return nullptr; if (dataSymbolOnly && !isDataSymbol(ci, name)) @@ -85,7 +88,10 @@ public: Archive::child_iterator ci = member->second; // Do nothing if a member is already instantiated. - const char *memberStart = ci->getBuffer().data(); + ErrorOr<StringRef> buf = ci->getBuffer(); + if (!buf) + return; + const char *memberStart = buf->data(); if (_membersInstantiated.count(memberStart)) return; @@ -234,7 +240,7 @@ private: Archive::child_iterator member = memberOrErr.get(); DEBUG_WITH_TYPE( "FileArchive", - llvm::dbgs() << llvm::format("0x%08llX ", member->getBuffer().data()) + llvm::dbgs() << llvm::format("0x%08llX ", member->getBuffer()->data()) << "'" << name << "'\n"); _symbolMemberMap.insert(std::make_pair(name, member)); } |