[LLVMdev] Re: an error

Vikram Adve vadve at cs.uiuc.edu
Sat Sep 28 17:36:01 PDT 2002


dyn_cast<> will return NULL if i is not an AllocationInst object.

--Vikram
http://www.cs.uiuc.edu/~vadve


> From: Jianzhong Liu <jliu7 at uiuc.edu>
> Sender: jliu7 at cs.uiuc.edu
> Date: Sat, 28 Sep 2002 17:00:04 -0500
> Subject: an error
> 
> I keep getting a core dump error for:
> 
> ...
> const Type *opType = (dyn_cast<AllocationInst>(i))->getAllocatedType();
> if(isa<StructType>(opType) == false)
>     return false;
> ...
> 
> 
> i is a Instruction* type. In fact it's a malloc or alloca instruction. I
> want to determine if its operand is a structure. Thanks!
> 
> Jianzhong
> 
> 
> 
> 





More information about the llvm-dev mailing list