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

Method parseMetadataKindRecord

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

Parse a single METADATA_KIND record, inserting result in MDKindMap.

Source from the content-addressed store, hash-verified

1943
1944/// Parse a single METADATA_KIND record, inserting result in MDKindMap.
1945Error MetadataLoader::MetadataLoaderImpl::parseMetadataKindRecord(
1946 SmallVectorImpl<uint64_t> &Record) {
1947 if (Record.size() < 2)
1948 return error("Invalid record");
1949
1950 unsigned Kind = Record[0];
1951 SmallString<8> Name(Record.begin() + 1, Record.end());
1952
1953 unsigned NewKind = TheModule.getMDKindID(Name.str());
1954 if (!MDKindMap.insert(std::make_pair(Kind, NewKind)).second)
1955 return error("Conflicting METADATA_KIND records");
1956 return Error::success();
1957}
1958
1959/// Parse the metadata kinds out of the METADATA_KIND_BLOCK.
1960Error MetadataLoader::MetadataLoaderImpl::parseMetadataKinds() {

Callers

nothing calls this directly

Calls 9

successFunction · 0.85
errorFunction · 0.70
make_pairFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMDKindIDMethod · 0.45
strMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected