I create a llvm::Value* from a integer constant like this:
llvm::Value* constValue = llvm::ConstantInt::get( llvmContext , llvm::APInt( node->someInt() ));
now i want to retrieve the compile-time constant value back;
int constIntValue = constValue->???
The examples shown in LLVM Programmer manual seem to imply that cast<> will accept a pointer when using the type (rather than the type plus pointer) template parameter, however i'm pretty sure thats failing as from 2.8:
llvm::Value* foo = 0;
llvm::ConstantInt* intValue = & llvm::cast< llvm::ConstantInt , llvm::Value >(foo );
//build error:
//error: no matching function for call to ‘cast(llvm::Value*&)’
What would be the correct approach here?