Page MenuHomePhabricator

[clangd] Store references instead of unique_ptrs in ClangdServer.
ClosedPublic

Authored by ilya-biryukov on Jun 13 2017, 7:50 AM.

Details

Summary

ClangdServer was owning objects passed to it in constructor for no good reason.
Lots of stuff was moved from the heap to the stack thanks to this change.

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Jun 13 2017, 7:50 AM
krasimir added inline comments.Jun 13 2017, 8:21 AM
clangd/ClangdLSPServer.h
75 ↗(On Diff #102333)

This approach is still inflexible. I'd make ClangdLSPServer : public DiagnosticsConsumer and pass references to the CompilationDatabase and to the FileSystemProvider to its constructor. I'd create these two in ClangdMain.cpp.

krasimir accepted this revision.Jun 13 2017, 8:22 AM

But, of course, that can be done in a separate commit.

This revision is now accepted and ready to land.Jun 13 2017, 8:22 AM
This revision was automatically updated to reflect the committed changes.