[PATCH] D42059: [clangd] Improve const-correctness of Symbol->Detail. NFC

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 15 07:56:29 PST 2018


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

LTGM.



================
Comment at: clangd/index/SymbolYAML.cpp:84
+      return nullptr;
+    return new (*static_cast<llvm::BumpPtrAllocator *>(IO.getContext()))
+        T(std::move(*Opt));
----------------
woo, I learnt new thing here. I'd expect a comment, using placement new with the custom allocator  :)


================
Comment at: clangd/index/SymbolYAML.cpp:88
+
+  llvm::Optional<Symbol::Details> Opt;
+};
----------------
The template type should be `T`, I think.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42059





More information about the cfe-commits mailing list