On Dec 2, 2009, at 10:02 AM, Chris Lattner wrote:

> 
> On Dec 2, 2009, at 12:04 AM, John McCall wrote:
> 
>> Author: rjmccall
>> Date: Wed Dec  2 02:04:21 2009
>> New Revision: 90306
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=90306&view=rev
>> Log:
>> Push overloaded function templates through the parser using a totally 
>> different
>> leaked data structure than before.
> 
> 'leaked'?


In the lesser sense that the memory belongs to the ASTContext.  The problem is 
that we need to tell the parser that a TemplateTy actually refers to N 
overloaded function templates, and like all the other opaque types, it only 
allows a single pointer, so we need to allocate something to store them, even 
if temporary (or change the parser to store these differently, but that 
requires fussing with the token-annotation system &c.).  As it happens, an 
overloaded TemplateTy is going to be either (1) quickly consumed as an 
expression when the template arguments are parsed or (2) discarded as 
ill-formed in the current location.  In principle you could exploit that to 
avoid leaking the overload storage, but that's hard to make actually work;  
either Sema would need to be told when the parser discards a TemplateTy (tough 
because of token annotations) or Sema would have to track it somehow (tough 
because you can have several in-flight at once).

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to