[cfe-dev] Function return type from ReturnStmt

John McCall rjmccall at apple.com
Fri Mar 23 11:09:00 PDT 2012


On Mar 23, 2012, at 1:49 AM, Phil King wrote:
> I'm trying to get the return type for the function associated with a ReturnStmt AST node.
> 
> The type of the return expression is easy as that's available via getRetValue(), but I can't see an obvious way to get the return type of the function (so I can check the two match).

The expression in the ReturnStmt will have been implicitly converted to the return type, so unless you're writing an AST verifier, there is nothing to do here.

You probably want to look past any implicit conversions and see what expression was actually written.

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


More information about the cfe-dev mailing list