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

Function readIdentificationCode

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

Source from the content-addressed store, hash-verified

209}
210
211static Expected<std::string> readIdentificationCode(BitstreamCursor &Stream) {
212 // We expect a number of well-defined blocks, though we don't necessarily
213 // need to understand them all.
214 while (true) {
215 if (Stream.AtEndOfStream())
216 return "";
217
218 BitstreamEntry Entry = Stream.advance();
219 switch (Entry.Kind) {
220 case BitstreamEntry::EndBlock:
221 case BitstreamEntry::Error:
222 return error("Malformed block");
223
224 case BitstreamEntry::SubBlock:
225 if (Entry.ID == bitc::IDENTIFICATION_BLOCK_ID)
226 return readIdentificationBlock(Stream);
227
228 // Ignore other sub-blocks.
229 if (Stream.SkipBlock())
230 return error("Malformed block");
231 continue;
232 case BitstreamEntry::Record:
233 Stream.skipRecord(Entry.ID);
234 continue;
235 }
236 }
237}
238
239static Expected<bool> hasObjCCategoryInModule(BitstreamCursor &Stream) {
240 if (Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))

Callers 1

Calls 6

readIdentificationBlockFunction · 0.85
AtEndOfStreamMethod · 0.80
SkipBlockMethod · 0.80
skipRecordMethod · 0.80
errorFunction · 0.70
advanceMethod · 0.45

Tested by

no test coverage detected