This is an archive of the discontinued LLVM Phabricator instance.

Pulled out cast detection in TokenAnnotator into its own function
ClosedPublic

Authored by dinesh.d on May 5 2014, 11:21 PM.

Diff Detail

Event Timeline

dinesh.d updated this revision to Diff 9098.May 5 2014, 11:21 PM
dinesh.d retitled this revision from to Pulled out cast detection in TokenAnnotator into its own function.
dinesh.d updated this object.
dinesh.d edited the test plan for this revision. (Show Details)
dinesh.d added reviewers: djasper, klimek.
dinesh.d added a subscriber: Unknown Object (MLST).
dinesh.d updated this revision to Diff 9099.May 5 2014, 11:26 PM

Forgot to add function comment

djasper added inline comments.May 6 2014, 12:59 AM
lib/Format/TokenAnnotator.cpp
827

I think this should return a bool (essentially IsCast..). Otherwise, this is a bit confusing and it gets much harder to understand the what can actually happen here.

828

According to LLVM naming conventions this needs to be TokType.

881

So basically "return IsCast && !ParensAreEmpty;"

dinesh.d updated this revision to Diff 9101.May 6 2014, 1:21 AM

updated as per comments.

djasper accepted this revision.May 6 2014, 1:25 AM
djasper edited edge metadata.

I'd change the name, otherwise looks good.

lib/Format/TokenAnnotator.cpp
821

Lets call this "rParenEndsCast" for now (not really sure what the best name is here).

This revision is now accepted and ready to land.May 6 2014, 1:25 AM
dinesh.d updated this revision to Diff 9102.May 6 2014, 1:32 AM
dinesh.d edited edge metadata.

updated as per comment.

dinesh.d closed this revision.May 6 2014, 2:18 AM

submitted as r208071

Thanks for review and support