RegAllocSimple.cpp

Hi Chris,

I saw this potential memory leak in RegAllocSimple.cpp. The
PhysRegsEverUsed was being allocated but never freed.

-bw

Index: RegAllocSimple.cpp

I saw this potential memory leak in RegAllocSimple.cpp. The
PhysRegsEverUsed was being allocated but never freed.

The ownership of this array is actally passed over to MachineFunction on this line:

   Fn.setUsedPhysRegs(PhysRegsEverUsed);

It is up to MachineFunction to free it when the code generator is done.

-Chris

Index: RegAllocSimple.cpp

RCS file: /var/cvs/llvm/llvm/lib/CodeGen/RegAllocSimple.cpp,v
retrieving revision 1.66
diff -a -u -r1.66 RegAllocSimple.cpp
--- RegAllocSimple.cpp 22 Jan 2006 23:39:54 -0000 1.66
+++ RegAllocSimple.cpp 3 May 2006 01:14:57 -0000
@@ -240,6 +240,7 @@
   AllocateBasicBlock(*MBB);

StackSlotForVirtReg.clear();
+ delete PhysRegsEverUsed;
return true;
}

_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-Chris