aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit610b9ebe9a10702638f2089d43872130ffab1220 (patch)
treea22d3a94c05e54532b9953bd63174d926a80badc /lib/CodeGen/MachineFunction.cpp
parent35165f10a78c17485bcf73f87f96c2b61c972509 (diff)
downloadexternal_llvm-610b9ebe9a10702638f2089d43872130ffab1220.tar.gz
external_llvm-610b9ebe9a10702638f2089d43872130ffab1220.tar.bz2
external_llvm-610b9ebe9a10702638f2089d43872130ffab1220.zip
move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfo
a reference to TargetFrameInfo. Rearrange order of fields in StackObject to save a word. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r--lib/CodeGen/MachineFunction.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 3f2c119486..8c9bbf3293 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/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();