This is an archive of the discontinued LLVM Phabricator instance.

[AST] Add a method to get a call type from an ObjCMessageExpr
ClosedPublic

Authored by george.karpenkov on Jan 24 2019, 4:13 PM.

Details

Summary

Due to references, expression type does not always correspond to an expected method return type (e.g. for a method returning int & the expression type of the call would still be int).
We have a helper method for getting the expected type on CallExpr, but not on ObjCMessageExpr

Diff Detail

Repository
rC Clang

Event Timeline

rjmccall added inline comments.Jan 24 2019, 4:23 PM
clang/include/clang/AST/ExprObjC.h
1185 ↗(On Diff #183434)

Maybe something like:

Get the return type of the message being sent.  This is not always the type of the
message expression itself because of references.  It is also not always the declared
return type of the method because of `instancetype`.
george.karpenkov marked an inline comment as done.
rjmccall accepted this revision.Jan 24 2019, 5:14 PM

Alright.

This revision is now accepted and ready to land.Jan 24 2019, 5:14 PM
This revision was automatically updated to reflect the committed changes.