ilya-biryukov added a comment.
Thanks! This looks like a useful addition.
Could you add a test into `libIndex` for this too? Just for the sake of having
better coverage, some folks probably don't run `clang-tools-extra` tests.
Also, could we add a test that a label does not get indexed if local function
indexing is off?
================
Comment at: clang/lib/Index/IndexBody.cpp:148
+ bool VisitGotoStmt(GotoStmt *S) {
+ if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
+ return IndexCtx.handleReference(S->getLabel(), S->getLabelLoc(), Parent,
----------------
`IndexingContext::handleReference` already has this check, we should call
`handleReference` unconditionally.
================
Comment at: clang/lib/Index/IndexBody.cpp:158
+ if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
+ return IndexCtx.handleReference(S->getDecl(), S->getIdentLoc(), Parent,
+ ParentDC, {});
----------------
We should call `handleDecl`, indexing output can differentiate between a
declarations and a references.
`LabelStmt` is exactly the node that declares a `LabelDecl`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150124/new/
https://reviews.llvm.org/D150124
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits