Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Merge from mainline.
Browse files Browse the repository at this point in the history
Provide correct DWARF register numbering for debug information emission on x86-32/Darwin.
This should fix bunch of issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_22@46698 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tlattner committed Feb 4, 2008
1 parent fccad57 commit 349413b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions lib/Target/X86/X86RegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Target/X86/X86RegisterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}

Expand Down
7 changes: 2 additions & 5 deletions lib/Target/X86/X86RegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 349413b

Please sign in to comment.