From b469cf8361014e18457a5e4fb4a81ccf5112d34e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 5 Jun 2002 17:38:28 +0000 Subject: Fix constness problems now that the cast operators preserve the constness of their argument llvm-svn: 2758 --- llvm/lib/Bytecode/Reader/ConstantReader.cpp | 2 +- llvm/lib/Bytecode/Reader/InstructionReader.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Bytecode/Reader') diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp index eb0cadc8ec8..ad27739bb2b 100644 --- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp +++ b/llvm/lib/Bytecode/Reader/ConstantReader.cpp @@ -160,7 +160,7 @@ bool BytecodeParser::parseTypeConstants(const uchar *&Buf, const uchar *EndBuf, // abstract type to use the newty. This also will cause the opaque type // to be deleted... // - cast(Tab[i].get())->refineAbstractTypeTo(NewTy); + ((DerivedType*)Tab[i].get())->refineAbstractTypeTo(NewTy); // This should have replace the old opaque type with the new type in the // value table... or with a preexisting type that was already in the system diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp index 9b98d945305..0916b2b876a 100644 --- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp +++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp @@ -228,9 +228,9 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf, if (M == 0) return failure(true); // Check to make sure we have a pointer to method type - PointerType *PTy = dyn_cast(M->getType()); + const PointerType *PTy = dyn_cast(M->getType()); if (PTy == 0) return failure(true); - FunctionType *MTy = dyn_cast(PTy->getElementType()); + const FunctionType *MTy = dyn_cast(PTy->getElementType()); if (MTy == 0) return failure(true); vector Params; @@ -288,9 +288,9 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf, if (M == 0) return failure(true); // Check to make sure we have a pointer to method type - PointerType *PTy = dyn_cast(M->getType()); + const PointerType *PTy = dyn_cast(M->getType()); if (PTy == 0) return failure(true); - FunctionType *MTy = dyn_cast(PTy->getElementType()); + const FunctionType *MTy = dyn_cast(PTy->getElementType()); if (MTy == 0) return failure(true); vector Params; -- cgit v1.2.3