34 std::string member_name{process_expr->getMemberDecl()->getNameAsString()};
37 auto reset_matcher = stmt(
41 memberExpr(hasDeclaration(cxxMethodDecl(hasName(member_name)))).bind(
"cxx_me_proc")
45 cxxMemberCallExpr(callee(cxxMethodDecl(hasName(
"async_reset_signal_is")))).bind(
"cxx_me_async")
52 memberExpr(hasDeclaration(cxxMethodDecl(hasName(member_name)))).bind(
"cxx_me_proc")
56 cxxMemberCallExpr(callee(cxxMethodDecl(hasName(
"reset_signal_is")))).bind(
"cxx_me_sync")
63 finder.addMatcher(reset_matcher,
this);
66 virtual void run(
const MatchFinder::MatchResult& result) {
67 llvm::dbgs() <<
"RESET MATCHER FOUND\n";
70 auto cxx_me_proc{result.Nodes.getNodeAs<clang::MemberExpr>(
"cxx_me_proc")};
72 result.Nodes.getNodeAs<clang::CXXMemberCallExpr>(
"cxx_me_async")};
74 result.Nodes.getNodeAs<clang::CXXMemberCallExpr>(
"cxx_me_sync")};
75 const clang::CXXMemberCallExpr* cxx_me{
nullptr};
87 llvm::dbgs() <<
"SETTING RESET TO TRUE\n";
88 cxx_me = cxx_me_async;
94 const clang::Expr* rsig{cxx_me->getArg(0)->IgnoreImplicit()};
95 const clang::Expr* high_low{cxx_me->getArg(1)->IgnoreImplicit()};
97 if (rsig && high_low) {
98 const clang::MemberExpr* rsig_name =
99 clang::dyn_cast<clang::MemberExpr>(rsig);
101 llvm::dbgs() <<
"high low \n";
104 const clang::CXXBoolLiteralExpr* edge_name =
105 clang::dyn_cast<clang::CXXBoolLiteralExpr>(high_low);
107 if (rsig_name && edge_name) {
108 reset_signal_.first = rsig_name->getMemberDecl()->getNameAsString();
111 edge_.first =
"false";
112 if (edge_name->getValue()) {
113 edge_.first =
"true";
115 edge_.second = high_low;