[LLVMdev] Operand, instruction

Duncan Sands baldrick at free.fr
Thu Apr 22 07:13:11 PDT 2010


Hi Ben,

> if (ConstantInt *c = (ConstantInt *) dyn_cast<ConstantInt>(index)){
>    errs()<<  "And it's a constant!!!!!!1111oneone!!  ("<<c->getZExtValue()
> <<  ")\n";
> }

I don't think you need the "(ConstantInt *)" cast.  The getZExtValue will fail
if the constant doesn't fit in 64 bits.

Ciao,

Duncan.



More information about the llvm-dev mailing list