Esempio n. 1
0
std::ostream &
Symbol::print (std::ostream &out, int maxvals) const
{
    out << Symbol::symtype_shortname(symtype())
        << " " << typespec().string() << " " << name();
    if (everused())
        out << " (used " << firstuse() << ' ' << lastuse()
            << " read " << firstread() << ' ' << lastread()
            << " write " << firstwrite() << ' ' << lastwrite();
    else
        out << " (unused";
    out << (has_derivs() ? " derivs" : "") << ")";
    if (symtype() == SymTypeParam || symtype() == SymTypeOutputParam) {
        if (has_init_ops())
            out << " init [" << initbegin() << ',' << initend() << ")";
        if (connected())
            out << " connected";
        if (connected_down())
            out << " down-connected";
        if (!connected() && !connected_down())
            out << " unconnected";
        if (renderer_output())
            out << " renderer-output";
        if (symtype() == SymTypeParam && ! lockgeom())
            out << " lockgeom=0";
    }
    out << "\n";
    if (symtype() == SymTypeConst) {
        out << "\tconst: ";
        print_vals (out, maxvals);
        out << "\n";
    } else if (symtype() == SymTypeParam || symtype() == SymTypeOutputParam) {
        if (valuesource() == Symbol::DefaultVal && !has_init_ops()) {
            out << "\tdefault: ";
            print_vals (out, maxvals);
            out << "\n";
        } else if (valuesource() == Symbol::InstanceVal) {
            out << "\tvalue: ";
            print_vals (out, maxvals);
            out << "\n";
        }
    }
    return out;
}
Esempio n. 2
0
File: ex44.c Progetto: Gatzy118/cil
int main() {
    return foo() + firstuse();
}