[LLVMdev] How to deal with potentially unlimited count/length symbol names?

edA-qa mort-ora-y eda-qa at disemia.com
Wed Jun 19 01:04:13 PDT 2013


In my language I have anonymous types (essentially tuples), and I have
generated functions (like constructors) which are unique for these
types. If the same type occurs in multiple modules however it should end
up with only one definition being linked. Thus I need a way to give them
the same name.

The problem is that if I derive the name from what the type contains the
length of that name is essential unbound. So how does one generate
names?  I'm thinking of just using a long hash and hoping I don't get
accidental collisions. Surely there must be a better way?


Currently, since I'm only dealing with one module, it is very easy to
just assign unique numbers. But obviously this doesn't work with
multiple independent modules since they'd all need the same name. It
will ultimately have to work across libraries as well, so I can't just
create a registry of the type->id.

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130619/251cf3e0/attachment.sig>


More information about the llvm-dev mailing list