[llvm-commits] [PATCH] PR746: Make Function not annotatable and get rid of Annotations

Chris Lattner clattner at apple.com
Mon Jan 22 10:17:48 PST 2007


On Jan 21, 2007, at 11:59 AM, Gordon Henriksen wrote:
> This patch addresses http://llvm.org/PR746.
>
> This patch simply replaces the subversive and overgeneralized  
> annotation classes with a map in MachineFunction and a listener  
> interface so that MachineFunctions can destroy themselves when the  
> parent Function is deleted.
>
> I wish I'd noticed PR746 before http://llvm.org/PR927. Not sure  
> you'll want to apply this patch in light of the comments on this  
> PR746, which suggest using an Analysis to store MachineFunctions,  
> and thus to also manage their lifetimes.

This looks like a great step in the right direction.   However, why  
do we need the FunctionListener interface?  The lifetime of the  
MachineFunction object is tightly controlled by the code generator  
(created with MF::construct and destroyed with MF::destruct).  I  
don't think there is a need to notify the MachineFunction when  
Function is destroyed, just delete the MachineFunction in  
MachineFunction::destruct.

-Chris



More information about the llvm-commits mailing list