| 345 | } |
| 346 | |
| 347 | static Expected<std::string> readTriple(BitstreamCursor &Stream) { |
| 348 | // We expect a number of well-defined blocks, though we don't necessarily |
| 349 | // need to understand them all. |
| 350 | while (true) { |
| 351 | BitstreamEntry Entry = Stream.advance(); |
| 352 | |
| 353 | switch (Entry.Kind) { |
| 354 | case BitstreamEntry::Error: |
| 355 | return error("Malformed block"); |
| 356 | case BitstreamEntry::EndBlock: |
| 357 | return ""; |
| 358 | |
| 359 | case BitstreamEntry::SubBlock: |
| 360 | if (Entry.ID == bitc::MODULE_BLOCK_ID) |
| 361 | return readModuleTriple(Stream); |
| 362 | |
| 363 | // Ignore other sub-blocks. |
| 364 | if (Stream.SkipBlock()) |
| 365 | return error("Malformed block"); |
| 366 | continue; |
| 367 | |
| 368 | case BitstreamEntry::Record: |
| 369 | Stream.skipRecord(Entry.ID); |
| 370 | continue; |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | namespace { |
| 376 |
no test coverage detected