[LLVMdev] How to get the exact integer from a Value
weixuegong at gmail.com
Thu Sep 5 19:32:18 PDT 2013
I have a Value* type named indexValue, and the type is i32.
I think "indexValue" must hold a number which type is int.
Now I want to use the exact number which pointed by indexValue , so I do
ConstantInt* CI = llvm::cast<llvm::ConstantInt>(indexValue); //This is
wrong, so is dyn_cast.
uint64_t index = indexValue->getZExtValue();
uint64_t size = index + 1;
I don't know if it is the right way.
So, could anybody tell the way to get the integer content from a Value*
which type is i32?
I'll be very very grateful if there is any answer.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev