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 | 59a2250b0d35195dc3d5ad8aba17e003e19a0b16 (patch) | |
| tree | 0f08866e91b7e5ab215b98dc8704ff6aff4f8abc /llvm/lib/CodeGen/DwarfWriter.cpp | |
| parent | 897aed910977aa6f91d70ba89da24ad486ed42ec (diff) | |
| download | bcm5719-llvm-59a2250b0d35195dc3d5ad8aba17e003e19a0b16.tar.gz bcm5719-llvm-59a2250b0d35195dc3d5ad8aba17e003e19a0b16.zip | |
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.
llvm-svn: 46029
Diffstat (limited to 'llvm/lib/CodeGen/DwarfWriter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/DwarfWriter.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp index 1f7618a533a..8b315be7a55 100644 --- a/llvm/lib/CodeGen/DwarfWriter.cpp +++ b/llvm/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"); |

