================
@@ -915,7 +915,10 @@ Error JSONGenerator::serializeIndex(StringRef RootDir) {
   raw_fd_ostream RootOS(IndexFilePath, FileErr, sys::fs::OF_Text);
   if (FileErr)
     return createFileError("cannot open file " + IndexFilePath, FileErr);
-  RootOS << llvm::formatv("{0:2}", ObjVal);
+  if (CDCtx->CompactJSON)
+    RootOS << llvm::formatv("{0}", ObjVal);
+  else
+    RootOS << llvm::formatv("{0:2}", ObjVal);
----------------
evelez7 wrote:

We could do that if it's preferred. It results in the exact same thing and it 
actually might be more readable. Tbh, I don't really know what this formatv 
substitution really does. I remember choosing this output style from looking at 
how LLVM dumps ELF into JSON, I think. It used this `formatv` approach for 
dumping premade objects and I saw that this was pretty widely used.

https://github.com/llvm/llvm-project/pull/190822
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to