diff options
author | Dale Johannesen <dalej@apple.com> | 2008-01-15 23:24:56 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-01-15 23:24:56 +0000 |
commit | 4670be43f85fac28770957590cf41ac7c2b9e33c (patch) | |
tree | 515e9d525f1ae17c1637fbf74d606d5f76bc4b73 /lib/CodeGen | |
parent | 77d8049a817bb95191730053a6913668de549c8e (diff) | |
download | external_llvm-4670be43f85fac28770957590cf41ac7c2b9e33c.zip external_llvm-4670be43f85fac28770957590cf41ac7c2b9e33c.tar.gz external_llvm-4670be43f85fac28770957590cf41ac7c2b9e33c.tar.bz2 |
Fix and enable EH for x86-64 Darwin. Adds
ShortenEHDataFor64Bits as a not-very-accurate
abstraction to cover all the changes in DwarfWriter.
Some cosmetic changes to Darwin assembly code for
gcc testsuite compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 1f7618a..8b315be 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -2835,11 +2835,13 @@ private: Asm->EOL("Personality (pcrel sdata4 indirect)"); - PrintRelDirective(); + PrintRelDirective(TAI->getShortenEHDataOn64Bit()); O << TAI->getPersonalityPrefix(); Asm->EmitExternalGlobal((const GlobalVariable *)(Personality)); O << TAI->getPersonalitySuffix(); - O << "-" << TAI->getPCSymbol(); + if (!TAI->getShortenEHDataOn64Bit()) { + O << "-" << TAI->getPCSymbol(); + } Asm->EOL("Personality"); Asm->EmitULEB128Bytes(DW_EH_PE_pcrel); @@ -2917,7 +2919,7 @@ private: // If there is a personality and landing pads then point to the language // specific data area in the exception table. if (EHFrameInfo.PersonalityIndex) { - Asm->EmitULEB128Bytes(4); + Asm->EmitULEB128Bytes(TAI->getShortenEHDataOn64Bit() ? 8 : 4); Asm->EOL("Augmentation size"); if (EHFrameInfo.hasLandingPads) { @@ -3284,24 +3286,26 @@ private: } EmitSectionOffset(BeginTag, "eh_func_begin", BeginNumber, SubprogramCount, - false, true); + TAI->getShortenEHDataOn64Bit(), true); Asm->EOL("Region start"); if (!S.EndLabel) { - EmitDifference("eh_func_end", SubprogramCount, BeginTag, BeginNumber); + EmitDifference("eh_func_end", SubprogramCount, BeginTag, BeginNumber, + TAI->getShortenEHDataOn64Bit()); } else { - EmitDifference("label", S.EndLabel, BeginTag, BeginNumber); + EmitDifference("label", S.EndLabel, BeginTag, BeginNumber, + TAI->getShortenEHDataOn64Bit()); } Asm->EOL("Region length"); if (!S.PadLabel) { - if (TD->getPointerSize() == sizeof(int32_t)) + if (TD->getPointerSize() == sizeof(int32_t) || TAI->getShortenEHDataOn64Bit()) Asm->EmitInt32(0); else Asm->EmitInt64(0); } else { EmitSectionOffset("label", "eh_func_begin", S.PadLabel, SubprogramCount, - false, true); + TAI->getShortenEHDataOn64Bit(), true); } Asm->EOL("Landing pad"); |