[LLVMdev] Discussion of eliminating the void type

Duncan Sands baldrick at free.fr
Mon May 7 09:05:01 PDT 2012


Hi John,

>>> 4. Re-implement isVoidTy().
>> No! Just delete void type, don't try to create a canonical replacement for it.
>
> The value of still having something like a VoidTy in the API is that it would
> reduce the amount of code that needs to change. Much of our code at Illinois
> uses void type; I imagine lots of other LLVM code (including code in LLVM) does
> as well.

I'm not against having an IRBuilder method that produces some kind of standard
"void type", for example {}, as a convenience, but I don't think that there
should be any such thing in the core APIs.

> Going further, it's not clear to me why people want to get rid of the void type.
> Is there a lot of special casing that would go away if VoidTy were removed?

Probably not that much.  There seem to be about 50 lines in lib/Transforms that
need to special case due to the existence of void type.  Forgetting about void
type would be one mistake that it is no longer be possible to make though, which
seems worthwhile to me.

  All
> of the justification in Chris's note appears, for lack of a better word,
> cosmetic. It's a cleaner design, but the cost of "fixing" the issue seems to
> outweigh its benefit.

In dragonegg there are only 25 lines that use VoidTy.  Getting rid of VoidTy
therefore seems essentially painless to me.

Ciao, Duncan.



More information about the llvm-dev mailing list