[PATCH] D58774: Moved Symbol into its own header and implementation file

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 28 04:43:42 PST 2019


ioeric added inline comments.


================
Comment at: clang-tools-extra/clangd/index/Index.cpp:19
 
-llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, Symbol::SymbolFlag F) {
-  if (F == Symbol::None)
-    return OS << "None";
-  std::string S;
-  if (F & Symbol::Deprecated)
-    S += "deprecated|";
-  if (F & Symbol::IndexedForCodeCompletion)
-    S += "completion|";
-  return OS << llvm::StringRef(S).rtrim('|');
-}
-
-llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Symbol &S) {
-  return OS << S.Scope << S.Name;
-}
-
-float quality(const Symbol &S) {
-  // This avoids a sharp gradient for tail symbols, and also neatly avoids the
-  // question of whether 0 references means a bad symbol or missing data.
-  if (S.References < 3)
-    return 1;
-  return std::log(S.References);
-}
-
 SymbolSlab::const_iterator SymbolSlab::find(const SymbolID &ID) const {
   auto It = std::lower_bound(
----------------
should also move the implementation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58774





More information about the cfe-commits mailing list