aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-03-18 18:49:47 +0000
committerDan Gohman <gohman@apple.com>2010-03-18 18:49:47 +0000
commit01c65a2622cac0bd4ce04b3f3166260b0878b7a7 (patch)
treeaf2a497d6af2a66ce26f0dde57a205705b4a8c4d /llvm/lib/CodeGen/MachineFunction.cpp
parented4c2eb7bf0fefa626c0ca0a3d6395438a1c9511 (diff)
downloadllvm-01c65a2622cac0bd4ce04b3f3166260b0878b7a7.zip
llvm-01c65a2622cac0bd4ce04b3f3166260b0878b7a7.tar.gz
llvm-01c65a2622cac0bd4ce04b3f3166260b0878b7a7.tar.bz2
Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and simplify several clients. llvm-svn: 98847
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 254b5e7c..0e9ea76 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/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)),