sammccall accepted this revision.
sammccall added a comment.

Thanks!



================
Comment at: clang-tools-extra/clangd/ASTSignals.cpp:9
+  ASTSignals Signals;
+  llvm::DenseMap<const NamespaceDecl *, llvm::DenseSet<SymbolID>> NSDToSymbols;
+  const SourceManager &SM = AST.getSourceManager();
----------------
this requires storing all the SymbolIDs again.

You could just have a counter instead. The trick is that you're already 
counting the number of times a symbol has been seen...

```
unsigned &SymbolCount = Signals.ReferencedSymbols[ID];
++SymbolCount;
if (SymbolCount == 1) { // first time seeing the symbol
  // increment counter for its namespace
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94424

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to