[llvm] [Support] Remove an unnecessary cast (NFC) (PR #147548)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 08:14:09 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/147548

I is already of int64_t.


>From 1eb47584b413b1a787fe3d74eaf684b706dc6cd0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 8 Jul 2025 07:26:50 -0700
Subject: [PATCH] [Support] Remove an unnecessary cast (NFC)

I is already of int64_t.
---
 llvm/lib/Support/JSON.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp
index e7b762f550d46..d8662340cb3ed 100644
--- a/llvm/lib/Support/JSON.cpp
+++ b/llvm/lib/Support/JSON.cpp
@@ -516,7 +516,7 @@ bool Parser::parseNumber(char First, Value &Out) {
   errno = 0;
   int64_t I = std::strtoll(S.c_str(), &End, 10);
   if (End == S.end() && errno != ERANGE) {
-    Out = int64_t(I);
+    Out = I;
     return true;
   }
   // strtroull has a special handling for negative numbers, but in this



More information about the llvm-commits mailing list