sammccall 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)); ---------------- ilya-biryukov wrote: > 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? I was being disingenuous, I agree with you. But can you change the message to "Changed tracer during a span"? assert(Args) and "Args can't be null at this point" are basically synonyms :-) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D40489 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits