[PATCH] D14344: [WinEH] Set ExceptionPointerRegister for CoreCLR

Joseph Tremoulet via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 11:24:52 PST 2015


JosephTremoulet created this revision.
JosephTremoulet added reviewers: rnk, pgavlin, majnemer.
JosephTremoulet added a subscriber: llvm-commits.

The CLR's personality routine passes these in rdx/edx, not rax/eax.

http://reviews.llvm.org/D14344

Files:
  lib/Target/X86/X86ISelLowering.cpp

Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp
+++ lib/Target/X86/X86ISelLowering.cpp
@@ -477,11 +477,19 @@
   }
 
   if (Subtarget->isTarget64BitLP64()) {
-    setExceptionPointerRegister(X86::RAX);
-    setExceptionSelectorRegister(X86::RDX);
+    if (Subtarget->isTargetWindowsCoreCLR()) {
+      setExceptionPointerRegister(X86::RDX);
+    } else {
+      setExceptionPointerRegister(X86::RAX);
+      setExceptionSelectorRegister(X86::RDX);
+    }
   } else {
-    setExceptionPointerRegister(X86::EAX);
-    setExceptionSelectorRegister(X86::EDX);
+    if (Subtarget->isTargetWindowsCoreCLR()) {
+      setExceptionPointerRegister(X86::EDX);
+    } else {
+      setExceptionPointerRegister(X86::EAX);
+      setExceptionSelectorRegister(X86::EDX);
+    }
   }
   setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom);
   setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i64, Custom);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14344.39224.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151104/9cd061cd/attachment.bin>


More information about the llvm-commits mailing list