Skip to content

Commit 0a1f7f0

Browse files
authored
[ctxprof][nfc] Drop Section in writeFlatSection (#130654)
It matches `writeContextual`, and also, it's not the whole section that's being written there, just a profile, piecemeal.
1 parent 3fb8cb6 commit 0a1f7f0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/include/llvm/ProfileData/PGOCtxProfWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ class PGOCtxProfileWriter final : public ctx_profile::ProfileWriter {
8888
void endContextSection() override;
8989

9090
void startFlatSection();
91-
void writeFlatSection(ctx_profile::GUID Guid, const uint64_t *Buffer,
92-
size_t BufferSize);
91+
void writeFlat(ctx_profile::GUID Guid, const uint64_t *Buffer,
92+
size_t BufferSize);
9393
void endFlatSection();
9494

9595
// constants used in writing which a reader may find useful.

llvm/lib/ProfileData/PGOCtxProfWriter.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ void PGOCtxProfileWriter::writeContextual(const ContextNode &RootNode) {
126126
writeImpl(std::nullopt, RootNode);
127127
}
128128

129-
void PGOCtxProfileWriter::writeFlatSection(ctx_profile::GUID Guid,
130-
const uint64_t *Buffer,
131-
size_t Size) {
129+
void PGOCtxProfileWriter::writeFlat(ctx_profile::GUID Guid,
130+
const uint64_t *Buffer, size_t Size) {
132131
Writer.EnterSubblock(PGOCtxProfileBlockIDs::FlatProfileBlockID, CodeLen);
133132
writeGuid(Guid);
134133
writeCounters({Buffer, Size});
@@ -240,7 +239,7 @@ Error llvm::createCtxProfFromYAML(StringRef Profile, raw_ostream &Out) {
240239
if (!SPR.FlatProfiles.empty()) {
241240
Writer.startFlatSection();
242241
for (const auto &[Guid, Counters] : SPR.FlatProfiles)
243-
Writer.writeFlatSection(Guid, Counters.data(), Counters.size());
242+
Writer.writeFlat(Guid, Counters.data(), Counters.size());
244243
Writer.endFlatSection();
245244
}
246245
if (EC)

0 commit comments

Comments
 (0)