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 | 7f7eb8ac13e87290ff579312f8b1945dcdb6aa3c (patch) | |
tree | 22b150e3dd48c654e876c32dd50a298cbbd49717 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 091e440568ed600aef243fd7738d50bf140ce2b3 (diff) | |
download | llvm-7f7eb8ac13e87290ff579312f8b1945dcdb6aa3c.zip llvm-7f7eb8ac13e87290ff579312f8b1945dcdb6aa3c.tar.gz llvm-7f7eb8ac13e87290ff579312f8b1945dcdb6aa3c.tar.bz2 |
My guess is that RegInfo should only call the Allocator.Deallocator if it's not
null.
llvm-svn: 74147
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 8bcf012..2d2b59e 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/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); |