Skip to content

Commit b0f2c48

Browse files
committed
[TargetLoweringObjectFile] Handle riscv BE
Add DWARF exception handling support for riscv big-endian targets. More CodeGen changes related to riscvbe are coming.
1 parent bc278d0 commit b0f2c48

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
247247
break;
248248
case Triple::riscv32:
249249
case Triple::riscv64:
250+
case Triple::riscv32be:
251+
case Triple::riscv64be:
250252
LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
251253
PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
252254
dwarf::DW_EH_PE_sdata4;

llvm/test/CodeGen/RISCV/dwarf-eh.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414
; RUN: | FileCheck %s
1515
; RUN: llc -mtriple=riscv64 --code-model=medium -relocation-model=pic < %s \
1616
; RUN: | FileCheck %s
17+
; RUN: llc -mtriple=riscv32be --code-model=small < %s \
18+
; RUN: | FileCheck %s
19+
; RUN: llc -mtriple=riscv32be --code-model=medium < %s \
20+
; RUN: | FileCheck %s
21+
; RUN: llc -mtriple=riscv32be --code-model=small -relocation-model=pic < %s \
22+
; RUN: | FileCheck %s
23+
; RUN: llc -mtriple=riscv32be --code-model=medium -relocation-model=pic < %s \
24+
; RUN: | FileCheck %s
25+
; RUN: llc -mtriple=riscv64be --code-model=small < %s \
26+
; RUN: | FileCheck %s
27+
; RUN: llc -mtriple=riscv64be --code-model=medium < %s \
28+
; RUN: | FileCheck %s
29+
; RUN: llc -mtriple=riscv64be --code-model=small -relocation-model=pic < %s \
30+
; RUN: | FileCheck %s
31+
; RUN: llc -mtriple=riscv64be --code-model=medium -relocation-model=pic < %s \
32+
; RUN: | FileCheck %s
1733

1834
declare void @throw_exception()
1935

0 commit comments

Comments
 (0)