[LLVMdev] Explanation

Renato Golin rengolin at systemcall.org
Mon Jun 6 14:12:06 PDT 2011


On 6 June 2011 21:48, John McCall <rjmccall at apple.com> wrote:
> The more idiomatic way would be:
>  if (const PointerType *Ptr = dyn_cast<PointerType>(T))
>    if (Ptr->getElementType()->isIntegerTy(32))
>      cout << "Yeah!" << endl;

Nice! I was stuck with get-size-in-bits for years and never bothered
to look for an alternative, thanks! ;)

cheers,
--renato




More information about the llvm-dev mailing list