[llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86TargetAsmInfo.cpp

Anton Korobeynikov asl at math.spbu.ru
Sat May 12 15:36:51 PDT 2007



Changes in directory llvm/lib/Target/X86:

X86RegisterInfo.cpp updated: 1.219 -> 1.220
X86TargetAsmInfo.cpp updated: 1.41 -> 1.42
---
Log message:

More DWARF-related things cleanup:
1. Fix PR1380: http://llvm.org/PR1380 
2. Apply Duncan's patch from PR1410: http://llvm.org/PR1410 
3. Insert workaround for "one personality function per module" as noted in PR1414: http://llvm.org/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.


---
Diffs of the changes:  (+10 -9)

 X86RegisterInfo.cpp  |   17 ++++++++++-------
 X86TargetAsmInfo.cpp |    2 --
 2 files changed, 10 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/X86/X86RegisterInfo.cpp
diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.219 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.220
--- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.219	Wed May  2 14:53:33 2007
+++ llvm/lib/Target/X86/X86RegisterInfo.cpp	Sat May 12 17:36:25 2007
@@ -1153,11 +1153,6 @@
        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 @@
 
 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 {


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.41 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.42
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.41	Sat May  5 04:04:50 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp	Sat May 12 17:36:25 2007
@@ -113,7 +113,6 @@
     AbsoluteDebugSectionOffsets = true;
     AbsoluteEHSectionOffsets = false;
     SupportsDebugInformation = true;
-    DwarfRequiresFrameSection = false;
     DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"\", at progbits";
     DwarfInfoSection =    "\t.section\t.debug_info,\"\", at progbits";
     DwarfLineSection =    "\t.section\t.debug_line,\"\", at progbits";
@@ -149,7 +148,6 @@
     AbsoluteDebugSectionOffsets = true;
     AbsoluteEHSectionOffsets = false;
     SupportsDebugInformation = true;
-    DwarfRequiresFrameSection = false;
     DwarfSectionOffsetDirective = "\t.secrel32\t";
     DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"dr\"";
     DwarfInfoSection =    "\t.section\t.debug_info,\"dr\"";






More information about the llvm-commits mailing list