summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86RegisterInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-05-12 22:36:25 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-05-12 22:36:25 +0000
commit13da17843cb9a441cd9f3fe5786ba9e0b113b814 (patch)
tree9ced64635c8b19ae1a77a5b3e0c241c9019df08d /llvm/lib/Target/X86/X86RegisterInfo.cpp
parent81ee020f649a5f18f7e2c969fa4ed81c34e19f1f (diff)
downloadbcm5719-llvm-13da17843cb9a441cd9f3fe5786ba9e0b113b814.tar.gz
bcm5719-llvm-13da17843cb9a441cd9f3fe5786ba9e0b113b814.zip
More DWARF-related things cleanup:
1. Fix PR1380 2. Apply Duncan's patch from PR1410 3. Insert workaround for "one personality function per module" as noted in PR1414 4. Emit correct debug frames for x86/linux. This partly fixes DebugInfo/2006-11-06-StackTrace.cpp: stack trace is shown correctly, but arguments for function on top of stack are displayed incorrectly. llvm-svn: 37015
Diffstat (limited to 'llvm/lib/Target/X86/X86RegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 06d12b0a429..30d029f6ca1 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -1153,11 +1153,6 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
TargetFrameInfo::StackGrowsUp ?
TAI->getAddressSize() : -TAI->getAddressSize());
- // Add return address to move list
- MachineLocation CSDst(StackPtr, stackGrowth);
- MachineLocation CSSrc(getRARegister());
- Moves.push_back(MachineMove(StartLabelId, CSDst, CSSrc));
-
if (NumBytes) {
// Show update of SP.
if (hasFP(MF)) {
@@ -1282,10 +1277,18 @@ unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const {
void X86RegisterInfo::getInitialFrameState(std::vector<MachineMove> &Moves)
const {
- // Initial state of the frame pointer is esp.
+ // Calculate amount of bytes used for return address storing
+ int stackGrowth = (Is64Bit ? -8 : -4);
+
+ // Initial state of the frame pointer is esp+4.
MachineLocation Dst(MachineLocation::VirtualFP);
- MachineLocation Src(StackPtr, 0);
+ MachineLocation Src(StackPtr, stackGrowth);
Moves.push_back(MachineMove(0, Dst, Src));
+
+ // Add return address to move list
+ MachineLocation CSDst(StackPtr, stackGrowth);
+ MachineLocation CSSrc(getRARegister());
+ Moves.push_back(MachineMove(0, CSDst, CSSrc));
}
unsigned X86RegisterInfo::getEHExceptionRegister() const {
OpenPOWER on IntegriCloud