Author: Jonas Devlieghere Date: 2025-05-11T16:29:53-07:00 New Revision: d129790ae89a106597e19475b6332e73cea663c2
URL: https://github.com/llvm/llvm-project/commit/d129790ae89a106597e19475b6332e73cea663c2 DIFF: https://github.com/llvm/llvm-project/commit/d129790ae89a106597e19475b6332e73cea663c2.diff LOG: [lldb-dap] Remove GetSigned from JSONUtils (NFC) This function was replaced by GetInteger<T> which can handle both signed and unsigned values. It currently had one caller in JSONUtils, which this patch updates. Added: Modified: lldb/tools/lldb-dap/JSONUtils.cpp Removed: ################################################################################ diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp index bd2e6630a126e..279e6d3d93814 100644 --- a/lldb/tools/lldb-dap/JSONUtils.cpp +++ b/lldb/tools/lldb-dap/JSONUtils.cpp @@ -99,19 +99,6 @@ std::optional<bool> GetBoolean(const llvm::json::Object *obj, return std::nullopt; } -std::optional<int64_t> GetSigned(const llvm::json::Object &obj, - llvm::StringRef key) { - return obj.getInteger(key); -} - -std::optional<int64_t> GetSigned(const llvm::json::Object *obj, - llvm::StringRef key) { - if (obj == nullptr) - return std::nullopt; - - return GetSigned(*obj, key); -} - bool ObjectContainsKey(const llvm::json::Object &obj, llvm::StringRef key) { return obj.find(key) != obj.end(); } @@ -263,7 +250,7 @@ void FillResponse(const llvm::json::Object &request, response.try_emplace("seq", (int64_t)0); EmplaceSafeString(response, "command", GetString(request, "command").value_or("")); - const int64_t seq = GetSigned(request, "seq").value_or(0); + const uint64_t seq = GetInteger<uint64_t>(request, "seq").value_or(0); response.try_emplace("request_seq", seq); response.try_emplace("success", true); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits