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

Method parseMetadataKinds

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

Parse the metadata kinds out of the METADATA_KIND_BLOCK.

Source from the content-addressed store, hash-verified

1958
1959/// Parse the metadata kinds out of the METADATA_KIND_BLOCK.
1960Error MetadataLoader::MetadataLoaderImpl::parseMetadataKinds() {
1961 if (Stream.EnterSubBlock(bitc::METADATA_KIND_BLOCK_ID))
1962 return error("Invalid record");
1963
1964 SmallVector<uint64_t, 64> Record;
1965
1966 // Read all the records.
1967 while (true) {
1968 BitstreamEntry Entry = Stream.advanceSkippingSubblocks();
1969
1970 switch (Entry.Kind) {
1971 case BitstreamEntry::SubBlock: // Handled for us already.
1972 case BitstreamEntry::Error:
1973 return error("Malformed block");
1974 case BitstreamEntry::EndBlock:
1975 return Error::success();
1976 case BitstreamEntry::Record:
1977 // The interesting case.
1978 break;
1979 }
1980
1981 // Read a record.
1982 Record.clear();
1983 ++NumMDRecordLoaded;
1984 unsigned Code = Stream.readRecord(Entry.ID, Record);
1985 switch (Code) {
1986 default: // Default behavior: ignore.
1987 break;
1988 case bitc::METADATA_KIND: {
1989 if (Error Err = parseMetadataKindRecord(Record))
1990 return Err;
1991 break;
1992 }
1993 }
1994 }
1995}
1996
1997MetadataLoader &MetadataLoader::operator=(MetadataLoader &&RHS) {
1998 Pimpl = std::move(RHS.Pimpl);

Callers 1

parseModuleMethod · 0.80

Calls 6

successFunction · 0.85
EnterSubBlockMethod · 0.80
errorFunction · 0.70
clearMethod · 0.45
readRecordMethod · 0.45

Tested by

no test coverage detected