| 919 | } |
| 920 | |
| 921 | void MetadataLoader::MetadataLoaderImpl::lazyLoadOneMetadata( |
| 922 | unsigned ID, PlaceholderQueue &Placeholders) { |
| 923 | assert(ID < (MDStringRef.size()) + GlobalMetadataBitPosIndex.size()); |
| 924 | assert(ID >= MDStringRef.size() && "Unexpected lazy-loading of MDString"); |
| 925 | // Lookup first if the metadata hasn't already been loaded. |
| 926 | if (auto *MD = MetadataList.lookup(ID)) { |
| 927 | auto *N = dyn_cast_or_null<MDNode>(MD); |
| 928 | if (!N->isTemporary()) |
| 929 | return; |
| 930 | } |
| 931 | SmallVector<uint64_t, 64> Record; |
| 932 | StringRef Blob; |
| 933 | IndexCursor.JumpToBit(GlobalMetadataBitPosIndex[ID - MDStringRef.size()]); |
| 934 | auto Entry = IndexCursor.advanceSkippingSubblocks(); |
| 935 | ++NumMDRecordLoaded; |
| 936 | unsigned Code = IndexCursor.readRecord(Entry.ID, Record, &Blob); |
| 937 | if (Error Err = parseOneMetadata(Record, Code, Placeholders, Blob, ID)) |
| 938 | report_fatal_error("Can't lazyload MD"); |
| 939 | } |
| 940 | |
| 941 | /// Ensure that all forward-references and placeholders are resolved. |
| 942 | /// Iteratively lazy-loading metadata on-demand if needed. |
nothing calls this directly
no test coverage detected