Ignore:
Timestamp:
Nov 16, 2015, 10:01:04 PM (4 years ago)
Author:
nmedfort
Message:

First stage in making And/Or/Xor? statements n-ary statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/printer_pablos.cpp

    r4870 r4873  
    5656    } else if (const And * pablo_and = dyn_cast<const And>(stmt)) {
    5757        out << pablo_and->getName() << " = (";
    58         print(pablo_and->getExpr1(), out);
    59         out << " & ";
    60         print(pablo_and->getExpr2(), out);
     58        for (unsigned i = 0; i != pablo_and->getNumOperands(); ++i) {
     59            if (i) out << " & ";
     60            print(pablo_and->getOperand(i), out);
     61        }
    6162        out << ")";
    6263    } else if (const Or * pablo_or = dyn_cast<const Or>(stmt)) {
    6364        out << pablo_or->getName() << " = (";
    64         print(pablo_or->getExpr1(), out);
    65         out << " | ";
    66         print(pablo_or->getExpr2(), out);
     65        for (unsigned i = 0; i != pablo_or->getNumOperands(); ++i) {
     66            if (i) out << " | ";
     67            print(pablo_or->getOperand(i), out);
     68        }
    6769        out << ")";
    6870    } else if (const Xor * pablo_xor = dyn_cast<const Xor>(stmt)) {
    6971        out << pablo_xor->getName() << " = (";
    70         print(pablo_xor->getExpr1(), out);
    71         out << " ^ ";
    72         print(pablo_xor->getExpr2(), out);
     72        for (unsigned i = 0; i != pablo_xor->getNumOperands(); ++i) {
     73            if (i) out << " ^ ";
     74            print(pablo_xor->getOperand(i), out);
     75        }
    7376        out << ")";
    7477    } else if (const Sel * pablo_sel = dyn_cast<const Sel>(stmt)) {
Note: See TracChangeset for help on using the changeset viewer.