[llvm-commits] [llvm] r53210 - in /llvm/trunk: include/llvm/ADT/alist.h include/llvm/ADT/alist_node.h include/llvm/ADT/ilist.h include/llvm/Support/Recycler.h include/llvm/Support/RecyclingAllocator.h include/llvm/SymbolTableListTraits.h lib/Support/Al...

Dan Gohman gohman at apple.com
Wed Jul 9 10:30:43 PDT 2008


Hi John,

I added a new member function, deleteNode, to the ilist_traits concept,
to allow traits classes to use custom deallocation strategies.

Your ilist_traits<llvm::DSNode> presumably doesn't need special delete
behavior, so adding this:

     static void deleteNode(llvm::DSNode *V) { delete V; }

to the definition of ilist_traits<llvm::DSNode> should be sufficient.

Dan

On Jul 9, 2008, at 9:06 AM, John Criswell wrote:

> Dear Dan,
>
> I believe this patch broke the erase() method of class iplist.  I get
> the following error when I compile DSA:
>
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h: In member
> function ‘llvm::ilist_iterator<ValueSubClass> llvm::iplist<NodeTy,
> Traits>::erase(llvm::ilist_iterator<ValueSubClass>) [with NodeTy =
> llvm::DSNode, Traits = llvm::ilist_traits<llvm::DSNode>]’:
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h:455:
> instantiated from ‘llvm::ilist_iterator<ValueSubClass>
> llvm::iplist<NodeTy,  
> Traits>::erase(llvm::ilist_iterator<ValueSubClass>,
> llvm::ilist_iterator<ValueSubClass>) [with NodeTy = llvm::DSNode,  
> Traits
> = llvm::ilist_traits<llvm::DSNode>]’
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h:459:
> instantiated from ‘void llvm::iplist<NodeTy, Traits>::clear() [with
> NodeTy = llvm::DSNode, Traits = llvm::ilist_traits<llvm::DSNode>]’
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h:281:
> instantiated from ‘llvm::iplist<NodeTy, Traits>::~iplist() [with  
> NodeTy
> = llvm::DSNode, Traits = llvm::ilist_traits<llvm::DSNode>]’
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h:550:
> instantiated from here
> /home/vadve/criswell/src/llvm22/include/llvm/ADT/ilist.h:383: error:
> ‘deleteNode’ is not a member of ‘llvm::ilist_traits<llvm::DSNode>’
>
> Is this something you can fix?
>
> -- John T.
>
> Dan Gohman wrote:
>> Author: djg
>> Date: Mon Jul  7 17:58:06 2008
>> New Revision: 53210
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=53210&view=rev
>> Log:
>> Add some basic Pool-allocation infrastructure. This adds a Recycler  
>> class,
>> for handling bookkeeping for deleted objects, as well as the alist  
>> class
>> template, for keeping lists of objects allocated from Recyclers,  
>> and some
>> related utilities.
>>
>> Added:
>>    llvm/trunk/include/llvm/ADT/alist.h
>>    llvm/trunk/include/llvm/ADT/alist_node.h
>>    llvm/trunk/include/llvm/Support/Recycler.h
>>    llvm/trunk/include/llvm/Support/RecyclingAllocator.h
>> Modified:
>>    llvm/trunk/include/llvm/ADT/ilist.h
>>    llvm/trunk/include/llvm/SymbolTableListTraits.h
>>    llvm/trunk/lib/Support/Allocator.cpp
>>
>> Added: llvm/trunk/include/llvm/ADT/alist.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/alist.h?rev=53210&view=auto
>>
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list