From da5581066696da706444b83a5729ea08b9190cd1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 2 Oct 2001 03:41:24 +0000 Subject: Commit more code over to new cast style llvm-svn: 697 --- llvm/lib/AsmParser/llvmAsmParser.y | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'llvm/lib/AsmParser') diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 819f96290f4..a0c96733a0e 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -397,10 +397,9 @@ static void setValueName(Value *V, char *NameStr) { // There is only one case where this is allowed: when we are refining an // opaque type. In this case, Existing will be an opaque type. if (const Type *Ty = cast(Existing)) - if (Ty->isOpaqueType()) { + if (OpaqueType *OpTy = dyn_cast(Ty)) { // We ARE replacing an opaque type! - - cast(Ty)->refineAbstractTypeTo(cast(V)); + OpTy->refineAbstractTypeTo(cast(V)); return; } @@ -1232,7 +1231,7 @@ InstVal : BinaryOps Types ValueRef ',' ValueRef { while ($2->begin() != $2->end()) { if ($2->front().first->getType() != Ty) ThrowException("All elements of a PHI node must be of the same type!"); - ((PHINode*)$$)->addIncoming($2->front().first, $2->front().second); + cast($$)->addIncoming($2->front().first, $2->front().second); $2->pop_front(); } delete $2; // Free the list... @@ -1291,7 +1290,7 @@ MemoryInst : MALLOC Types { delete $2; } | MALLOC Types ',' UINT ValueRef { - if (!(*$2)->isArrayType() || ((const ArrayType*)$2->get())->isSized()) + if (!(*$2)->isArrayType() || cast($2->get())->isSized()) ThrowException("Trying to allocate " + (*$2)->getName() + " as unsized array!"); const Type *Ty = PointerType::get(*$2); @@ -1303,7 +1302,7 @@ MemoryInst : MALLOC Types { delete $2; } | ALLOCA Types ',' UINT ValueRef { - if (!(*$2)->isArrayType() || ((const ArrayType*)$2->get())->isSized()) + if (!(*$2)->isArrayType() || cast($2->get())->isSized()) ThrowException("Trying to allocate " + (*$2)->getName() + " as unsized array!"); const Type *Ty = PointerType::get(*$2); -- cgit v1.2.3