private void EmitLogicalNot(UnaryExpression node)
{
Expression operand = node.Operand;
operand.Accept(this);
IType typeOnStack = PopType();
bool notContext = true;
if (IsBoolOrInt(typeOnStack))
{
EmitIntNot();
}
else if (EmitToBoolIfNeeded(operand, ref notContext))
{
if (!notContext) //we are in a not context and emit to bool is also in a not context
EmitIntNot();//so we do not need any not (false && false => true)
}
else
{
EmitGenericNot();
}
PushBool();
}