[PATCH] D50129: [XRay][tools] Use Support/JSON.h in llvm-xray convert

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 00:25:26 PDT 2018


dberris added a comment.

In https://reviews.llvm.org/D50129#1186823, @kpw wrote:

> This is way easier to read now. Did you sanity check loading a trace into chrome trace viewer that it outputs?


Yep!



================
Comment at: llvm/tools/llvm-xray/xray-converter.cpp:324
+             Symbolize ? FuncIdHelper.SymbolOrNumber(StackFunctionNode->FuncId)
+                       : llvm::to_string(StackFunctionNode->FuncId)}},
+    });
----------------
kpw wrote:
> Is it meaningful to have the trailing comma just before the end of the initializer list?
> 
> I am kind of surprised to see that this works.
Not really, but that's valid C++, and is not creating an initializer list (but rather is initializing a `KV`).


================
Comment at: llvm/tools/llvm-xray/xray-converter.cpp:337
+  };
+  OS << formatv("{0:2}", json::Value(std::move(TraceJSON)));
 }
----------------
kpw wrote:
> What does {0:2} mean in this context? Is there a Json particular format provider?
Yep, this pretty-prints with indents of two characters.


https://reviews.llvm.org/D50129





More information about the llvm-commits mailing list