mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[clangd] Add missing GoToStmt in FindTarget.
Summary: so that go-to-def on label can work. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77715
This commit is contained in:
parent
7e62684251
commit
a533b03028
@ -331,6 +331,14 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
void VisitGotoStmt(const GotoStmt *Goto) {
|
||||
if (auto *LabelDecl = Goto->getLabel())
|
||||
Outer.add(LabelDecl, Flags);
|
||||
}
|
||||
void VisitLabelStmt(const LabelStmt *Label) {
|
||||
if (auto *LabelDecl = Label->getDecl())
|
||||
Outer.add(LabelDecl, Flags);
|
||||
}
|
||||
void
|
||||
VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *E) {
|
||||
const Type *BaseType = E->getBaseType().getTypePtrOrNull();
|
||||
|
@ -130,6 +130,22 @@ TEST_F(TargetDeclTest, Exprs) {
|
||||
}
|
||||
)cpp";
|
||||
EXPECT_DECLS("CXXOperatorCallExpr", "void operator()(int n)");
|
||||
|
||||
Code = R"cpp(
|
||||
void test() {
|
||||
goto [[label]];
|
||||
label:
|
||||
return;
|
||||
}
|
||||
)cpp";
|
||||
EXPECT_DECLS("GotoStmt", "label:");
|
||||
Code = R"cpp(
|
||||
void test() {
|
||||
[[label]]:
|
||||
return;
|
||||
}
|
||||
)cpp";
|
||||
EXPECT_DECLS("LabelStmt", "label:");
|
||||
}
|
||||
|
||||
TEST_F(TargetDeclTest, Recovery) {
|
||||
|
Loading…
Reference in New Issue
Block a user