Skip to content

Commit 06e0869

Browse files
[BOLT] Fix warnings
This patch fixes: bolt/lib/Profile/StaleProfileMatching.cpp:694:24: error: unused variable 'BinHash' [-Werror,-Wunused-variable] bolt/lib/Profile/YAMLProfileWriter.cpp:206:61: error: missing field 'GUID' initializer [-Werror,-Wmissing-field-initializers] bolt/lib/Profile/YAMLProfileReader.cpp:840:16: error: unused variable 'MatchedWithPseudoProbes' [-Werror,-Wunused-variable]
1 parent 6d91d7c commit 06e0869

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

bolt/lib/Profile/StaleProfileMatching.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ size_t matchWeights(
697697
<< " to BB (index = " << MatchedBlock->Index - 1 << ")"
698698
<< " with hash " << Twine::utohexstr(BinHash.combine())
699699
<< "\n");
700+
(void)BinHash;
700701
uint64_t ExecCount = YamlBB->ExecCount;
701702
// Update matching stats accounting for the matched block.
702703
switch (Method) {

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
837837
const size_t MatchedWithLTOCommonName = matchWithLTOCommonName();
838838
const size_t MatchedWithCallGraph = matchWithCallGraph(BC);
839839
const size_t MatchedWithNameSimilarity = matchWithNameSimilarity(BC);
840-
const size_t MatchedWithPseudoProbes = matchWithPseudoProbes(BC);
840+
[[maybe_unused]] const size_t MatchedWithPseudoProbes =
841+
matchWithPseudoProbes(BC);
841842

842843
for (auto [YamlBF, BF] : llvm::zip_equal(YamlBP.Functions, ProfileBFs))
843844
if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF))

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ YAMLProfileWriter::convertBFInlineTree(const MCPseudoProbeDecoder &Decoder,
203203
else
204204
PrevGUIDIdx = GUIDIdx;
205205
YamlInlineTree.emplace_back(yaml::bolt::InlineTreeNode{
206-
Node.ParentId - PrevParent, Node.InlineSite, GUIDIdx});
206+
Node.ParentId - PrevParent, Node.InlineSite, GUIDIdx, 0, 0});
207207
PrevParent = Node.ParentId;
208208
}
209209
return {YamlInlineTree, InlineTreeNodeId};

0 commit comments

Comments
 (0)