ckandeler added inline comments.
================ Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:863 + Tok.addModifier(HighlightingModifier::Declaration); + if (const auto Func = dyn_cast<FunctionDecl>(Decl)) { + if (Func->isThisDeclarationADefinition()) ---------------- dgoldman wrote: > Instead of doing it like this, I wonder if would make more sense to call > getDefinition from > https://cs.github.com/llvm/llvm-project/blob/ae071a59bc6cc09e0e0043e0ef1d9725853f1681/clang-tools-extra/clangd/XRefs.cpp#L76 > and if it matches Decl, add the Definition modifier? Won't that incur an additional look-up or some other type of work? I'm not deeply familiar with the implementation, but a cursory glance seems to suggests that isThisDeclarationADefinition() is just an accessor, while getDefinition() "does things". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127403/new/ https://reviews.llvm.org/D127403 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits