[llvm-commits] [llvm] r161090 - in /llvm/trunk: lib/Target/Mips/CMakeLists.txt lib/Target/Mips/Mips16FrameLowering.cpp lib/Target/Mips/Mips16FrameLowering.h lib/Target/Mips/MipsFrameLowering.cpp lib/Target/Mips/MipsFrameLowering.h lib/Target/Mips/MipsSEFrameLowering.cpp lib/Target/Mips/MipsSEFrameLowering.h lib/Target/Mips/MipsTargetMachine.cpp lib/Target/Mips/MipsTargetMachine.h test/CodeGen/Mips/largeimmprinting.ll

Benjamin Kramer benny.kra at gmail.com
Tue Dec 11 08:03:20 PST 2012


On 11.12.2012, at 15:03, NAKAMURA Takumi <geek4civic at gmail.com> wrote:

> 2012/8/1 Akira Hatanaka <ahatanaka at mips.com>:
>> Author: ahatanak
>> Date: Tue Jul 31 17:50:19 2012
>> New Revision: 161090
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=161090&view=rev
>> Log:
>> Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and
>> MipsSEFrameLowering.
>> 
>> Implement MipsSEFrameLowering::hasReservedCallFrame. Call frames will not be
>> reserved if there is a call with a large call frame or there are variable sized
>> objects on the stack.
> 
>> Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=161090&r1=161089&r2=161090&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original)
>> +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Tue Jul 31 17:50:19 2012
>> @@ -32,7 +32,7 @@
>>   MipsSubtarget       Subtarget;
>>   const TargetData    DataLayout; // Calculates type size & alignment
>>   const MipsInstrInfo *InstrInfo;
>> -  MipsFrameLowering   FrameLowering;
>> +  const MipsFrameLowering *FrameLowering;
>>   MipsTargetLowering  TLInfo;
>>   MipsSelectionDAGInfo TSInfo;
>>   MipsJITInfo JITInfo;
>> @@ -49,7 +49,7 @@
>>   virtual const MipsInstrInfo *getInstrInfo() const
>>   { return InstrInfo; }
>>   virtual const TargetFrameLowering *getFrameLowering() const
>> -  { return &FrameLowering; }
>> +  { return FrameLowering; }
>>   virtual const MipsSubtarget *getSubtargetImpl() const
>>   { return &Subtarget; }
>>   virtual const TargetData *getTargetData()    const
> 
> Hatanaka san, excuse me to comment an older commit.
> 
> Since this commit, MipsTargetMachine::FrameLowering has not been deleted.
> Valgrind --vg --vg-leak reports the issue.
> http://lab.llvm.org:8011/builders/llvm-x86_64-linux-vg_leak/builds/16
> 
> I confirmed it could be resolved as below;
> 
> --- a/llvm/lib/Target/Mips/MipsTargetMachine.h
> +++ b/llvm/lib/Target/Mips/MipsTargetMachine.h
> @@ -47,7 +47,7 @@ public:
>                     CodeGenOpt::Level OL,
>                     bool isLittle);
> 
> -  virtual ~MipsTargetMachine() { delete InstrInfo; }
> +  virtual ~MipsTargetMachine() { delete InstrInfo; delete FrameLowering; }

Can we just wrap InstrInfo and FrameLowering in OwningPtrs? It feels cleaner.

- Ben

> 
>   virtual const MipsInstrInfo *getInstrInfo() const
>   { return InstrInfo; }
> 
> ...Takumi
> _______________________________________________
> 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