[LLVMdev] how to add and call a function with void return value in functionpass.

Gang.Yao
Fri, 30 Apr 2010 23:12:21 -0000

Hi:

In a function pass, I tried to create a function which takes a int32 and
return void.
When I call this function with CallInst::Create and using opt, it always has
the error report:

opt: Value.cpp:189: void llvm::Value::setName(const llvm::Twine&): Assertion
`getType() != Type::getVoidTy(getContext()) && "Cannot assign a
name to void
values!"' failed.

if I change the return type to int32, then it works.

so what is the special trick to use a function with void return type.

Any help would be appreciated.

--
--Gang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100430/a0f40ed9/attachment.html>