From: Jonas Devlieghere Date: Tue, 1 Oct 2019 17:41:55 +0000 (+0000) Subject: [JSON] Use LLVM's library for argdumper X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e09adb400b6a7d442d6153bc90c5020a67a9ee52;p=platform%2Fupstream%2Fllvm.git [JSON] Use LLVM's library for argdumper This patch replaces the LLDB's JSON implementation with the one from LLVM in argdumper. Differential revision: https://reviews.llvm.org/D68279 llvm-svn: 373361 --- diff --git a/lldb/tools/argdumper/CMakeLists.txt b/lldb/tools/argdumper/CMakeLists.txt index d076748..9249463 100644 --- a/lldb/tools/argdumper/CMakeLists.txt +++ b/lldb/tools/argdumper/CMakeLists.txt @@ -1,6 +1,6 @@ add_lldb_tool(lldb-argdumper ADD_TO_FRAMEWORK argdumper.cpp - LINK_LIBS - lldbUtility + LINK_COMPONENTS + Support ) diff --git a/lldb/tools/argdumper/argdumper.cpp b/lldb/tools/argdumper/argdumper.cpp index 7fd8999..1cf0d6d 100644 --- a/lldb/tools/argdumper/argdumper.cpp +++ b/lldb/tools/argdumper/argdumper.cpp @@ -6,27 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Utility/JSON.h" -#include "lldb/Utility/StreamString.h" +#include "llvm/Support/JSON.h" -#include - -using namespace lldb_private; +using namespace llvm; int main(int argc, char *argv[]) { - JSONArray::SP arguments(new JSONArray()); + json::Array Arguments; for (int i = 1; i < argc; i++) { - arguments->AppendObject(JSONString::SP(new JSONString(argv[i]))); + Arguments.push_back(argv[i]); } - - JSONObject::SP object(new JSONObject()); - object->SetObject("arguments", arguments); - - StreamString ss; - - object->Write(ss); - - std::cout << ss.GetData() << std::endl; - + llvm::outs() << json::Object({{"arguments", std::move(Arguments)}}); return 0; }