Displaying 1 result from an estimated 1 matches for "buildfcallmem".
2009 May 21
3
[LLVMdev] Passing a pointer to a function
...stead!"' failed.
I can try checking the type before building the function, as in:
void
visitLoadInst(LoadInst &I) {
Value *P;
P = I.getPointerOperand();
PointerType* PtrTy = (PointerType*)(P);
Constant* fcall;
if (PtrTy->getElementType()->isInteger()) {
fcall = buildFcallMem(*theModule, "load_int", Type::Int32Ty);
CallInst::Create(fcall, P, "", &I);
} else if (PtrTy->getElementType()->isInteger()){
fcall = buildFcallMem(*theModule, "load_float", Type::FloatTy);
CallInst::Create(fcall, P, "", &I);
}
}...