[llvm-dev] GlobalVariable::eraseFromParent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] GlobalVariable::eraseFromParent

Alberto Barbaro via llvm-dev
I am confused by GlobalVariable::eraseFromParent's declaration:

  /// This method unlinks 'this' from the containing module and deletes it.
  void eraseFromParent();

In Globals.cpp the unlinking is done and SymbolTableListTraits cleans up
the symbol table but I don't see anything that actually deletes the
object.  Is the comment misleading or am I missing something?

                           -David
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] GlobalVariable::eraseFromParent

Alberto Barbaro via llvm-dev
Deletion is taken care of by ilist_alloc_traits<T>::deleteNode.

On Tue, Nov 27, 2018 at 7:45 AM David Greene via llvm-dev <[hidden email]> wrote:
I am confused by GlobalVariable::eraseFromParent's declaration:

  /// This method unlinks 'this' from the containing module and deletes it.
  void eraseFromParent();

In Globals.cpp the unlinking is done and SymbolTableListTraits cleans up
the symbol table but I don't see anything that actually deletes the
object.  Is the comment misleading or am I missing something?

                           -David
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] GlobalVariable::eraseFromParent

Alberto Barbaro via llvm-dev
Thanks.  I realized I was looking at ilist instead of iplist.  :-/

                          -David

Reid Kleckner <[hidden email]> writes:

> Deletion is taken care of by ilist_alloc_traits<T>::deleteNode.
>
> On Tue, Nov 27, 2018 at 7:45 AM David Greene via llvm-dev
> <[hidden email]> wrote:
>
>     I am confused by GlobalVariable::eraseFromParent's declaration:
>    
>     /// This method unlinks 'this' from the containing module and
>     deletes it.
>     void eraseFromParent();
>    
>     In Globals.cpp the unlinking is done and SymbolTableListTraits
>     cleans up
>     the symbol table but I don't see anything that actually deletes
>     the
>     object. Is the comment misleading or am I missing something?
>    
>     -David
>     _______________________________________________
>     LLVM Developers mailing list
>     [hidden email]
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev