[PATCH] D139177: [LoongArch] Specify registers used for exception handling

Lu Weining via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 01:08:01 PST 2022


SixWeining created this revision.
SixWeining added reviewers: xen0n, xry111, MaskRay, wangleiat.
Herald added a subscriber: StephenFan.
Herald added a project: All.
SixWeining requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

See definition in backend D134709 <https://reviews.llvm.org/D134709> and the doc [1] for more detail.

With the benefit of this change, most libcxx and libcxxabi tests pass.

[1]: https://llvm.org/docs/ExceptionHandling.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139177

Files:
  clang/lib/Basic/Targets/LoongArch.h


Index: clang/lib/Basic/Targets/LoongArch.h
===================================================================
--- clang/lib/Basic/Targets/LoongArch.h
+++ clang/lib/Basic/Targets/LoongArch.h
@@ -56,6 +56,14 @@
 
   ArrayRef<const char *> getGCCRegNames() const override;
 
+  int getEHDataRegisterNumber(unsigned RegNo) const override {
+    if (RegNo == 0)
+      return 4;
+    if (RegNo == 1)
+      return 5;
+    return -1;
+  }
+
   ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
 
   bool validateAsmConstraint(const char *&Name,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139177.479549.patch
Type: text/x-patch
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221202/5892a2dd/attachment.bin>


More information about the cfe-commits mailing list