[PATCH] D16215: ASTMatchers: enable hasBody() matcher for FunctionDecls
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 15 06:16:35 PST 2016
aaron.ballman added a comment.
The examples and test code you use seem to imply that the isDefinition() matcher may be all you need; is isDefinition() insufficient for some reason? If so, can you expand the test cases to cover that particular usage? Also, FunctionDecl::getBody() does more work than FunctionDecl::hasBody() -- it would be better to implement the AST matcher in terms of FunctionDecl::hasBody() instead.
More information about the cfe-commits