summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2006-12-16 02:15:42 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2006-12-16 02:15:42 +0000
commit4b607748d86b44cc59e5cf3eee194dfd9b0fcd86 (patch)
treedeb29e62faba87d6a7268aa7aad3939fe6d44b50 /lib
parent0b1b9dcf22745b533562134c2f0472098fe085fd (diff)
downloadllvm-4b607748d86b44cc59e5cf3eee194dfd9b0fcd86.tar.gz
llvm-4b607748d86b44cc59e5cf3eee194dfd9b0fcd86.tar.bz2
llvm-4b607748d86b44cc59e5cf3eee194dfd9b0fcd86.tar.xz
The best unbreakage yet, addressing Bill's concerns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveInterval.cpp5
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp5
-rw-r--r--lib/CodeGen/MachineInstr.cpp69
3 files changed, 30 insertions, 49 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index 78c874cbb9..63a80fd16e 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -512,7 +512,6 @@ void LiveInterval::dump() const {
}
-OStream& llvm::operator<<(OStream& os, const LiveRange &LR) {
- if (os.stream()) *os.stream() << LR;
- return os;
+void LiveRange::print(std::ostream &os) const {
+ os << *this;
}
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 39b142a2f3..a626f4fdd1 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -31,11 +31,6 @@ std::ostream& llvm::operator<<(std::ostream &OS, const MachineBasicBlock &MBB) {
return OS;
}
-OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock &MBB) {
- if (OS.stream()) *OS.stream() << MBB;
- return OS;
-}
-
// MBBs start out as #-1. When a MBB is added to a MachineFunction, it
// gets the next available unique MBB number. If it is removed from a
// MachineFunction, it goes back to being #-1.
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index a68442511b..df6205b7d8 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -304,74 +304,61 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
OS << "\n";
}
-std::ostream &llvm::operator<<(std::ostream &os, const MachineInstr &MI) {
+void MachineInstr::print(std::ostream &os) const {
// If the instruction is embedded into a basic block, we can find the target
// info for the instruction.
- if (const MachineBasicBlock *MBB = MI.getParent()) {
+ if (const MachineBasicBlock *MBB = getParent()) {
const MachineFunction *MF = MBB->getParent();
if (MF)
- MI.print(os, &MF->getTarget());
+ print(os, &MF->getTarget());
else
- MI.print(os, 0);
- return os;
+ print(os, 0);
}
// Otherwise, print it out in the "raw" format without symbolic register names
// and such.
- os << MI.getInstrDescriptor()->Name;
+ os << getInstrDescriptor()->Name;
- for (unsigned i = 0, N = MI.getNumOperands(); i < N; i++) {
- os << "\t" << MI.getOperand(i);
- if (MI.getOperand(i).isReg() && MI.getOperand(i).isDef())
+ for (unsigned i = 0, N = getNumOperands(); i < N; i++) {
+ os << "\t" << getOperand(i);
+ if (getOperand(i).isReg() && getOperand(i).isDef())
os << "<d>";
}
- return os << "\n";
+ os << "\n";
}
-std::ostream &llvm::operator<<(std::ostream &OS, const MachineOperand &MO) {
- switch (MO.getType()) {
- case MachineOperand::MO_Register:
- OutputReg(OS, MO.getReg());
+void MachineOperand::print(std::ostream &OS) const {
+ switch (getType()) {
+ case MO_Register:
+ OutputReg(OS, getReg());
break;
- case MachineOperand::MO_Immediate:
- OS << (long)MO.getImmedValue();
+ case MO_Immediate:
+ OS << (long)getImmedValue();
break;
- case MachineOperand::MO_MachineBasicBlock:
+ case MO_MachineBasicBlock:
OS << "<mbb:"
- << ((Value*)MO.getMachineBasicBlock()->getBasicBlock())->getName()
- << "@" << (void*)MO.getMachineBasicBlock() << ">";
+ << ((Value*)getMachineBasicBlock()->getBasicBlock())->getName()
+ << "@" << (void*)getMachineBasicBlock() << ">";
break;
- case MachineOperand::MO_FrameIndex:
- OS << "<fi#" << MO.getFrameIndex() << ">";
+ case MO_FrameIndex:
+ OS << "<fi#" << getFrameIndex() << ">";
break;
- case MachineOperand::MO_ConstantPoolIndex:
- OS << "<cp#" << MO.getConstantPoolIndex() << ">";
+ case MO_ConstantPoolIndex:
+ OS << "<cp#" << getConstantPoolIndex() << ">";
break;
- case MachineOperand::MO_JumpTableIndex:
- OS << "<jt#" << MO.getJumpTableIndex() << ">";
+ case MO_JumpTableIndex:
+ OS << "<jt#" << getJumpTableIndex() << ">";
break;
- case MachineOperand::MO_GlobalAddress:
- OS << "<ga:" << ((Value*)MO.getGlobal())->getName() << ">";
+ case MO_GlobalAddress:
+ OS << "<ga:" << ((Value*)getGlobal())->getName() << ">";
break;
- case MachineOperand::MO_ExternalSymbol:
- OS << "<es:" << MO.getSymbolName() << ">";
+ case MO_ExternalSymbol:
+ OS << "<es:" << getSymbolName() << ">";
break;
default:
assert(0 && "Unrecognized operand type");
break;
}
-
- return OS;
-}
-
-OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) {
- if (os.stream()) *os.stream() << minstr;
- return os;
-}
-
-OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) {
- if (os.stream()) *os.stream() << mop;
- return os;
}