diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-10-01 20:11:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-10-01 20:11:19 +0000 |
| commit | 38569343868ee3dad90dcdddfb9fee1ca0bcf25f (patch) | |
| tree | 1b9bc0f2b6911aed0815f3a00945714c26a8a5ce /llvm/lib/CodeGen/MachineInstr.cpp | |
| parent | 8f191129239552b876f2c6717fae9619a7701a03 (diff) | |
| download | llvm-38569343868ee3dad90dcdddfb9fee1ca0bcf25f.zip llvm-38569343868ee3dad90dcdddfb9fee1ca0bcf25f.tar.gz llvm-38569343868ee3dad90dcdddfb9fee1ca0bcf25f.tar.bz2 | |
Convert more code to use new style casts
Eliminate old style casts from value.h
llvm-svn: 696
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 1e33007..6407628 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -141,7 +141,7 @@ operator<<(ostream &os, const MachineOperand &mop) case MachineOperand::MO_PCRelativeDisp: { const Value* opVal = mop.getVRegValue(); - bool isLabel = opVal->isMethod() || opVal->isBasicBlock(); + bool isLabel = isa<Method>(opVal) || isa<BasicBlock>(opVal); return os << "%disp(" << (isLabel? "label " : "addr-of-val ") << opVal << ")"; @@ -221,7 +221,7 @@ Set3OperandsFromInstrJUNK(MachineInstr* minstr, minstr->SetMachineOperand(op1Position, /*regNum*/ target.zeroRegNum); else { - if (op1Value->isConstant()) + if (isa<ConstPoolVal>(op1Value)) { // value is constant and must be loaded from constant pool returnFlags = returnFlags | (1 << op1Position); @@ -247,7 +247,7 @@ Set3OperandsFromInstrJUNK(MachineInstr* minstr, minstr->SetMachineOperand(op2Position, machineRegNum); else if (op2type == MachineOperand::MO_VirtualRegister) { - if (op2Value->isConstant()) + if (isa<ConstPoolVal>(op2Value)) { // value is constant and must be loaded from constant pool returnFlags = returnFlags | (1 << op2Position); @@ -318,7 +318,7 @@ ChooseRegOrImmed(Value* val, // Check for the common case first: argument is not constant // - ConstPoolVal *CPV = val->castConstant(); + ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(val); if (!CPV) return opType; if (CPV->getType() == Type::BoolTy) |
