sammccall added inline comments.

================
Comment at: clangd/JSONRPCDispatcher.cpp:23
+namespace {
+static Key<std::unique_ptr<trace::Span>> TracerKey;
+static Key<json::Expr> IDKey;
----------------
sammccall wrote:
> RequestTracer?
actually, RequestSpan I think - "tracer" is pretty confusing at global scope


================
Comment at: clangd/JSONRPCDispatcher.cpp:70
+
+  SPAN_ATTACH(*Ctx->getExisting(TracerKey), "Reply", Result);
+  Ctx->getPtr(OutKey)->writeMessage(json::obj{
----------------
Depending on a span tracer existing seems needlessly brittle. What about

  if (auto *Tracer = Ctx->get(TracerKey))
    SPAN_ATTACH(*Tracer, ...)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40486



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to