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

Function readBlobInRecord

src/lib/Bitcode/Reader/BitcodeReader.cpp:5708–5736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5706}
5707
5708static Expected<StringRef> readBlobInRecord(BitstreamCursor &Stream,
5709 unsigned Block, unsigned RecordID) {
5710 if (Stream.EnterSubBlock(Block))
5711 return error("Invalid record");
5712
5713 StringRef Strtab;
5714 while (true) {
5715 BitstreamEntry Entry = Stream.advance();
5716 switch (Entry.Kind) {
5717 case BitstreamEntry::EndBlock:
5718 return Strtab;
5719
5720 case BitstreamEntry::Error:
5721 return error("Malformed block");
5722
5723 case BitstreamEntry::SubBlock:
5724 if (Stream.SkipBlock())
5725 return error("Malformed block");
5726 break;
5727
5728 case BitstreamEntry::Record:
5729 StringRef Blob;
5730 SmallVector<uint64_t, 1> Record;
5731 if (Stream.readRecord(Entry.ID, Record, &Blob) == RecordID)
5732 Strtab = Blob;
5733 break;
5734 }
5735 }
5736}
5737
5738//===----------------------------------------------------------------------===//
5739// External interface

Callers 1

Calls 5

EnterSubBlockMethod · 0.80
SkipBlockMethod · 0.80
errorFunction · 0.70
advanceMethod · 0.45
readRecordMethod · 0.45

Tested by

no test coverage detected