Returning Void from LLVM Function

I have created a function in LLVM IR. Now I want to create a return command return void

.

I saw the Create function ReturnInst::(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd)

But I don't know what should retVal

be it for it to returnreturn void

+4


source to share


2 answers


If you pass nullptr to retVal (which is also the default) that will give you "ret void".



+5


source


This code seems to work: UndefValue::get(Type::getVoidTy(Context))



0


source







All Articles