Converting Value* to GenericValue for runFunction?

I have a list of arguments for a CallInst that I would like to pass to another compiled LLVM function with execEngine->runFunction(). How can I convert all the Values to GenericValues for runFunction?

Some example arguments are types %struct.CPUARMState* %env, %struct.ARMCPRegInfo*, and i64.

I can use LLVMCreateGenericValueOfPointer for the pointer arguments, but I don’t know how to convert the i64.

Thanks!

It seems like what I want is GenericValue ExecutionEngine::getConstantValue(const Constant *C), but this is a protected function. Is there another proper way to do this?