[Lldb-commits] [PATCH] D24369: [support] copying JSON parser/writer from lldb

Mike Aizatsky via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 9 10:06:17 PDT 2016


aizatsky added a comment.

In https://reviews.llvm.org/D24369#538213, @zturner wrote:

> Having a JSON parser in LLVM seems like a reasonable idea, but I'm afraid the JSON parser that currently exists in LLDB won't do.  As Pavel mentioned, the code has a definite LLDB feel to it, but more importantly it depends on StringExtractor which I think probably doesn't belong in LLVM.  If you want to go down this route, I would start by deleting the StringExtractor changes from this CL.  90% of the stuff StringExtractor is used for, like hex string to number, string to integer, etc are covered by existing LLVM classes or methods.


My rationale was that reusing parser from a child project is better than building anything new from scratch.

> I'm a bit surprised there's not already a json parser in LLVM.  Maybe there's a reason for it.  I think this CL needs a few more reviewers on the LLVM side, so I'm adding a few people.


I can't actually find json parser within clang-tidy. Only references that I see lead eventually to YAML parsing:

tool/ClangTidyMain.cpp
102:JSON array of objects:
138:Specifies a configuration in YAML/JSON format:

ClangTidyOptions.cpp
36:// Map std::pair<int, int> to a JSON array of size 2.

ClangTidyOptions.h
245:/// \brief Parses LineFilter from JSON and stores it to the \p Options.
249:/// \brief Parses configuration from JSON and returns \c ClangTidyOptions or an


https://reviews.llvm.org/D24369





More information about the lldb-commits mailing list