Exemplo n.º 1
0
/*
 * IRInstruction
 */
void printOpcode(std::ostream& os, const IRInstruction* inst,
                 const GuardConstraints* constraints) {
    os << color(ANSI_COLOR_CYAN)
       << opcodeName(inst->op())
       << color(ANSI_COLOR_END)
       ;

    auto const hasTypeParam = inst->hasTypeParam();
    auto const hasExtra = inst->hasExtra();
    auto const isGuard =
        constraints && !inst->isTransient() && isGuardOp(inst->op());

    if (!hasTypeParam && !hasExtra && !isGuard) return;
    os << color(ANSI_COLOR_LIGHT_BLUE) << '<' << color(ANSI_COLOR_END);

    if (hasTypeParam) {
        os << color(ANSI_COLOR_GREEN)
           << inst->typeParam().toString()
           << color(ANSI_COLOR_END)
           ;
        if (hasExtra || isGuard) os << punc(",");
    }

    if (hasExtra) {
        os << color(ANSI_COLOR_GREEN)
           << showExtra(inst->op(), inst->rawExtra())
           << color(ANSI_COLOR_END);
        if (isGuard) os << punc(",");
    }

    if (isGuard) {
        auto it = constraints->guards.find(inst);
        os << (it == constraints->guards.end() ? "unused" : it->second.toString());
    }

    os << color(ANSI_COLOR_LIGHT_BLUE)
       << '>'
       << color(ANSI_COLOR_END);
}
Exemplo n.º 2
0
void SProgressListItem::hideExtra(bool stt)
{
    showExtra( !stt );
}