Commit 4149ab2e authored by Tanya Lattner's avatar Tanya Lattner
Browse files

Merge from mainline.

Provide correct DWARF register numbering for debug information emission on x86-32/Darwin.
This should fix bunch of issues.

llvm-svn: 46698
parent 23177b1f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;
    }
  }

+1 −1
Original line number Diff line number Diff line
@@ -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
  };
} 
  
+2 −5
Original line number Diff line number Diff line
@@ -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