diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-06-25 00:32:48 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-06-25 00:32:48 +0000 |
commit | 9624c615169fec3957e38ea181d634d51859a195 (patch) | |
tree | af39eb63ae378a179bda651f5569e30e09646c70 /lib/CodeGen/MachineFunction.cpp | |
parent | fb0239fc0574fe95c7b3169bd41c9caf50847250 (diff) | |
download | external_llvm-9624c615169fec3957e38ea181d634d51859a195.tar.gz external_llvm-9624c615169fec3957e38ea181d634d51859a195.tar.bz2 external_llvm-9624c615169fec3957e38ea181d634d51859a195.zip |
My guess is that RegInfo should only call the Allocator.Deallocator if it's not
null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 8bcf0124a8..2d2b59e2ec 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -124,25 +124,28 @@ MachineFunction::MachineFunction(const Function *F, MachineFrameInfo(*TM.getFrameInfo()); ConstantPool = new (Allocator.Allocate<MachineConstantPool>()) MachineConstantPool(TM.getTargetData()); - + // Set up jump table. const TargetData &TD = *TM.getTargetData(); bool IsPic = TM.getRelocationModel() == Reloc::PIC_; unsigned EntrySize = IsPic ? 4 : TD.getPointerSize(); - unsigned Alignment = IsPic ? TD.getABITypeAlignment(Type::Int32Ty) - : TD.getPointerABIAlignment(); + unsigned TyAlignment = IsPic ? TD.getABITypeAlignment(Type::Int32Ty) + : TD.getPointerABIAlignment(); JumpTableInfo = new (Allocator.Allocate<MachineJumpTableInfo>()) - MachineJumpTableInfo(EntrySize, Alignment); + MachineJumpTableInfo(EntrySize, TyAlignment); } MachineFunction::~MachineFunction() { BasicBlocks.clear(); InstructionRecycler.clear(Allocator); BasicBlockRecycler.clear(Allocator); - if (RegInfo) - RegInfo->~MachineRegisterInfo(); Allocator.Deallocate(RegInfo); + if (RegInfo) { + RegInfo->~MachineRegisterInfo(); + Allocator.Deallocate(RegInfo); + } if (MFInfo) { - MFInfo->~MachineFunctionInfo(); Allocator.Deallocate(MFInfo); + MFInfo->~MachineFunctionInfo(); + Allocator.Deallocate(MFInfo); } FrameInfo->~MachineFrameInfo(); Allocator.Deallocate(FrameInfo); ConstantPool->~MachineConstantPool(); Allocator.Deallocate(ConstantPool); |