From 656c5d652ce10257e90c7693b34336b6ce0ecfa3 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 16 Aug 2022 01:14:28 +0000 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7073828..9731d40 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -113,8 +113,8 @@ using namespace llvm::opt; // Parse misexpect tolerance argument value. // Valid option values are integers in the range [0, 100) -inline Expected> parseToleranceOption(StringRef Arg) { - int64_t Val; +inline Expected> parseToleranceOption(StringRef Arg) { + uint32_t Val; if (Arg.getAsInteger(10, Val)) return llvm::createStringError(llvm::inconvertibleErrorCode(), "Not an integer: %s", Arg.data()); -- cgit v1.1