Skip to content

[clang][test] remove unused run overload in BoundNodesCallback #94244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,8 +2030,6 @@ TEST_P(ASTMatchersTest,
template <typename T>
class VerifyAncestorHasChildIsEqual : public BoundNodesCallback {
public:
bool run(const BoundNodes *Nodes) override { return false; }

bool run(const BoundNodes *Nodes, ASTContext *Context) override {
const T *Node = Nodes->getNodeAs<T>("");
return verify(*Nodes, *Context, Node);
Expand Down
7 changes: 1 addition & 6 deletions clang/unittests/ASTMatchers/ASTMatchersTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using clang::tooling::runToolOnCodeWithArgs;
class BoundNodesCallback {
public:
virtual ~BoundNodesCallback() {}
virtual bool run(const BoundNodes *BoundNodes) = 0;
virtual bool run(const BoundNodes *BoundNodes, ASTContext *Context) = 0;
virtual void onEndOfTranslationUnit() {}
};
Expand Down Expand Up @@ -403,7 +402,7 @@ template <typename T> class VerifyIdIsBoundTo : public BoundNodesCallback {
EXPECT_EQ("", Name);
}

bool run(const BoundNodes *Nodes) override {
bool run(const BoundNodes *Nodes, ASTContext * /*Context*/) override {
const BoundNodes::IDToNodeMap &M = Nodes->getMap();
if (Nodes->getNodeAs<T>(Id)) {
++Count;
Expand All @@ -426,10 +425,6 @@ template <typename T> class VerifyIdIsBoundTo : public BoundNodesCallback {
return false;
}

bool run(const BoundNodes *Nodes, ASTContext *Context) override {
return run(Nodes);
}

private:
const std::string Id;
const int ExpectedCount;
Expand Down
15 changes: 4 additions & 11 deletions clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5641,7 +5641,6 @@ TEST(HasParent, MatchesAllParents) {
TEST(HasParent, NoDuplicateParents) {
class HasDuplicateParents : public BoundNodesCallback {
public:
bool run(const BoundNodes *Nodes) override { return false; }
bool run(const BoundNodes *Nodes, ASTContext *Context) override {
const Stmt *Node = Nodes->getNodeAs<Stmt>("node");
std::set<const void *> Parents;
Expand Down Expand Up @@ -5850,16 +5849,14 @@ template <typename T> class VerifyMatchOnNode : public BoundNodesCallback {
public:
VerifyMatchOnNode(StringRef Id, const internal::Matcher<T> &InnerMatcher,
StringRef InnerId)
: Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) {
}

bool run(const BoundNodes *Nodes) override { return false; }
: Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) {}

bool run(const BoundNodes *Nodes, ASTContext *Context) override {
const T *Node = Nodes->getNodeAs<T>(Id);
return selectFirst<T>(InnerId, match(InnerMatcher, *Node, *Context)) !=
nullptr;
nullptr;
}

private:
std::string Id;
internal::Matcher<T> InnerMatcher;
Expand Down Expand Up @@ -6053,7 +6050,7 @@ namespace {
class ForCallablePreservesBindingWithMultipleParentsTestCallback
: public BoundNodesCallback {
public:
bool run(const BoundNodes *BoundNodes) override {
bool run(const BoundNodes *BoundNodes, ASTContext *Context) override {
FunctionDecl const *FunDecl =
BoundNodes->getNodeAs<FunctionDecl>("funDecl");
// Validate test assumptions. This would be expressed as ASSERT_* in
Expand Down Expand Up @@ -6090,10 +6087,6 @@ class ForCallablePreservesBindingWithMultipleParentsTestCallback
return true;
}

bool run(const BoundNodes *BoundNodes, ASTContext *Context) override {
return run(BoundNodes);
}

private:
void ExpectCorrectResult(StringRef LogInfo,
ArrayRef<BoundNodes> Results) const {
Expand Down
Loading