Changeset View
Changeset View
Standalone View
Standalone View
lib/Bitcode/Reader/BitcodeReader.cpp
Show First 20 Lines • Show All 5,361 Lines • ▼ Show 20 Lines | while (true) { | ||||
Record.clear(); | Record.clear(); | ||||
auto BitCode = Stream.readRecord(Entry.ID, Record); | auto BitCode = Stream.readRecord(Entry.ID, Record); | ||||
switch (BitCode) { | switch (BitCode) { | ||||
default: // Default behavior: ignore. | default: // Default behavior: ignore. | ||||
break; | break; | ||||
case bitc::FS_FLAGS: { // [flags] | case bitc::FS_FLAGS: { // [flags] | ||||
uint64_t Flags = Record[0]; | uint64_t Flags = Record[0]; | ||||
// Scan flags. | // Scan flags. | ||||
assert(Flags <= 0x1f && "Unexpected bits in flag"); | assert(Flags <= 0x2f && "Unexpected bits in flag"); | ||||
// 1 bit: WithGlobalValueDeadStripping flag. | // 1 bit: WithGlobalValueDeadStripping flag. | ||||
// Set on combined index only. | // Set on combined index only. | ||||
if (Flags & 0x1) | if (Flags & 0x1) | ||||
TheIndex.setWithGlobalValueDeadStripping(); | TheIndex.setWithGlobalValueDeadStripping(); | ||||
// 1 bit: SkipModuleByDistributedBackend flag. | // 1 bit: SkipModuleByDistributedBackend flag. | ||||
// Set on combined index only. | // Set on combined index only. | ||||
if (Flags & 0x2) | if (Flags & 0x2) | ||||
TheIndex.setSkipModuleByDistributedBackend(); | TheIndex.setSkipModuleByDistributedBackend(); | ||||
// 1 bit: HasSyntheticEntryCounts flag. | // 1 bit: HasSyntheticEntryCounts flag. | ||||
// Set on combined index only. | // Set on combined index only. | ||||
if (Flags & 0x4) | if (Flags & 0x4) | ||||
TheIndex.setHasSyntheticEntryCounts(); | TheIndex.setHasSyntheticEntryCounts(); | ||||
// 1 bit: DisableSplitLTOUnit flag. | // 1 bit: DisableSplitLTOUnit flag. | ||||
// Set on per module indexes. It is up to the client to validate | // Set on per module indexes. It is up to the client to validate | ||||
// the consistency of this flag across modules being linked. | // the consistency of this flag across modules being linked. | ||||
if (Flags & 0x8) | if (Flags & 0x8) | ||||
TheIndex.setEnableSplitLTOUnit(); | TheIndex.setEnableSplitLTOUnit(); | ||||
// 1 bit: PartiallySplitLTOUnits flag. | // 1 bit: PartiallySplitLTOUnits flag. | ||||
// Set on combined index only. | // Set on combined index only. | ||||
if (Flags & 0x10) | if (Flags & 0x10) | ||||
TheIndex.setPartiallySplitLTOUnits(); | TheIndex.setPartiallySplitLTOUnits(); | ||||
// 1 bit: FlattenedProfileUsed flag. | |||||
// Set on per module indexes. This effectively ORs the flag across all | |||||
// modules being linked. | |||||
if (Flags & 0x20) | |||||
TheIndex.setFlattenedProfileUsed(); | |||||
break; | break; | ||||
} | } | ||||
case bitc::FS_VALUE_GUID: { // [valueid, refguid] | case bitc::FS_VALUE_GUID: { // [valueid, refguid] | ||||
uint64_t ValueID = Record[0]; | uint64_t ValueID = Record[0]; | ||||
GlobalValue::GUID RefGUID = Record[1]; | GlobalValue::GUID RefGUID = Record[1]; | ||||
ValueIdToValueInfoMap[ValueID] = | ValueIdToValueInfoMap[ValueID] = | ||||
std::make_pair(TheIndex.getOrInsertValueInfo(RefGUID), RefGUID); | std::make_pair(TheIndex.getOrInsertValueInfo(RefGUID), RefGUID); | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 626 Lines • ▼ Show 20 Lines | while (true) { | ||||
Record.clear(); | Record.clear(); | ||||
auto BitCode = Stream.readRecord(Entry.ID, Record); | auto BitCode = Stream.readRecord(Entry.ID, Record); | ||||
switch (BitCode) { | switch (BitCode) { | ||||
default: // Default behavior: ignore. | default: // Default behavior: ignore. | ||||
break; | break; | ||||
case bitc::FS_FLAGS: { // [flags] | case bitc::FS_FLAGS: { // [flags] | ||||
uint64_t Flags = Record[0]; | uint64_t Flags = Record[0]; | ||||
// Scan flags. | // Scan flags. | ||||
assert(Flags <= 0x1f && "Unexpected bits in flag"); | assert(Flags <= 0x2f && "Unexpected bits in flag"); | ||||
return Flags & 0x8; | return Flags & 0x8; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
llvm_unreachable("Exit infinite loop"); | llvm_unreachable("Exit infinite loop"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |