================ @@ -79,21 +81,39 @@ static std::string getDREAncestorString(const DeclRefExpr *DRE, } // namespace #endif /* NDEBUG */ -namespace clang::ast_matchers { +class CustomMatcher { +public: + virtual bool matches(const DynTypedNode &DynNode, ASTContext &Ctx, + const UnsafeBufferUsageHandler &Handler) = 0; + virtual ~CustomMatcher() = default; +}; + +struct MatchResult { +public: + std::map<std::string, DynTypedNode> ---------------- ilya-biryukov wrote:
NIT: Use `llvm::StringMap` for better performance and more idiomatic code. NIT2: `llvm::SmallDenseMap` might be a little more involved, but may result in even better performance. I would probably still recommend starting with `StringMap` first and only going to the other one if/when someone proves it's useful with a benchmark. https://github.com/llvm/llvm-project/pull/124554 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits