Changeset View
Changeset View
Standalone View
Standalone View
lib/Bitcode/Writer/BitcodeWriter.cpp
Show First 20 Lines • Show All 3,650 Lines • ▼ Show 20 Lines | void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() { | ||||
Stream.EnterSubblock(IsThinLTO ? bitc::GLOBALVAL_SUMMARY_BLOCK_ID | Stream.EnterSubblock(IsThinLTO ? bitc::GLOBALVAL_SUMMARY_BLOCK_ID | ||||
: bitc::FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID, | : bitc::FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID, | ||||
4); | 4); | ||||
Stream.EmitRecord(bitc::FS_VERSION, ArrayRef<uint64_t>{INDEX_VERSION}); | Stream.EmitRecord(bitc::FS_VERSION, ArrayRef<uint64_t>{INDEX_VERSION}); | ||||
// Write the index flags. | // Write the index flags. | ||||
uint64_t Flags = 0; | uint64_t Flags = 0; | ||||
// Bits 1-3 are set only in the combined index, skip them. | // Bits 1-3 and 5 are set only in the combined index, skip them. | ||||
if (Index->enableSplitLTOUnit()) | if (Index->enableSplitLTOUnit()) | ||||
Flags |= 0x8; | Flags |= 0x8; | ||||
if (Index->flattenedProfileUsed()) | |||||
Flags |= 0x20; | |||||
Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Flags}); | Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Flags}); | ||||
if (Index->begin() == Index->end()) { | if (Index->begin() == Index->end()) { | ||||
Stream.ExitBlock(); | Stream.ExitBlock(); | ||||
return; | return; | ||||
} | } | ||||
for (const auto &GVI : valueIds()) { | for (const auto &GVI : valueIds()) { | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | void IndexBitcodeWriter::writeCombinedGlobalValueSummary() { | ||||
if (Index.skipModuleByDistributedBackend()) | if (Index.skipModuleByDistributedBackend()) | ||||
Flags |= 0x2; | Flags |= 0x2; | ||||
if (Index.hasSyntheticEntryCounts()) | if (Index.hasSyntheticEntryCounts()) | ||||
Flags |= 0x4; | Flags |= 0x4; | ||||
if (Index.enableSplitLTOUnit()) | if (Index.enableSplitLTOUnit()) | ||||
Flags |= 0x8; | Flags |= 0x8; | ||||
if (Index.partiallySplitLTOUnits()) | if (Index.partiallySplitLTOUnits()) | ||||
Flags |= 0x10; | Flags |= 0x10; | ||||
if (Index.flattenedProfileUsed()) | |||||
Flags |= 0x20; | |||||
Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Flags}); | Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Flags}); | ||||
for (const auto &GVI : valueIds()) { | for (const auto &GVI : valueIds()) { | ||||
Stream.EmitRecord(bitc::FS_VALUE_GUID, | Stream.EmitRecord(bitc::FS_VALUE_GUID, | ||||
ArrayRef<uint64_t>{GVI.second, GVI.first}); | ArrayRef<uint64_t>{GVI.second, GVI.first}); | ||||
} | } | ||||
// Abbrev for FS_COMBINED. | // Abbrev for FS_COMBINED. | ||||
▲ Show 20 Lines • Show All 743 Lines • Show Last 20 Lines |