Skip to content

Commit 4df6e3e

Browse files
committed
move the overall layout to the header
1 parent adc9d32 commit 4df6e3e

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

llvm/include/llvm/CGData/StableFunctionMapRecord.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@
2424

2525
namespace llvm {
2626

27+
/// The structure of the serialized stable function map is as follows:
28+
/// - Number of unique function/module names
29+
/// - Total size of unique function/module names for opt-in skipping
30+
/// - Unique function/module names
31+
/// - Padding to align to 4 bytes
32+
/// - Number of StableFunctionEntries
33+
/// - Hashes of each StableFunctionEntry
34+
/// - Fixed-size fields for each StableFunctionEntry (the order is consistent
35+
/// with the hashes above):
36+
/// - FunctionNameId
37+
/// - ModuleNameId
38+
/// - InstCount
39+
/// - Relative offset to the beginning of IndexOperandHashes for this entry
40+
/// - Total size of variable-sized IndexOperandHashes for lazy-loading support
41+
/// - Variable-sized IndexOperandHashes for each StableFunctionEntry:
42+
/// - Number of IndexOperandHashes
43+
/// - Contents of each IndexOperandHashes
44+
/// - InstIndex
45+
/// - OpndIndex
46+
/// - OpndHash
2747
struct StableFunctionMapRecord {
2848
std::unique_ptr<StableFunctionMap> FunctionMap;
2949

llvm/lib/CGData/StableFunctionMapRecord.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,7 @@ void StableFunctionMapRecord::serialize(
104104
Writer.OS.tell() - NamesByteSizeOffset - sizeof(NamesByteSizeOffset);
105105
PatchItems.emplace_back(NamesByteSizeOffset, &NamesByteSize, 1);
106106

107-
// Write StableFunctionEntries. The structure is:
108-
// - Number of StableFunctionEntries
109-
// - Hashes of StableFunctionEntries
110-
// - Fixed-size fields for each StableFunctionEntry
111-
// - FunctionNameId
112-
// - ModuleNameId
113-
// - InstCount
114-
// - Relative offset to IndexOperandHashes
115-
// - Total size of variable-sized IndexOperandHashes for lazy-loading support
116-
// - Variable-sized IndexOperandHashes for each StableFunctionEntry
117-
// - Number of IndexOperandHashes
118-
// - Contents of each IndexOperandHashes
107+
// Write StableFunctionEntries whose pointers are sorted.
119108
auto FuncEntries = getStableFunctionEntries(*FunctionMap);
120109
Writer.write<uint32_t>(FuncEntries.size());
121110
for (const auto *FuncRef : FuncEntries)

0 commit comments

Comments
 (0)