diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-08-29 12:20:54 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-08-29 12:20:54 +0000 |
| commit | b4ac493684cdeb2147000a6816a563269fcf3c70 (patch) | |
| tree | c3571e53bc11aa570e3fa942c646151e3f1fa086 /lib/Target/PowerPC/PPCISelLowering.cpp | |
| parent | 946b521498866b3d83c4447c9c0ece6095a56874 (diff) | |
| download | external_llvm-b4ac493684cdeb2147000a6816a563269fcf3c70.zip external_llvm-b4ac493684cdeb2147000a6816a563269fcf3c70.tar.gz external_llvm-b4ac493684cdeb2147000a6816a563269fcf3c70.tar.bz2 | |
- Add target lowering methods to get the preferred format for the FDE and LSDA
encodings.
- Make some of the values emitted by the FDEs dependent upon the pointer
size. This is in line with how GCC does things. And it has the benefit of
working for Darwin in 64-bit mode now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelLowering.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index ad9bbe1..1f51d04 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -464,6 +464,40 @@ unsigned PPCTargetLowering::getFunctionAlignment(const Function *F) const { return 2; } +/// getPreferredLSDADataFormat - Return the preferred exception handling data +/// format for the LSDA. +unsigned PPCTargetLowering::getPreferredLSDADataFormat() const { + if (getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) + return dwarf::DW_EH_PE_pcrel; + + if (PPCSubTarget.isPPC64() || + getTargetMachine().getRelocationModel() == Reloc::PIC_) { + unsigned DataTy = + (PPCSubTarget.isPPC64() ? + dwarf::DW_EH_PE_udata8 : dwarf::DW_EH_PE_udata4); + return dwarf::DW_EH_PE_pcrel | DataTy; + } + + return dwarf::DW_EH_PE_absptr; +} + +/// getPreferredFDEDataFormat - Return the preferred exception handling data +/// format for the FDE. +unsigned PPCTargetLowering::getPreferredFDEDataFormat() const { + if (getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) + return dwarf::DW_EH_PE_pcrel; + + if (PPCSubTarget.isPPC64() || + getTargetMachine().getRelocationModel() == Reloc::PIC_) { + unsigned DataTy = + (PPCSubTarget.isPPC64() ? + dwarf::DW_EH_PE_udata8 : dwarf::DW_EH_PE_udata4); + return dwarf::DW_EH_PE_pcrel | DataTy; + } + + return dwarf::DW_EH_PE_absptr; +} + //===----------------------------------------------------------------------===// // Node matching predicates, for use by the tblgen matching code. //===----------------------------------------------------------------------===// |
