Hi, I'm interested in adding support for void values (i.e. unit types) to LLVM. Currently, "void" is only allowed as the return value of a function, and numerous assertions are in place to check this. This document [1] that Google pulled up seems to suggest that this idea was planned: > Finally, one annoying, but trivial, nuance of the LLVM type-system is > the 'void' type, which is only currently allowed as the return value > of a function. Special cases like this should be eliminated. Is this still the case, and if so, is there any work being done on this already? Thanks! Patrick [1] http://www.nondot.org/~sabre/LLVMNotes/MultipleReturnValues.txt
On Jun 11, 2010, at 3:43 PM, Patrick Walton wrote:> Hi, > > I'm interested in adding support for void values (i.e. unit types) to > LLVM. Currently, "void" is only allowed as the return value of a > function, and numerous assertions are in place to check this. > > This document [1] that Google pulled up seems to suggest that this idea > was planned: > >> Finally, one annoying, but trivial, nuance of the LLVM type-system is >> the 'void' type, which is only currently allowed as the return value >> of a function. Special cases like this should be eliminated. > > Is this still the case, and if so, is there any work being done on this > already?Hi Patrick, I don't know of anyone working on it, but I'd really like to eliminate void. It doesn't seem like a useful feature of the type system. Functions can be changed to return {} for example. -Chris
On 6/11/10 4:20 PM, Chris Lattner wrote:> Hi Patrick, > > I don't know of anyone working on it, but I'd really like to eliminate void. It doesn't seem like a useful feature of the type system. Functions can be changed to return {} for example. > > -ChrisThat's the structure type with zero elements, right? Patrick
> I don't know of anyone working on it, but I'd really like to eliminate void. It doesn't seem like a useful feature of the type system. Functions can be changed to return {} for example.Not having a void type also means that people writing front-ends for C-like languages won't try to convert "void*" into a pointer to the LLVM void type and be confused when it doesn't work :) Ciao, Duncan.