| 14 | namespace util { |
| 15 | |
| 16 | std::vector<const clang::CXXConstructorDecl *> |
| 17 | collectConstructors(const std::vector<clang::ASTUnit *> Srcs) { |
| 18 | const std::string Tag = "Tag"; |
| 19 | std::vector<const clang::CXXConstructorDecl *> Result; |
| 20 | for (auto *Src : Srcs) { |
| 21 | if (!Src) |
| 22 | continue; |
| 23 | |
| 24 | auto &Ctx = Src->getASTContext(); |
| 25 | auto Matcher = cxxConstructorDecl().bind(Tag); |
| 26 | |
| 27 | for (auto &Node : match(Matcher, Ctx)) { |
| 28 | auto *Record = Node.getNodeAs<CXXConstructorDecl>(Tag); |
| 29 | if (!Record) |
| 30 | continue; |
| 31 | Result.emplace_back(Record); |
| 32 | } |
| 33 | } |
| 34 | return Result; |
| 35 | } |
| 36 | |
| 37 | std::vector<const clang::CXXMethodDecl *> |
| 38 | collectNonStaticClassMethods(const std::vector<clang::ASTUnit *> Srcs) { |
no outgoing calls