[PATCH] D40489: [clangd] Changed tracing interfaces

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 8 03:12:43 PST 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/Trace.cpp:138
     return;
-  if (!Args)
-    Args = llvm::make_unique<json::obj>();
-  T->event(Ctx, "E",
-           Args ? json::obj{{"args", std::move(*Args)}} : json::obj{});
+  assert(Args && "Args can't be null at this point");
+  T->end_event(Ctx, Name, std::move(*Args));
----------------
sammccall wrote:
> why not?
Because `T` must outlive the `Span`, so we can't really have `if (!T)` evaluate to different things in constructor and destructor.
Am I missing something?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40489





More information about the cfe-commits mailing list