On 2007-04-20, at 01:22, Chris Lattner wrote:
On Apr 19, 2007, at 3:24 PM, Anton Korobeynikov wrote:
Chris, maybe in this situation it will be better to spare 4 bytes
at GlobalValue object to store pointer to alias string there?
I don't think that really makes sense. Aliases aren't really
global variables or functions themselves, they are a third kind of
object.
What do you think about making a new GlobalAlias class, which
derives from GlobalValue. Module would contain a list of these,
just like it has a list of functions and gvars?
This would clearly solve the memory use issue and I think it would
be a cleaner design (obvious they can't have bodies, etc).
What do you think?
Chris,
Why not simply reinsert the aliased GV into the symbol table under
the alias name? In this manner, alias objects would not need to
derive from GlobalValue at all. Aliases could be stored in a list on
the side as you describe, solving the memory usage problem. The
majority of code could remain ignorant of them, resolving the code
duplication Anton was worried about.
— Gordon
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits