[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 09:48:44 PDT 2018


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

Agree with Kadir's comments.
I'd just suggest reducing boilerplate a bit by taking some shortcuts.



================
Comment at: clangd/index/Index.h:167
 
+enum class SymbolFlag : uint8_t {
+  None = 0,
----------------
enum class is a pain for bitfields.
I'd just make this a plain enum nested inside symbol, then you don't need to define the operators and don't need to cast as often.


================
Comment at: clangd/index/Index.h:268
+  /// FIXME: also add deprecation message and fixit?
+  bool Deprecated() const {
+    return static_cast<bool>(Flags & SymbolFlag::Deprecated);
----------------
kadircet wrote:
> nit: rename to isDeprecated ?
FWIW I don't think these accessors pull their weight: in calller code `if (Sym.Flags & Symbol::IsDeprecated)` is clear enough


================
Comment at: clangd/index/Serialization.cpp:309
 // data. Later we may want to support some backward compatibility.
 constexpr static uint32_t Version = 2;
 
----------------
3


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51724





More information about the cfe-commits mailing list