This is an archive of the discontinued LLVM Phabricator instance.

Include function return type in JSON AST dumps.
Needs ReviewPublic

Authored by rokups on Feb 9 2021, 7:52 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

For some reason return type was not included. Even though it is present
in full type dump, it is not good enough as C++ types can get quite
complex. Besides there is no way to get a desugared version of the type
from function type string. Patch uses "returnType" json key, just like
ObjCMethodDecl dumper. I also updated tests. If anything is missing -
please let me know.

Diff Detail

Event Timeline

rokups requested review of this revision.Feb 9 2021, 7:52 AM
rokups created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2021, 7:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This seems to not be good enough, however. Somehow desugared version of type is not added anywhere.

Merge it, please. I badly need this field.

Hey @Temtaime,
Until we can rely on this i opted in for poor man's workaround - splitting type/qualType field at the first ( and using first part. I realize it is not reliable and will break when function pointers are used, but since they arent in my project that is an acceptable short term workaround.