This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Use getSingleSuccessor() to simplify some code
AbandonedPublic

Authored by craig.topper on Apr 24 2017, 11:14 AM.

Details

Reviewers
jmolloy
Summary

Rather than acquiring the TerminatorInst and asking how many successors it has and comparing to 1 this patch just uses getSingleSuccessor() which should be equivalent.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 24 2017, 11:14 AM
davide added a subscriber: davide.Apr 24 2017, 11:24 AM

Is this just a cleanup or is there any particular reason why you're doing this? I don't find it much more readable, FWIW.

It was just cleanup. I was looking at the code and noticed that it was using getSinglePredecessor, but was taking a longer way to get the single successor.

craig.topper abandoned this revision.May 12 2017, 11:28 AM