diff options
author | Paul Kirth <paulkirth@google.com> | 2022-08-16 01:14:28 +0000 |
---|---|---|
committer | Paul Kirth <paulkirth@google.com> | 2022-08-17 14:38:53 +0000 |
commit | 656c5d652ce10257e90c7693b34336b6ce0ecfa3 (patch) | |
tree | 8bec8409597fcb3c809400d33e382b3fbc189085 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 6f61594d8cd4cca559b3c87f2fa47d4bdc017c82 (diff) | |
download | llvm-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 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<Optional<uint64_t>> parseToleranceOption(StringRef Arg) { - int64_t Val; +inline Expected<Optional<uint32_t>> parseToleranceOption(StringRef Arg) { + uint32_t Val; if (Arg.getAsInteger(10, Val)) return llvm::createStringError(llvm::inconvertibleErrorCode(), "Not an integer: %s", Arg.data()); |