This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Stop capturing trace args if the tracer doesn't need them.
ClosedPublic

Authored by sammccall on Oct 9 2020, 8:22 AM.

Details

Summary

The tracer is now expected to allocate+free the args itself.

Diff Detail

Event Timeline

sammccall created this revision.Oct 9 2020, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2020, 8:22 AM
sammccall requested review of this revision.Oct 9 2020, 8:22 AM
kadircet accepted this revision.Oct 12 2020, 2:30 AM
kadircet added inline comments.
clang-tools-extra/clangd/support/Trace.cpp
91

move this near other fileds?

clang-tools-extra/clangd/support/Trace.h
86

nit: at first i parsed request in RequestArgs as a verb (e.g. i request arguments), which was confusing a little bit. Hence the comment also didn't make much sense, I only managed to error correct after seeing the usage :D

Maybe something like SetRequestArgs to emphasize that one provides request arguments using this lambda rather than receiving them?

This revision is now accepted and ready to land.Oct 12 2020, 2:30 AM
sammccall marked an inline comment as done.Oct 12 2020, 4:23 AM
sammccall added inline comments.
clang-tools-extra/clangd/support/Trace.cpp
91

It's public unlike the other fields, but moved it to the bottom of the public section

303

added assertions here (nonnull and empty) to guard against any API confusion

clang-tools-extra/clangd/support/Trace.h
86

This *is* actually the intention.

Changed to AttachDetails to avoid ambiguity, and rewrote the comment.

sammccall updated this revision to Diff 297555.Oct 12 2020, 4:23 AM
sammccall marked an inline comment as done.

address comments

kadircet accepted this revision.Oct 12 2020, 4:27 AM

still LGTM. thanks!

This revision was landed with ongoing or failed builds.Oct 12 2020, 4:44 AM
This revision was automatically updated to reflect the committed changes.