llir / llvm

Library for interacting with LLVM IR in pure Go.
https://llir.github.io/document/
BSD Zero Clause License
1.19k stars 78 forks source link

Returning void as a value #218

Closed threadedstream closed 2 years ago

threadedstream commented 2 years ago

As per LLVM Language Reference Manual

The void type does not represent any value and has no size.

but NewRet expects a value. Obviously, I cannot pass the type. Is there any work-around?

threadedstream commented 2 years ago

Wouldn't it violate the rules if I write a value wrapper around a void type?

dannypsnl commented 2 years ago

use NewRet(nil)

threadedstream commented 2 years ago

Oh, thank you.