From 4149ab2eb30e4185ecad5b11038ff69a74c42f5b Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Mon, 4 Feb 2008 06:17:46 +0000 Subject: 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 --- llvm/lib/Target/X86/X86RegisterInfo.cpp | 9 ++++++--- llvm/lib/Target/X86/X86RegisterInfo.h | 2 +- llvm/lib/Target/X86/X86RegisterInfo.td | 7 ++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 56523eb..277a09c 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -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; } } diff --git a/llvm/lib/Target/X86/X86RegisterInfo.h b/llvm/lib/Target/X86/X86RegisterInfo.h index d78311a..16bbf07 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.h +++ b/llvm/lib/Target/X86/X86RegisterInfo.h @@ -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 }; } diff --git a/llvm/lib/Target/X86/X86RegisterInfo.td b/llvm/lib/Target/X86/X86RegisterInfo.td index dc50905..42c7ce7 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.td +++ b/llvm/lib/Target/X86/X86RegisterInfo.td @@ -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 -- cgit v1.1