forked from OSchip/llvm-project
Rename StartConditionalBranch/FinishConditionalBranch to BeginConditionalBranch/EndConditionalBranch.
llvm-svn: 95308
This commit is contained in:
parent
c4325486b9
commit
ae612d22ac
|
@ -413,21 +413,21 @@ void AggExprEmitter::VisitConditionalOperator(const ConditionalOperator *E) {
|
|||
|
||||
CGF.EmitBranchOnBoolExpr(E->getCond(), LHSBlock, RHSBlock);
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
CGF.EmitBlock(LHSBlock);
|
||||
|
||||
// Handle the GNU extension for missing LHS.
|
||||
assert(E->getLHS() && "Must have LHS for aggregate value");
|
||||
|
||||
Visit(E->getLHS());
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
CGF.EmitBranch(ContBlock);
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
CGF.EmitBlock(RHSBlock);
|
||||
|
||||
Visit(E->getRHS());
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
CGF.EmitBranch(ContBlock);
|
||||
|
||||
CGF.EmitBlock(ContBlock);
|
||||
|
|
|
@ -1613,10 +1613,10 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) {
|
|||
PI != PE; ++PI)
|
||||
PN->addIncoming(llvm::ConstantInt::getFalse(VMContext), *PI);
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
CGF.EmitBlock(RHSBlock);
|
||||
Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS());
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
|
||||
// Reaquire the RHS block, as there may be subblocks inserted.
|
||||
RHSBlock = Builder.GetInsertBlock();
|
||||
|
@ -1663,13 +1663,13 @@ Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) {
|
|||
PI != PE; ++PI)
|
||||
PN->addIncoming(llvm::ConstantInt::getTrue(VMContext), *PI);
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
|
||||
// Emit the RHS condition as a bool value.
|
||||
CGF.EmitBlock(RHSBlock);
|
||||
Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS());
|
||||
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
|
||||
// Reaquire the RHS block, as there may be subblocks inserted.
|
||||
RHSBlock = Builder.GetInsertBlock();
|
||||
|
@ -1783,7 +1783,7 @@ VisitConditionalOperator(const ConditionalOperator *E) {
|
|||
Builder.CreateCondBr(CondBoolVal, LHSBlock, RHSBlock);
|
||||
}
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
CGF.EmitBlock(LHSBlock);
|
||||
|
||||
// Handle the GNU extension for missing LHS.
|
||||
|
@ -1793,15 +1793,15 @@ VisitConditionalOperator(const ConditionalOperator *E) {
|
|||
else // Perform promotions, to handle cases like "short ?: int"
|
||||
LHS = EmitScalarConversion(CondVal, E->getCond()->getType(), E->getType());
|
||||
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
LHSBlock = Builder.GetInsertBlock();
|
||||
CGF.EmitBranch(ContBlock);
|
||||
|
||||
CGF.StartConditionalBranch();
|
||||
CGF.BeginConditionalBranch();
|
||||
CGF.EmitBlock(RHSBlock);
|
||||
|
||||
Value *RHS = Visit(E->getRHS());
|
||||
CGF.FinishConditionalBranch();
|
||||
CGF.EndConditionalBranch();
|
||||
RHSBlock = Builder.GetInsertBlock();
|
||||
CGF.EmitBranch(ContBlock);
|
||||
|
||||
|
|
|
@ -432,9 +432,9 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond,
|
|||
EmitBlock(LHSTrue);
|
||||
|
||||
// Any temporaries created here are conditional.
|
||||
StartConditionalBranch();
|
||||
BeginConditionalBranch();
|
||||
EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock);
|
||||
FinishConditionalBranch();
|
||||
EndConditionalBranch();
|
||||
|
||||
return;
|
||||
} else if (CondBOp->getOpcode() == BinaryOperator::LOr) {
|
||||
|
@ -459,9 +459,9 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond,
|
|||
EmitBlock(LHSFalse);
|
||||
|
||||
// Any temporaries created here are conditional.
|
||||
StartConditionalBranch();
|
||||
BeginConditionalBranch();
|
||||
EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock);
|
||||
FinishConditionalBranch();
|
||||
EndConditionalBranch();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ public:
|
|||
/// this behavior for branches?
|
||||
void EmitBranchThroughCleanup(llvm::BasicBlock *Dest);
|
||||
|
||||
/// StartConditionalBranch - Should be called before a conditional part of an
|
||||
/// BeginConditionalBranch - Should be called before a conditional part of an
|
||||
/// expression is emitted. For example, before the RHS of the expression below
|
||||
/// is emitted:
|
||||
///
|
||||
|
@ -276,13 +276,13 @@ public:
|
|||
///
|
||||
/// This is used to make sure that any temporaries created in the conditional
|
||||
/// branch are only destroyed if the branch is taken.
|
||||
void StartConditionalBranch() {
|
||||
void BeginConditionalBranch() {
|
||||
++ConditionalBranchLevel;
|
||||
}
|
||||
|
||||
/// FinishConditionalBranch - Should be called after a conditional part of an
|
||||
/// EndConditionalBranch - Should be called after a conditional part of an
|
||||
/// expression has been emitted.
|
||||
void FinishConditionalBranch() {
|
||||
void EndConditionalBranch() {
|
||||
assert(ConditionalBranchLevel != 0 &&
|
||||
"Conditional branch mismatch!");
|
||||
|
||||
|
|
Loading…
Reference in New Issue