diff options
author | Chris Lattner <sabre@nondot.org> | 2001-06-27 23:41:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-06-27 23:41:11 +0000 |
commit | 7fc9fe34390c66ca58646d09a87f7dbaacb6c1f8 (patch) | |
tree | fd083cad8506b9f54d19b8429dfae825f264c35b /lib/VMCore/AsmWriter.cpp | |
parent | 138a124f09de272b2ab93cfd6e2a8a283d18029b (diff) |
Miscellaneous cleanups:
* Convert post to pre-increment for for loops
* Use generic programming more
* Use new Value::cast* instructions
* Use new Module, Method, & BasicBlock forwarding methods
* Use new facilities in STLExtras.h
* Use new Instruction::isPHINode() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 97affccfbc..c68cd796f1 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -178,7 +178,7 @@ bool AssemblyWriter::processInstruction(const Instruction *I) { writeOperand(I->getOperand(op+1), true); } Out << "\n\t]"; - } else if (I->getInstType() == Instruction::PHINode) { + } else if (I->isPHINode()) { Out << " " << Operand->getType(); Out << " ["; writeOperand(Operand, false); Out << ","; @@ -262,7 +262,7 @@ void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType, } else { int Slot = Table.getValSlot(Operand); - if (Operand->getValueType() == Value::ConstantVal) { + if (Operand->isConstant()) { Out << " " << ((ConstPoolVal*)Operand)->getStrValue(); } else { if (Slot >= 0) Out << " %" << Slot; @@ -313,12 +313,11 @@ void WriteToAssembly(const ConstPoolVal *CPV, ostream &o) { // A Constant pool value may have a parent that is either a method or a // module. Untangle this now... // - if (CPV->getParent() == 0 || - CPV->getParent()->getValueType() == Value::MethodVal) { + if (CPV->getParent() == 0 || CPV->getParent()->isMethod()) { SlotTable = new SlotCalculator((Method*)CPV->getParent(), true); } else { - assert(CPV->getParent()->getValueType() == Value::ModuleVal); - SlotTable = new SlotCalculator((Module*)CPV->getParent(), true); + SlotTable = + new SlotCalculator(CPV->getParent()->castModuleAsserting(), true); } AssemblyWriter W(o, *SlotTable); |