Function* func = module->getFunction("my_func"); Value* arg = ConstantInt::get(Type::getInt32Ty(context), 42); vectorargs; args.push_back(arg); CallInst* call = CallInst::Create(func, args, "call");
Function* func = module->getFunction("my_func"); Value* arg = ConstantInt::get(Type::getInt32Ty(context), 42); vectorargs; args.push_back(arg); CallInst* call = CallInst::Create(func, args, "call"); Value* result = call; storeInst(result, var);
Function* func = module->getFunction("my_func"); Value* arg = ConstantFP::get(Type::getFloatTy(context), 3.14); vectorIn this example, we use the FastMathFlags to perform unsafe algebraic optimizations when calling the function. The package library for CallInst is LLVM.args; args.push_back(arg); const FastMathFlags fmf = FastMathFlags().setUnsafeAlgebra(); CallInst* call = builder.CreateCall(func, args, "", /*tail=*/false, /*callee_fmf=*/fmf);