[cfe-dev] AST matchers and const ASTContext

Julian Bangert via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 2 14:42:13 PDT 2016


is there a particular reason why clang::ast_matchers::match (
requires a non-const reference to a clang::ASTContext, but the matchresuly
only has a const clang::ASTContext *field? This makes it hard to further
apply matchers on the match result.

At least conceptually, shouldn't the AST matcher not modify the AST it
operates on (and therefore be able to accept a const context)?
If  the AST matcher has state that some matchers might modify, should we
instead return a mutable ASTContext in matchresult?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160902/cb7b8c1f/attachment.html>

More information about the cfe-dev mailing list