Page MenuHomePhabricator

TII: Add documentation about conditional exits. NFC
Needs ReviewPublic

Authored by iteratee on May 31 2016, 4:07 PM.

Details

Reviewers
echristo
Summary

Currently the documented API for AnalyzeBranch leaves no place for
conditional returns. This leaves a blindspot after shrinkwrapping on
platforms with conditional return instructions.

The existing API can be used to handle conditional returns by using a null TBB
and a non-empty condition list. A null TBB should never mean fallthrough with a
non-empty condition list, as that wouldn't make any sense. This leaves a
natural way to represent conditional return branches.

Next up is to add support to PPC for AnalyzeBranch and conditional
return.

Diff Detail

Event Timeline

iteratee updated this revision to Diff 59146.May 31 2016, 4:07 PM
iteratee retitled this revision from to TII: Add documentation about conditional exits. NFC.
iteratee updated this object.
iteratee set the repository for this revision to rL LLVM.
iteratee added a subscriber: llvm-commits.
echristo added a subscriber: echristo.

So, I'll propose a different suggestion:

TII::BranchInfo {

enum { } // Types of branches.
// Arguments to the function with accessors

}

which encapsulates the existing arguments to make the code a bit more extensible and much easier to read. Then we can extend it for conditional return as a fairly straightforward change.

Sound good?

-eric