OLD | NEW |
1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// | 1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the Inst class, primarily the various | 10 // This file implements the Inst class, primarily the various |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 Str << "("; | 612 Str << "("; |
613 for (SizeT I = 0; I < getNumArgs(); ++I) { | 613 for (SizeT I = 0; I < getNumArgs(); ++I) { |
614 if (I > 0) | 614 if (I > 0) |
615 Str << ", "; | 615 Str << ", "; |
616 Str << getArg(I)->getType() << " "; | 616 Str << getArg(I)->getType() << " "; |
617 getArg(I)->dump(Func); | 617 getArg(I)->dump(Func); |
618 } | 618 } |
619 Str << ")"; | 619 Str << ")"; |
620 } | 620 } |
621 | 621 |
| 622 const char *InstCast::getCastName(InstCast::OpKind Kind) { |
| 623 size_t Index = static_cast<size_t>(Kind); |
| 624 if (Index < InstCast::OpKind::_num) |
| 625 return InstCastAttributes[Index].DisplayString; |
| 626 llvm_unreachable("Invalid InstCast::OpKind"); |
| 627 return "???"; |
| 628 } |
| 629 |
622 void InstCast::dump(const Cfg *Func) const { | 630 void InstCast::dump(const Cfg *Func) const { |
623 if (!ALLOW_DUMP) | 631 if (!ALLOW_DUMP) |
624 return; | 632 return; |
625 Ostream &Str = Func->getContext()->getStrDump(); | 633 Ostream &Str = Func->getContext()->getStrDump(); |
626 dumpDest(Func); | 634 dumpDest(Func); |
627 Str << " = " << InstCastAttributes[getCastKind()].DisplayString << " " | 635 Str << " = " << getCastName(getCastKind()) << " " << getSrc(0)->getType() |
628 << getSrc(0)->getType() << " "; | 636 << " "; |
629 dumpSources(Func); | 637 dumpSources(Func); |
630 Str << " to " << getDest()->getType(); | 638 Str << " to " << getDest()->getType(); |
631 } | 639 } |
632 | 640 |
633 void InstIcmp::dump(const Cfg *Func) const { | 641 void InstIcmp::dump(const Cfg *Func) const { |
634 if (!ALLOW_DUMP) | 642 if (!ALLOW_DUMP) |
635 return; | 643 return; |
636 Ostream &Str = Func->getContext()->getStrDump(); | 644 Ostream &Str = Func->getContext()->getStrDump(); |
637 dumpDest(Func); | 645 dumpDest(Func); |
638 Str << " = icmp " << InstIcmpAttributes[getCondition()].DisplayString << " " | 646 Str << " = icmp " << InstIcmpAttributes[getCondition()].DisplayString << " " |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 819 |
812 void InstTarget::dump(const Cfg *Func) const { | 820 void InstTarget::dump(const Cfg *Func) const { |
813 if (!ALLOW_DUMP) | 821 if (!ALLOW_DUMP) |
814 return; | 822 return; |
815 Ostream &Str = Func->getContext()->getStrDump(); | 823 Ostream &Str = Func->getContext()->getStrDump(); |
816 Str << "[TARGET] "; | 824 Str << "[TARGET] "; |
817 Inst::dump(Func); | 825 Inst::dump(Func); |
818 } | 826 } |
819 | 827 |
820 } // end of namespace Ice | 828 } // end of namespace Ice |
OLD | NEW |