From 1d87bcf4909b06dcd86320722653341f08b8b396 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 1 Oct 2001 20:11:19 +0000 Subject: Convert more code to use new style casts Eliminate old style casts from value.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@696 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Reader/InstructionReader.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/Bytecode/Reader/InstructionReader.cpp') diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp index 8c3e08ff94..300c40999e 100644 --- a/lib/Bytecode/Reader/InstructionReader.cpp +++ b/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(V)) return failure(true); + Idx.push_back(cast(V)); break; case 3: V = getValue(Type::UByteTy, Raw.Arg2); - if (!V->isConstant()) return failure(true); - Idx.push_back(V->castConstant()); + if (!isa(V)) return failure(true); + Idx.push_back(cast(V)); V = getValue(Type::UByteTy, Raw.Arg3); - if (!V->isConstant()) return failure(true); - Idx.push_back(V->castConstant()); + if (!isa(V)) return failure(true); + Idx.push_back(cast(V)); break; default: V = getValue(Type::UByteTy, Raw.Arg2); - if (!V->isConstant()) return failure(true); - Idx.push_back(V->castConstant()); + if (!isa(V)) return failure(true); + Idx.push_back(cast(V)); vector &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(V)) return failure(true); + Idx.push_back(cast(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(V)) return failure(true); + Idx.push_back(cast(V)); break; default: vector &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(V)) return failure(true); + Idx.push_back(cast(V)); } delete Raw.VarArgs; break; -- cgit v1.2.3