[llvm-dev] Call printf with new args

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 4 13:43:25 PDT 2018


On 4/4/2018 12:38 PM, Dávid Bolvanský via llvm-dev wrote:
> Hello,
>
> My code: (CallInst *CI, IRBuilder<> &B)
>
>     SmallVector<Value *, 8> args;
>     Value *v = B.CreateGlobalString("hi", "str");
>     args.push_back(v);
>     SmallVector<Type*, 8> params;
>     params.push_back(v->getType());
>
>     Module *M = B.GetInsertBlock()->getParent()->getParent();
>
>
>     FunctionType *printfType = FunctionType::get(B.getInt32Ty(), 
> params, true);

This should be "FunctionType::get(B.getInt32Ty(), B.getInt8PtrTy(), true)".

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list