Merge from mainline.

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
This commit is contained in:
Tanya Lattner 2008-02-04 06:17:46 +00:00
parent fccad572ec
commit 349413b631
3 changed files with 9 additions and 9 deletions

View 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;
}
}

View 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
};
}

View 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