summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
committerChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
commitda5581066696da706444b83a5729ea08b9190cd1 (patch)
tree2079bd1429d6b16c94df71bc918fe1f624aa3f2f /llvm/lib/Bytecode/Reader/InstructionReader.cpp
parent38569343868ee3dad90dcdddfb9fee1ca0bcf25f (diff)
downloadbcm5719-llvm-da5581066696da706444b83a5729ea08b9190cd1.tar.gz
bcm5719-llvm-da5581066696da706444b83a5729ea08b9190cd1.zip
Commit more code over to new cast style
llvm-svn: 697
Diffstat (limited to 'llvm/lib/Bytecode/Reader/InstructionReader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/InstructionReader.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index 300c40999eb..b6eec664913 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
@@ -122,11 +122,11 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
delete PN;
return failure(true);
case 2: PN->addIncoming(getValue(Raw.Ty, Raw.Arg1),
- (BasicBlock*)getValue(Type::LabelTy, Raw.Arg2));
+ cast<BasicBlock>(getValue(Type::LabelTy,Raw.Arg2)));
break;
default:
PN->addIncoming(getValue(Raw.Ty, Raw.Arg1),
- (BasicBlock*)getValue(Type::LabelTy, Raw.Arg2));
+ cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)));
if (Raw.VarArgs->size() & 1) {
cerr << "PHI Node with ODD number of arguments!\n";
delete PN;
@@ -135,7 +135,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
vector<unsigned> &args = *Raw.VarArgs;
for (unsigned i = 0; i < args.size(); i+=2)
PN->addIncoming(getValue(Raw.Ty, args[i]),
- (BasicBlock*)getValue(Type::LabelTy, args[i+1]));
+ cast<BasicBlock>(getValue(Type::LabelTy, args[i+1])));
}
delete Raw.VarArgs;
break;
@@ -160,12 +160,12 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
case Instruction::Br:
if (Raw.NumOperands == 1) {
- Res = new BranchInst((BasicBlock*)getValue(Type::LabelTy, Raw.Arg1));
+ Res = new BranchInst(cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg1)));
return false;
} else if (Raw.NumOperands == 3) {
- Res = new BranchInst((BasicBlock*)getValue(Type::LabelTy, Raw.Arg1),
- (BasicBlock*)getValue(Type::LabelTy, Raw.Arg2),
- getValue(Type::BoolTy , Raw.Arg3));
+ Res = new BranchInst(cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg1)),
+ cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)),
+ getValue(Type::BoolTy , Raw.Arg3));
return false;
}
break;
@@ -173,7 +173,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
case Instruction::Switch: {
SwitchInst *I =
new SwitchInst(getValue(Raw.Ty, Raw.Arg1),
- (BasicBlock*)getValue(Type::LabelTy, Raw.Arg2));
+ cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)));
Res = I;
if (Raw.NumOperands < 3) return false; // No destinations? Wierd.
@@ -185,15 +185,15 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
vector<unsigned> &args = *Raw.VarArgs;
for (unsigned i = 0; i < args.size(); i += 2)
- I->dest_push_back((ConstPoolVal*)getValue(Raw.Ty, args[i]),
- (BasicBlock*)getValue(Type::LabelTy, args[i+1]));
+ I->dest_push_back(cast<ConstPoolVal>(getValue(Raw.Ty, args[i])),
+ cast<BasicBlock>(getValue(Type::LabelTy, args[i+1])));
delete Raw.VarArgs;
return false;
}
case Instruction::Call: {
- Method *M = (Method*)getValue(Raw.Ty, Raw.Arg1);
+ Method *M = cast<Method>(getValue(Raw.Ty, Raw.Arg1));
if (M == 0) return failure(true);
vector<Value *> Params;
OpenPOWER on IntegriCloud