On Fri, 2007-04-20 at 10:20 +0400, Anton Korobeynikov wrote: > Hello, Reid. > > > I don't understand why we need a subclass of Function for > > this? Can't we just derive an "Alias" class from a smart > > pointer to Value? > Because Aliases are either Function's or GlobalVariable's. They can be > called, used in the expressions, etc. The same way as all normal > external functions/global variables.
I'm saying don't do that. Alias is a "pointer with a name". Its an object that says: "I'm just like that thing over there except I'm named this". So, why not model it that way? It incurs cost only if its used. What this does mean is that places where Functions and GVars are used, we would also have to check for Aliases (if we cared). I assume that we don't care in that many places. The aliasing mechanism doesn't make two functions, there's only one function with two names. So why would we want to instantiate two function objects? If we instantiate an alias object that acts like a smart pointer for the actual things, isn't that good enough? Reid. > _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits