summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-01 20:11:19 +0000
committerChris Lattner <sabre@nondot.org>2001-10-01 20:11:19 +0000
commit38569343868ee3dad90dcdddfb9fee1ca0bcf25f (patch)
tree1b9bc0f2b6911aed0815f3a00945714c26a8a5ce /llvm/lib/Bytecode/Reader/InstructionReader.cpp
parent8f191129239552b876f2c6717fae9619a7701a03 (diff)
downloadbcm5719-llvm-38569343868ee3dad90dcdddfb9fee1ca0bcf25f.tar.gz
bcm5719-llvm-38569343868ee3dad90dcdddfb9fee1ca0bcf25f.zip
Convert more code to use new style casts
Eliminate old style casts from value.h llvm-svn: 696
Diffstat (limited to 'llvm/lib/Bytecode/Reader/InstructionReader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/InstructionReader.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index 8c3e08ff94e..300c40999eb 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
@@ -266,25 +266,25 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
case 0: cerr << "Invalid load encountered!\n"; return failure(true);
case 1: break;
case 2: V = getValue(Type::UByteTy, Raw.Arg2);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
break;
case 3: V = getValue(Type::UByteTy, Raw.Arg2);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
V = getValue(Type::UByteTy, Raw.Arg3);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
break;
default:
V = getValue(Type::UByteTy, Raw.Arg2);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
vector<unsigned> &args = *Raw.VarArgs;
for (unsigned i = 0, E = args.size(); i != E; ++i) {
V = getValue(Type::UByteTy, args[i]);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
}
delete Raw.VarArgs;
break;
@@ -304,15 +304,15 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
case 1: cerr << "Invalid store encountered!\n"; return failure(true);
case 2: break;
case 3: V = getValue(Type::UByteTy, Raw.Arg3);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
break;
default:
vector<unsigned> &args = *Raw.VarArgs;
for (unsigned i = 0, E = args.size(); i != E; ++i) {
V = getValue(Type::UByteTy, args[i]);
- if (!V->isConstant()) return failure(true);
- Idx.push_back(V->castConstant());
+ if (!isa<ConstPoolVal>(V)) return failure(true);
+ Idx.push_back(cast<ConstPoolVal>(V));
}
delete Raw.VarArgs;
break;
OpenPOWER on IntegriCloud