[PATCH] D31992: [clangd] Escape only necessary characters in JSON output

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 13 07:18:15 PDT 2017


klimek added inline comments.


================
Comment at: clangd/Protocol.cpp:26-50
+  for (llvm::StringRef::iterator i = Input.begin(), e = Input.end(); i != e; ++i) {
+    if (*i == '\\')
+      EscapedInput += "\\\\";
+    else if (*i == '"')
+      EscapedInput += "\\\"";
+    // bell
+    else if (*i == 0x07)
----------------
For json we only need the first 2 though, right?


Repository:
  rL LLVM

https://reviews.llvm.org/D31992





More information about the cfe-commits mailing list