--------------------------------------------------------------
| 560 | |
| 561 | // -------------------------------------------------------------- |
| 562 | void |
| 563 | ArrayVariable::Output(std::ostream &out) const |
| 564 | { |
| 565 | if (collective == 0) { |
| 566 | out << get_actual_name(); |
| 567 | } |
| 568 | // for itemized array variables, output the modularized index |
| 569 | else { |
| 570 | out << get_actual_name(); |
| 571 | assert(!indices.empty()); |
| 572 | size_t i; |
| 573 | for (i=0; i<indices.size(); i++) { |
| 574 | if (1) { //indices[i]->less_than(sizes[i])) { |
| 575 | out << "["; |
| 576 | indices[i]->Output(out); |
| 577 | out << "]"; |
| 578 | } |
| 579 | else { |
| 580 | out << "["; |
| 581 | const Type* t = &(indices[i]->get_type()); |
| 582 | // cast signed variable to it's corresponding unsigned type, just in case we get a negative index |
| 583 | if (t->is_signed()) { |
| 584 | const Type* unsigned_type = t->to_unsigned(); |
| 585 | assert(unsigned_type); |
| 586 | out << "("; |
| 587 | unsigned_type->Output(out); |
| 588 | out << ")"; |
| 589 | } |
| 590 | out << "("; |
| 591 | indices[i]->Output(out); |
| 592 | out << ") % " << sizes[i] << "]"; |
| 593 | } |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | void |
| 599 | ArrayVariable::OutputUpperBound(std::ostream &out) const |
no test coverage detected