This patch fixes a warning from -Wunused-but-set-variable
MismatchedBranches are counted, but are never reported.
Since evaluateProfileData() should already identify and report
these cases, we can safely remove the unused variable.
Details
- Reviewers
rafauler Amir maksfb - Commits
- rG625e0e611b40: [BOLT] [NFC] Remove unused variable
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm unsure if this is the right thing to do here, but I wanted to fix the waring, or pull in someone who has better understanding of the right approach
Thanks for finding this issue. This was originally introduced in d15b93badec2ffdfc6e5a01b9386cdefb4ea59ac by @maksfb . I'm not sure he had the intent of reporting these, probably not. By looking at the code now, when we reach these lines, we should've already gone through a call to evaluateProfileData, which is the real function that is taking care of seeing how many mismatches we have and reporting these. That's why I see no reason to report this here, so you can change this diff to just remove the declaration of MismatchedBranches and ++MismatchedBranches++.
Thanks for the feedback. Removing the variable was another approach I considered, but it seemed important. Since its redundant, I'll just update the patch as you've suggested.
Since reporting mismatched branches here is redundant, we can just remove the unused variable