Provide correct DWARF register numbering for debug information emission on x86-32...
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 25 Jan 2008 00:34:13 +0000 (00:34 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 25 Jan 2008 00:34:13 +0000 (00:34 +0000)
This should fix bunch of issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46337 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.h
lib/Target/X86/X86RegisterInfo.td

index 56523eb14d091ff7b923bc872b407755ac8cf076..277a09cc1550072885d6c1aaeb9797478d73d881 100644 (file)
@@ -64,12 +64,15 @@ int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
   unsigned Flavour = DWARFFlavour::X86_64;
   if (!Subtarget->is64Bit()) {
     if (Subtarget->isTargetDarwin()) {
-      Flavour = DWARFFlavour::X86_32_Darwin;
+      if (isEH)
+        Flavour = DWARFFlavour::X86_32_DarwinEH;
+      else
+        Flavour = DWARFFlavour::X86_32_Generic;
     } else if (Subtarget->isTargetCygMing()) {
       // Unsupported by now, just quick fallback
-      Flavour = DWARFFlavour::X86_32_ELF;
+      Flavour = DWARFFlavour::X86_32_Generic;
     } else {
-      Flavour = DWARFFlavour::X86_32_ELF;
+      Flavour = DWARFFlavour::X86_32_Generic;
     }
   }
 
index d78311a3b71fe470b1cbaa3231aaa4261bdf3e2d..16bbf074898e5b5a57aca02b04888ee013d846e1 100644 (file)
@@ -36,7 +36,7 @@ namespace N86 {
 ///
 namespace DWARFFlavour {
   enum {
-    X86_64 = 0, X86_32_Darwin = 1, X86_32_ELF = 2
+    X86_64 = 0, X86_32_DarwinEH = 1, X86_32_Generic = 2
   };
 } 
   
index dc50905c78848b29419d375c026da7997cba88f1..42c7ce7806de8f03bf28aae3f5e39cb7d8669024 100644 (file)
@@ -25,11 +25,8 @@ let Namespace = "X86" in {
 
   // Dwarf numbering is different for 32-bit and 64-bit, and there are 
   // variations by target as well. Currently the first entry is for X86-64, 
-  // second - for X86-32/Darwin and third for X86-32/Linux
-
-  // FIXME:  Comments in gcc indicate that Darwin uses different numbering
-  // for debug info and exception handling info:(  The numbering here is
-  // for exception handling.
+  // second - for EH on X86-32/Darwin and third is 'generic' one (X86-32/Linux
+  // and debug information on X86-32/Darwin)
 
   // 8-bit registers
   // Low registers