[PATCH] D107703: [AST][clangd] Expose documentation of Attrs on hover.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 9 07:05:38 PDT 2021
aaron.ballman added inline comments.
================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:4220
+ )cpp";
+ std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
+ for (const auto *A : Attrs) {
----------------
FWIW, this will miss `omp::sequence` and `omp::directive`, but that's not the end of the world. May be worth a fixme comment in case we want to solve it someday.
================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:4242
+ llvm::StringRef clang::Attr::getDocumentation(clang::attr::Kind K) {
+ assert(K < llvm::array_lengthof(AttrDoc));
+ return AttrDoc[K];
----------------
Hmmmm, I am not 100% certain this assertion is correct -- the user may have plugin attributes, which I believe are given a "kind" that's larger than the last-known builtin attribute kind.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107703/new/
https://reviews.llvm.org/D107703
More information about the cfe-commits
mailing list