Fix constness problems now that the cast operators preserve the constness
authorChris Lattner <sabre@nondot.org>
Wed, 5 Jun 2002 17:38:28 +0000 (17:38 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 5 Jun 2002 17:38:28 +0000 (17:38 +0000)
of their argument

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2758 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/ConstantReader.cpp
lib/Bytecode/Reader/InstructionReader.cpp

index eb0cadc8ec86642a0470b0e1c670203c082fbcc7..ad27739bb2bd5f113ea84976d00d2475a152b60a 100644 (file)
@@ -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<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
index 9b98d945305c2e5d3b0faf154f1d61513af078d9..0916b2b876aaa8847606cebcd9161a3db129cb4b 100644 (file)
@@ -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<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 @@ 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<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;