本文整理汇总了C++中ExprNode::OnTrue方法的典型用法代码示例。如果您正苦于以下问题:C++ ExprNode::OnTrue方法的具体用法?C++ ExprNode::OnTrue怎么用?C++ ExprNode::OnTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExprNode
的用法示例。
在下文中一共展示了ExprNode::OnTrue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert_IC_MC
//.........这里部分代码省略.........
} else {
if (IS_FLOAT(type_src1))
src1_regName = convertToInt(src1, os);
os<<"MOVI "<<src1_regName<<" "<<dst_regName;
}
} else if (interCode->getsubCode() == OpNode::OpCode::UMINUS) {
if (IS_FLOAT(type_src1))
src1_regName = convertToInt(src1, os);
os<<"NEG "<<src1_regName<<" "<<dst_regName;
} else if (interCode->getsubCode() == OpNode::OpCode::NOT) {
NOTLogic(src1_regName, dst_regName, os);
IsEndlNeeded = false;
} else if (interCode->getsubCode() == OpNode::OpCode::BITNOT) {
os << "BNOT " << src1_regName << " " << dst_regName;
}
}
if (IsEndlNeeded) os<<endl;
}
break;
}
case LABEL : {
os<<interCode->getLabel()<<endl;
break;
}
case GOTO : {
InterCode* goto_lab = (InterCode*) opndsList[0];
os<<"JMP "<<goto_lab->getLabel() <<endl;
break;
}
case IFREL : {
ExprNode* cond = (ExprNode*) opndsList[0];
InterCode* true_lab = cond->OnTrue();
InterCode* false_lab = cond->OnFalse();
ExprNode* expr1 = (ExprNode*) opndsList[1];
ExprNode* expr2 = (ExprNode*) opndsList[2];
bool if_cond_int = false;
Type *type_src1 = (expr1) ? (expr1->coercedType() ? (Type*)expr1->coercedType() : expr1->type()): NULL ;
Type *type_src2 = (expr2) ? (expr2->coercedType() ? (Type*)expr2->coercedType() : expr2->type()): NULL ;
if (opndsList[2] && opndsList[1])
{
src1_regName = expr1->getRegisterName();
src2_regName = expr2->getRegisterName();
if(!IS_FLOAT(type_src1) && !IS_FLOAT(type_src2))
if_cond_int = true;
else
{
if(!IS_FLOAT(type_src1))
src1_regName = convertToFloat(expr1, os);
if(!IS_FLOAT(type_src2))
src2_regName= convertToFloat(expr2, os);
if_cond_int = false;
}
os<<"JMPC ";
switch(interCode->getsubCode())
{
case OpNode::OpCode::EQ : (if_cond_int) ? os<<"EQ " : os<<"FEQ "; break;
case OpNode::OpCode::NE : (if_cond_int) ? os<<"NE " : os<<"FNE "; break;
case OpNode::OpCode::GT : (if_cond_int) ? os<<"GT " : os<<"FGT "; break;
case OpNode::OpCode::GE : (if_cond_int) ? os<<"GE " : os<<"FGE "; break;