MCPcopy Create free account
hub / github.com/GANGE666/xVMP / lazyLoadOneMetadata

Method lazyLoadOneMetadata

src/lib/Bitcode/Reader/MetadataLoader.cpp:921–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919}
920
921void 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.

Callers

nothing calls this directly

Calls 8

report_fatal_errorFunction · 0.85
JumpToBitMethod · 0.80
assertFunction · 0.50
sizeMethod · 0.45
lookupMethod · 0.45
isTemporaryMethod · 0.45
readRecordMethod · 0.45

Tested by

no test coverage detected