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

Method parseSyncScopeNames

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

Source from the content-addressed store, hash-verified

1811}
1812
1813Error BitcodeReader::parseSyncScopeNames() {
1814 if (Stream.EnterSubBlock(bitc::SYNC_SCOPE_NAMES_BLOCK_ID))
1815 return error("Invalid record");
1816
1817 if (!SSIDs.empty())
1818 return error("Invalid multiple synchronization scope names blocks");
1819
1820 SmallVector<uint64_t, 64> Record;
1821 while (true) {
1822 BitstreamEntry Entry = Stream.advanceSkippingSubblocks();
1823 switch (Entry.Kind) {
1824 case BitstreamEntry::SubBlock: // Handled for us already.
1825 case BitstreamEntry::Error:
1826 return error("Malformed block");
1827 case BitstreamEntry::EndBlock:
1828 if (SSIDs.empty())
1829 return error("Invalid empty synchronization scope names block");
1830 return Error::success();
1831 case BitstreamEntry::Record:
1832 // The interesting case.
1833 break;
1834 }
1835
1836 // Synchronization scope names are implicitly mapped to synchronization
1837 // scope IDs by their order.
1838
1839 if (Stream.readRecord(Entry.ID, Record) != bitc::SYNC_SCOPE_NAME)
1840 return error("Invalid record");
1841
1842 SmallString<16> SSN;
1843 if (convertToString(Record, 0, SSN))
1844 return error("Invalid record");
1845
1846 SSIDs.push_back(Context.getOrInsertSyncScopeID(SSN));
1847 Record.clear();
1848 }
1849}
1850
1851/// Associate a value with its name from the given index in the provided record.
1852Expected<Value *> BitcodeReader::recordValue(SmallVectorImpl<uint64_t> &Record,

Callers

nothing calls this directly

Calls 10

successFunction · 0.85
EnterSubBlockMethod · 0.80
errorFunction · 0.70
convertToStringFunction · 0.70
emptyMethod · 0.45
readRecordMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected