aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/MisExpect.cpp
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2022-08-16 01:14:28 +0000
committerPaul Kirth <paulkirth@google.com>2022-08-17 14:38:53 +0000
commit656c5d652ce10257e90c7693b34336b6ce0ecfa3 (patch)
tree8bec8409597fcb3c809400d33e382b3fbc189085 /llvm/lib/Transforms/Utils/MisExpect.cpp
parent6f61594d8cd4cca559b3c87f2fa47d4bdc017c82 (diff)
downloadllvm-656c5d652ce10257e90c7693b34336b6ce0ecfa3.zip
llvm-656c5d652ce10257e90c7693b34336b6ce0ecfa3.tar.gz
llvm-656c5d652ce10257e90c7693b34336b6ce0ecfa3.tar.bz2
[clang][llvm][NFC] Change misexpect's tolerance option to be 32-bit
In D131869 we noticed that we jump through some hoops because we parse the tolerance option used in MisExpect.cpp into a 64-bit integer. This is unnecessary, since the value can only be in the range [0, 100). This patch changes the underlying type to be 32-bit from where it is parsed in Clang through to it's use in LLVM. Reviewed By: jloser Differential Revision: https://reviews.llvm.org/D131935
Diffstat (limited to 'llvm/lib/Transforms/Utils/MisExpect.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/MisExpect.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/MisExpect.cpp b/llvm/lib/Transforms/Utils/MisExpect.cpp
index 8f94902..28649b0 100644
--- a/llvm/lib/Transforms/Utils/MisExpect.cpp
+++ b/llvm/lib/Transforms/Utils/MisExpect.cpp
@@ -58,7 +58,7 @@ static cl::opt<bool> PGOWarnMisExpect(
cl::desc("Use this option to turn on/off "
"warnings about incorrect usage of llvm.expect intrinsics."));
-static cl::opt<unsigned> MisExpectTolerance(
+static cl::opt<uint32_t> MisExpectTolerance(
"misexpect-tolerance", cl::init(0),
cl::desc("Prevents emiting diagnostics when profile counts are "
"within N% of the threshold.."));
@@ -72,7 +72,7 @@ bool isMisExpectDiagEnabled(LLVMContext &Ctx) {
}
uint64_t getMisExpectTolerance(LLVMContext &Ctx) {
- return std::max(static_cast<uint64_t>(MisExpectTolerance),
+ return std::max(static_cast<uint32_t>(MisExpectTolerance),
Ctx.getDiagnosticsMisExpectTolerance());
}