[llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.h
Jim Laskey
jlaskey at apple.com
Thu Mar 23 10:13:14 PST 2006
Changes in directory llvm/lib/Target/X86:
X86RegisterInfo.cpp updated: 1.130 -> 1.131
X86RegisterInfo.h updated: 1.34 -> 1.35
---
Log message:
Add support to locate local variables in frames (early version.)
---
Diffs of the changes: (+15 -0)
X86RegisterInfo.cpp | 12 ++++++++++++
X86RegisterInfo.h | 3 +++
2 files changed, 15 insertions(+)
Index: llvm/lib/Target/X86/X86RegisterInfo.cpp
diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.130 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.131
--- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.130 Fri Mar 17 19:23:20 2006
+++ llvm/lib/Target/X86/X86RegisterInfo.cpp Thu Mar 23 12:12:57 2006
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
@@ -685,5 +686,16 @@
}
}
+void X86RegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
+ MachineLocation &ML) const {
+ MachineFrameInfo *MFI = MF.getFrameInfo();
+ bool FP = hasFP(MF);
+
+ // FIXME - Needs to handle register variables.
+ // FIXME - Hardcoding gcc numbering.
+ ML.set(FP ? 6 : 7,
+ MFI->getObjectOffset(Index) + MFI->getStackSize());
+}
+
#include "X86GenRegisterInfo.inc"
Index: llvm/lib/Target/X86/X86RegisterInfo.h
diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.34 llvm/lib/Target/X86/X86RegisterInfo.h:1.35
--- llvm/lib/Target/X86/X86RegisterInfo.h:1.34 Thu Feb 2 14:12:32 2006
+++ llvm/lib/Target/X86/X86RegisterInfo.h Thu Mar 23 12:12:57 2006
@@ -62,6 +62,9 @@
void emitPrologue(MachineFunction &MF) const;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
+
+ void getLocation(MachineFunction &MF, unsigned Index,
+ MachineLocation &ML) const;
};
} // End llvm namespace
More information about the llvm-commits
mailing list