Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: src/IceInst.cpp

Issue 681783002: Subzero: Refactor newline emission for Inst::emit(). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInstX8632.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 Ostream &Str = Func->getContext()->getStrDump(); 702 Ostream &Str = Func->getContext()->getStrDump();
703 Str << "unreachable"; 703 Str << "unreachable";
704 } 704 }
705 705
706 void InstFakeDef::emit(const Cfg *Func) const { 706 void InstFakeDef::emit(const Cfg *Func) const {
707 Ostream &Str = Func->getContext()->getStrEmit(); 707 Ostream &Str = Func->getContext()->getStrEmit();
708 Str << "\t# "; 708 Str << "\t# ";
709 getDest()->emit(Func); 709 getDest()->emit(Func);
710 Str << " = def.pseudo "; 710 Str << " = def.pseudo ";
711 emitSources(Func); 711 emitSources(Func);
712 Str << "\n";
713 } 712 }
714 713
715 void InstFakeDef::dump(const Cfg *Func) const { 714 void InstFakeDef::dump(const Cfg *Func) const {
716 Ostream &Str = Func->getContext()->getStrDump(); 715 Ostream &Str = Func->getContext()->getStrDump();
717 dumpDest(Func); 716 dumpDest(Func);
718 Str << " = def.pseudo "; 717 Str << " = def.pseudo ";
719 dumpSources(Func); 718 dumpSources(Func);
720 } 719 }
721 720
722 void InstFakeUse::emit(const Cfg *Func) const { 721 void InstFakeUse::emit(const Cfg *Func) const {
723 Ostream &Str = Func->getContext()->getStrEmit(); 722 Ostream &Str = Func->getContext()->getStrEmit();
724 Str << "\t# "; 723 Str << "\t# ";
725 Str << "use.pseudo "; 724 Str << "use.pseudo ";
726 emitSources(Func); 725 emitSources(Func);
727 Str << "\n";
728 } 726 }
729 727
730 void InstFakeUse::dump(const Cfg *Func) const { 728 void InstFakeUse::dump(const Cfg *Func) const {
731 Ostream &Str = Func->getContext()->getStrDump(); 729 Ostream &Str = Func->getContext()->getStrDump();
732 Str << "use.pseudo "; 730 Str << "use.pseudo ";
733 dumpSources(Func); 731 dumpSources(Func);
734 } 732 }
735 733
736 void InstFakeKill::emit(const Cfg *Func) const { 734 void InstFakeKill::emit(const Cfg *Func) const {
737 Ostream &Str = Func->getContext()->getStrEmit(); 735 Ostream &Str = Func->getContext()->getStrEmit();
738 Str << "\t# "; 736 Str << "\t# ";
739 if (Linked->isDeleted()) 737 if (Linked->isDeleted())
740 Str << "// "; 738 Str << "// ";
741 Str << "kill.pseudo "; 739 Str << "kill.pseudo ";
742 emitSources(Func); 740 emitSources(Func);
743 Str << "\n";
744 } 741 }
745 742
746 void InstFakeKill::dump(const Cfg *Func) const { 743 void InstFakeKill::dump(const Cfg *Func) const {
747 Ostream &Str = Func->getContext()->getStrDump(); 744 Ostream &Str = Func->getContext()->getStrDump();
748 if (Linked->isDeleted()) 745 if (Linked->isDeleted())
749 Str << "// "; 746 Str << "// ";
750 Str << "kill.pseudo "; 747 Str << "kill.pseudo ";
751 dumpSources(Func); 748 dumpSources(Func);
752 } 749 }
753 750
754 void InstTarget::dump(const Cfg *Func) const { 751 void InstTarget::dump(const Cfg *Func) const {
755 Ostream &Str = Func->getContext()->getStrDump(); 752 Ostream &Str = Func->getContext()->getStrDump();
756 Str << "[TARGET] "; 753 Str << "[TARGET] ";
757 Inst::dump(Func); 754 Inst::dump(Func);
758 } 755 }
759 756
760 } // end of namespace Ice 757 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698