Skip to content

Commit f6df5cd

Browse files
[CtxProf] Fix warnings
This patch fixes: llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp:214:14: error: unused variable 'Index' [-Werror,-Wunused-variable] llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp:284:6: error: unused function 'areAllBBsReachable' [-Werror,-Wunused-function]
1 parent 70ff650 commit f6df5cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class ProfileAnnotator final {
216216
"The index must be inside the counters vector by construction - "
217217
"tripping this assertion indicates a bug in how the contextual "
218218
"profile is managed by IPO transforms");
219+
(void)Index;
219220
Count = Counters[Ins->getIndex()->getZExtValue()];
220221
}
221222
auto [It, Ins] =
@@ -280,7 +281,8 @@ class ProfileAnnotator final {
280281
}
281282
};
282283

283-
bool areAllBBsReachable(const Function &F, FunctionAnalysisManager &FAM) {
284+
[[maybe_unused]] bool areAllBBsReachable(const Function &F,
285+
FunctionAnalysisManager &FAM) {
284286
auto &DT = FAM.getResult<DominatorTreeAnalysis>(const_cast<Function &>(F));
285287
return llvm::all_of(
286288
F, [&](const BasicBlock &BB) { return DT.isReachableFromEntry(&BB); });

0 commit comments

Comments
 (0)