summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-01-08 00:44:45 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-01-08 00:44:45 +0000
commit7b0d145768fe907fd8e46d102cee006f06400430 (patch)
tree0c5bcf5f87e4528b2a2bf1fa124b8c43fdadc496 /llvm/lib/Bitcode
parent04060ab619b8d1677badf946277a44f4bae37789 (diff)
downloadbcm5719-llvm-7b0d145768fe907fd8e46d102cee006f06400430.tar.gz
bcm5719-llvm-7b0d145768fe907fd8e46d102cee006f06400430.zip
[ThinLTO] Fix lazy-loading of Metadata attachment, which left some Fwd ref behind
The change in r291362 was too agressive. We still need to flush at the end of the block because function local metadata can introduce fwd ref as well. (Bootstrap with ThinLTO was broken) llvm-svn: 291379
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 89edbbef92e..4a5d18e2db7 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1561,6 +1561,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseMetadataAttachment(
return error("Invalid record");
SmallVector<uint64_t, 64> Record;
+ PlaceholderQueue Placeholders;
while (true) {
BitstreamEntry Entry = Stream.advanceSkippingSubblocks();
@@ -1570,6 +1571,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseMetadataAttachment(
case BitstreamEntry::Error:
return error("Malformed block");
case BitstreamEntry::EndBlock:
+ resolveForwardRefsAndPlaceholders(Placeholders);
return Error::success();
case BitstreamEntry::Record:
// The interesting case.
@@ -1608,7 +1610,6 @@ Error MetadataLoader::MetadataLoaderImpl::parseMetadataAttachment(
!MetadataList.lookup(Idx)) {
// Load the attachment if it is in the lazy-loadable range and hasn't
// been loaded yet.
- PlaceholderQueue Placeholders;
lazyLoadOneMetadata(Idx, Placeholders);
resolveForwardRefsAndPlaceholders(Placeholders);
}
OpenPOWER on IntegriCloud