[LLVMdev] inefficiencies in ConstantUniqueMap ?

Jay Foad jay.foad at gmail.com
Thu Jun 30 06:17:10 PDT 2011


On 30 June 2011 14:07, Duncan Sands <baldrick at free.fr> wrote:
> Hi Jay,
>
>> As I understand it, PATypeHolder, OpaqueType and the Module's
>> TypeSymbolTable are gone. Instead, StructTypes can optionally be
>> named, and if they are then:
>>
>> - they use name equivalence instead of structural equivalence.
>> - you can create them without any fields, and then add the fields
>> later when the struct is complete.
>
> I find this distinction between structs with names and structs without
> names strange.  Why is a name relevant to anything?  If you can add fields
> to a struct with a name why not to a struct without a name?

It's Chris's design and I don't feel qualified to speak on his behalf.
But... isn't this just the way C works? Structs either have a tag, or
some fields, or both, but definitely not neither? And structs with the
same tag are the same type in C, which is why the name is relevant.

Jay.




More information about the llvm-dev mailing list