Fix constness problems now that the cast operators preserve the constness
of their argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2758 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index eb0cadc..ad27739 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -160,7 +160,7 @@
// abstract type to use the newty. This also will cause the opaque type
// to be deleted...
//
- cast<DerivedType>(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/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp
index 9b98d94..0916b2b 100644
--- a/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/lib/Bytecode/Reader/InstructionReader.cpp
@@ -228,9 +228,9 @@
if (M == 0) return failure(true);
// Check to make sure we have a pointer to method type
- PointerType *PTy = dyn_cast<PointerType>(M->getType());
+ const PointerType *PTy = dyn_cast<PointerType>(M->getType());
if (PTy == 0) return failure(true);
- FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
+ const FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;
@@ -288,9 +288,9 @@
if (M == 0) return failure(true);
// Check to make sure we have a pointer to method type
- PointerType *PTy = dyn_cast<PointerType>(M->getType());
+ const PointerType *PTy = dyn_cast<PointerType>(M->getType());
if (PTy == 0) return failure(true);
- FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
+ const FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;