ioeric added inline comments.

================
Comment at: clangd/index/SymbolCollector.cpp:101
+// we check whether it starts with PROTO_HEADER_COMMENT.
+bool isPrivateProtoSymbol(const NamedDecl &ND) {
+  const auto &SM = ND.getASTContext().getSourceManager();
----------------
sammccall wrote:
> We're going to end up calling this code on every decl/def we see.
> Am I being paranoid by thinking we should check whether the file is a proto 
> once, rather than doing a bunch of string matching every time?
`s/Symbol/Decl/`

We could store a cache in the symbol collector (just need to add another state 
in the class, remember to invalidate for a new ASTContext, make this a member 
etc), but I think the matching is cheap enough?


================
Comment at: clangd/index/SymbolCollector.cpp:112
+
+  auto Name = ND.getName();
+  if (!Name.contains('_'))
----------------
sammccall wrote:
> this asserts if the name is not a simple identifier (Maybe operators or 
> something will trigger this?).
Good catch!


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46751



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

Reply via email to