[PATCH] D98364: [clangd] Use ref counted strings throughout for File Contents

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 10 11:44:10 PST 2021


njames93 added inline comments.


================
Comment at: clang-tools-extra/clangd/ClangdServer.h:195-198
   void addDocument(PathRef File, StringRef Contents,
                    llvm::StringRef Version = "null",
                    WantDiagnostics WD = WantDiagnostics::Auto,
                    bool ForceRebuild = false);
----------------
This overload is now only used for tests, should it be removed and update all the tests that use it to the new version.


================
Comment at: clang-tools-extra/clangd/DraftStore.h:25-28
+std::unique_ptr<llvm::MemoryBuffer>
+getSharedStringBuffer(std::shared_ptr<const std::string> Contents,
+                      StringRef BufferName = "");
+
----------------
This is here for convenience, but should probably go into another header, just unsure if any of them fit the purpose. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98364/new/

https://reviews.llvm.org/D98364



More information about the cfe-commits mailing list