[Lldb-commits] [PATCH] D68279: [JSON] Use LLVM's library for argdumper

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 1 10:40:11 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373361: [JSON] Use LLVM's library for argdumper (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D68279?vs=222639&id=222647#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68279/new/

https://reviews.llvm.org/D68279

Files:
  lldb/trunk/tools/argdumper/CMakeLists.txt
  lldb/trunk/tools/argdumper/argdumper.cpp


Index: lldb/trunk/tools/argdumper/CMakeLists.txt
===================================================================
--- lldb/trunk/tools/argdumper/CMakeLists.txt
+++ lldb/trunk/tools/argdumper/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_lldb_tool(lldb-argdumper ADD_TO_FRAMEWORK
   argdumper.cpp
 
-  LINK_LIBS
-    lldbUtility
+  LINK_COMPONENTS
+    Support
 )
Index: lldb/trunk/tools/argdumper/argdumper.cpp
===================================================================
--- lldb/trunk/tools/argdumper/argdumper.cpp
+++ lldb/trunk/tools/argdumper/argdumper.cpp
@@ -6,27 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Utility/JSON.h"
-#include "lldb/Utility/StreamString.h"
+#include "llvm/Support/JSON.h"
 
-#include <iostream>
-
-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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68279.222647.patch
Type: text/x-patch
Size: 1380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191001/96f9aaca/attachment-0001.bin>


More information about the lldb-commits mailing list