private void EmitConditional(FleeILGenerator ilg, IServiceProvider services) { Label falseLabel = ilg.DefineLabel(); Label endLabel = ilg.DefineLabel(); // Emit the condition _myCondition.Emit(ilg, services); // On false go to the false operand ilg.EmitBranchFalse(falseLabel); // Emit the true operand _myWhenTrue.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(_myWhenTrue.ResultType, _myResultType, ilg); // Jump to end ilg.EmitBranch(endLabel); ilg.MarkLabel(falseLabel); // Emit the false operand _myWhenFalse.Emit(ilg, services); ImplicitConverter.EmitImplicitConvert(_myWhenFalse.ResultType, _myResultType, ilg); // Fall through to end ilg.MarkLabel(endLabel); }
private static void EmitBranch(AndOrElement op, FleeILGenerator ilg, Label target, ShortCircuitInfo info) { // Get the branch opcode if (op._myOperation == AndOrOperation.And) { ilg.EmitBranchFalse(target); } else { ilg.EmitBranchTrue(target); } }