[LLVMdev] Discussion of eliminating the void type

Duncan Sands baldrick at free.fr
Mon May 7 08:36:04 PDT 2012


Hi Mitnick,

> === Overview ===
>
> The general concept is to replaced void with {}. And 'ret void' is a synonym of
> 'ret {} {}.'

in a sense the concept is just to delete void and not to replace it with
anything in particular.  Of course front-ends (clang, dragonegg) need to produce
something instead of void, and {} is an example of what they might produce, but
they should not be obliged to use that.  For example they could use [] or {{}}
etc.

> === Further Implementation Details ===
>
> 1. Deleting VoidTyID

Yes!

> 2. Deleting LLVMVoidTypeKind (one-to-one relation between VoidTyID and
> LLVMVoidTypeKind)

Yes!

> 3. Use StructTy* VoidTy instead of Type VoidTy

No!  This doesn't make any sense to me.  Why would having a definition for
VoidTy be needed or desirable?

>      VoidTy may be Identified struct. In addition to error occurs at
> test/Analysis/BasicAA/empty.ll
>      because of using literal struct "{}" as VoidTy
>
> 4. Re-implement isVoidTy().

No!  Just delete void type, don't try to create a canonical replacement for it.

Ciao, Duncan.

>      Test whether the address of the type equals Type::getVoidTy()
>
> === Request For Command ===
>
> The constructor form of ReturnInst
>
> Any suggestion is welcomed.
>
> Thanks a lot
>
> Mitnick
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list