[PATCH] D36398: [clangd] Check if CompileCommand has changed on forceReparse.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 09:07:06 PDT 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdUnitStore.cpp:45
+             .first;
+    Result.RemovedFile = nullptr;
+  } else if (!compileCommandsAreEqual(It->second->getCompileCommand(),
----------------
klimek wrote:
> Just say RemovedFile = nullptr in the struct?
I'd argue that having it in the code, rather than declaration makes it more readable. Besides, default ctor of shared_ptr gives us nullptr anyway, so we can also leave it as is and remove the assignments altogether.

I've moved `=nullptr` assignments out of the if/else bodies. Let me know if it still looks ugly.


================
Comment at: clangd/ClangdUnitStore.h:45-48
+  struct RecreateResult {
+    std::shared_ptr<CppFile> FileInCollection;
+    std::shared_ptr<CppFile> RemovedFile;
+  };
----------------
klimek wrote:
> Not obvious to me what things in there mean.
Added a comment. Hopefully makes sense now.


https://reviews.llvm.org/D36398





More information about the cfe-commits mailing list