aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2019-07-17 13:54:38 +0000
committerAlex Bradbury <asb@lowrisc.org>2019-07-17 13:54:38 +0000
commitb94c233d06731b09d842ed86c5a72c44b40c65bb (patch)
tree1e1c183d84a65bfbd8186706605d8d84e4a00e38 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentaa55124eca680e164956c9654a8f2a2fc60b1146 (diff)
downloadllvm-b94c233d06731b09d842ed86c5a72c44b40c65bb.zip
llvm-b94c233d06731b09d842ed86c5a72c44b40c65bb.tar.gz
llvm-b94c233d06731b09d842ed86c5a72c44b40c65bb.tar.bz2
[RISCV] Set correct encodings for DWARF exception handling
This patch sets correct encodings for DWARF exception handling for RISC-V (other than call site encoding, which must be udata4 rather than uleb128 and is handled by D63415). This has the same intend as D63409, except this version matches GCC/binutils behaviour which uses the same encodings regardless of PIC/non-PIC and medlow/medany code model. llvm-svn: 366327
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 4c18152e..d8e6b3e 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -219,6 +219,14 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
TTypeEncoding = dwarf::DW_EH_PE_absptr;
}
break;
+ case Triple::riscv32:
+ case Triple::riscv64:
+ LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+ PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
+ dwarf::DW_EH_PE_sdata4;
+ TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
+ dwarf::DW_EH_PE_sdata4;
+ break;
case Triple::sparcv9:
LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
if (isPositionIndependent()) {