[PATCH] D16526: Add hasRetValue narrowing matcher for returnStmt

Richard via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 24 23:03:26 PST 2016


LegalizeAdulthood added a comment.

In http://reviews.llvm.org/D16526#334742, @aaron.ballman wrote:

> I get the same behavior from the existing has() matcher -- how is this meant to differ?


Hmm!  Good question.  I suppose it doesn't do anything different.

I was thinking how to write such matching expressions and I looked through the matcher reference and the header file for things related to ReturnStmt and found only `returns`.  It never occurred to me to use `has`.  Not seeing returnStmt mentioned anywhere, it seemed that I couldn't write such matching expressions and needed a new matcher.

So the question remains: is it bad to have a matcher that explicitly models the narrowing for a return statement's return expression when you can achieve the same thing with `has`?


http://reviews.llvm.org/D16526





More information about the cfe-commits mailing list