Generalize CaseBlock a bit more:

Rename LHSBB/RHSBB to TrueBB/FalseBB.  Allow the RHS value to be null,
in which case the LHS is treated as a bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31166 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-10-24 17:57:59 +00:00
parent 33644ba8d2
commit 57ab65972e
2 changed files with 82 additions and 65 deletions

View File

@@ -83,17 +83,17 @@ public:
/// case switch statements.
struct CaseBlock {
CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs,
MachineBasicBlock *lhs, MachineBasicBlock *rhs,
MachineBasicBlock *me) :
CC(cc), CmpLHS(cmplhs), CmpRHS(cmprhs), LHSBB(lhs), RHSBB(rhs), ThisBB(me){}
MachineBasicBlock *truebb, MachineBasicBlock *falsebb,
MachineBasicBlock *me)
: CC(cc), CmpLHS(cmplhs), CmpRHS(cmprhs),
TrueBB(truebb), FalseBB(falsebb), ThisBB(me) {}
// CC - the condition code to use for the case block's setcc node
ISD::CondCode CC;
// CmpLHS/CmpRHS - The LHS/RHS of the comparison to emit.
// CmpLHS/CmpRHS - The LHS/RHS of the comparison to emit. If CmpRHS is
// null, CmpLHS is treated as a bool condition for the branch.
Value *CmpLHS, *CmpRHS;
// LHSBB - the block to branch to if the setcc is true
MachineBasicBlock *LHSBB;
// RHSBB - the block to branch to if the setcc is false
MachineBasicBlock *RHSBB;
// TrueBB/FalseBB - the block to branch to if the setcc is true/false.
MachineBasicBlock *TrueBB, *FalseBB;
// ThisBB - the block into which to emit the code for the setcc and branches
MachineBasicBlock *ThisBB;
};