diff options
author | Dan Gohman <gohman@apple.com> | 2010-03-18 18:49:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-03-18 18:49:47 +0000 |
commit | 9553188fccbf0ae9c5b6bef26d0d2bd5feff8b59 (patch) | |
tree | 4ec39913678822ca154e75e7b55e422e588f29c8 /lib/CodeGen/MachineFunction.cpp | |
parent | 5ffc72e7ced7b9187fdbbae4f0606c3b518fa34e (diff) |
Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 254b5e7c7b..0e9ea76c12 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -88,18 +88,15 @@ MachineFunction::MachineFunction(Function *F, const TargetMachine &TM, unsigned FunctionNum, MCContext &ctx) : Fn(F), Target(TM), Ctx(ctx) { if (TM.getRegisterInfo()) - RegInfo = new (Allocator.Allocate<MachineRegisterInfo>()) - MachineRegisterInfo(*TM.getRegisterInfo()); + RegInfo = new (Allocator) MachineRegisterInfo(*TM.getRegisterInfo()); else RegInfo = 0; MFInfo = 0; - FrameInfo = new (Allocator.Allocate<MachineFrameInfo>()) - MachineFrameInfo(*TM.getFrameInfo()); + FrameInfo = new (Allocator) MachineFrameInfo(*TM.getFrameInfo()); if (Fn->hasFnAttr(Attribute::StackAlignment)) FrameInfo->setMaxAlignment(Attribute::getStackAlignmentFromAttrs( Fn->getAttributes().getFnAttributes())); - ConstantPool = new (Allocator.Allocate<MachineConstantPool>()) - MachineConstantPool(TM.getTargetData()); + ConstantPool = new (Allocator) MachineConstantPool(TM.getTargetData()); Alignment = TM.getTargetLowering()->getFunctionAlignment(F); FunctionNumber = FunctionNum; JumpTableInfo = 0; @@ -132,7 +129,7 @@ MachineJumpTableInfo *MachineFunction:: getOrCreateJumpTableInfo(unsigned EntryKind) { if (JumpTableInfo) return JumpTableInfo; - JumpTableInfo = new (Allocator.Allocate<MachineJumpTableInfo>()) + JumpTableInfo = new (Allocator) MachineJumpTableInfo((MachineJumpTableInfo::JTEntryKind)EntryKind); return JumpTableInfo; } @@ -229,14 +226,13 @@ MachineMemOperand * MachineFunction::getMachineMemOperand(const Value *v, unsigned f, int64_t o, uint64_t s, unsigned base_alignment) { - return new (Allocator.Allocate<MachineMemOperand>()) - MachineMemOperand(v, f, o, s, base_alignment); + return new (Allocator) MachineMemOperand(v, f, o, s, base_alignment); } MachineMemOperand * MachineFunction::getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, uint64_t Size) { - return new (Allocator.Allocate<MachineMemOperand>()) + return new (Allocator) MachineMemOperand(MMO->getValue(), MMO->getFlags(), int64_t(uint64_t(MMO->getOffset()) + uint64_t(Offset)), |