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

Side by Side Diff: src/IceInst.cpp

Issue 794823002: Remove using LLVM tools to check correctness of cast operation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues in patch set 4. Created 6 years 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/IceInst.h ('k') | src/PNaClTranslator.cpp » ('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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/IceInst.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698