aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-25 07:19:06 +0000
committerChris Lattner <sabre@nondot.org>2008-01-25 07:19:06 +0000
commit6068832dbebd836217fb1651fae897da0474a643 (patch)
tree5de618bdfa2e4f6af0e6ddfd3733813a6262aacb /llvm/lib/CodeGen/MachineFunction.cpp
parentda52d9e093609ef0df0184a7b7e0bd6c90f8f694 (diff)
downloadllvm-6068832dbebd836217fb1651fae897da0474a643.zip
llvm-6068832dbebd836217fb1651fae897da0474a643.tar.gz
llvm-6068832dbebd836217fb1651fae897da0474a643.tar.bz2
move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfo
a reference to TargetFrameInfo. Rearrange order of fields in StackObject to save a word. llvm-svn: 46348
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 3f2c119..8c9bbf3 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -126,7 +126,7 @@ MachineFunction::MachineFunction(const Function *F,
: Annotation(MF_AID), Fn(F), Target(TM) {
RegInfo = new MachineRegisterInfo(*TM.getRegisterInfo());
MFInfo = 0;
- FrameInfo = new MachineFrameInfo();
+ FrameInfo = new MachineFrameInfo(*TM.getFrameInfo());
ConstantPool = new MachineConstantPool(TM.getTargetData());
// Set up jump table.
@@ -331,6 +331,19 @@ MachineFunction& MachineFunction::get(const Function *F)
// MachineFrameInfo implementation
//===----------------------------------------------------------------------===//
+/// CreateFixedObject - Create a new object at a fixed location on the stack.
+/// All fixed objects should be created before other objects are created for
+/// efficiency. By default, fixed objects are immutable. This returns an
+/// index with a negative value.
+///
+int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
+ bool Immutable) {
+ assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
+ Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset, Immutable));
+ return -++NumFixedObjects;
+}
+
+
void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea();