[PATCH] D21813: ARM: Fix ARMSubtarget for WOA

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 16:13:24 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL310001: Support: WOA64 and WOA Signals (authored by martell).

Changed prior to commit:
  https://reviews.llvm.org/D21813?vs=99711&id=109651#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D21813

Files:
  llvm/trunk/lib/Support/Windows/Signals.inc


Index: llvm/trunk/lib/Support/Windows/Signals.inc
===================================================================
--- llvm/trunk/lib/Support/Windows/Signals.inc
+++ llvm/trunk/lib/Support/Windows/Signals.inc
@@ -212,8 +212,14 @@
 enum {
 #if defined(_M_X64)
   NativeMachineType = IMAGE_FILE_MACHINE_AMD64
-#else
+#elif defined(_M_ARM64)
+  NativeMachineType = IMAGE_FILE_MACHINE_ARM64
+#elif defined(_M_IX86)
   NativeMachineType = IMAGE_FILE_MACHINE_I386
+#elif defined(_M_ARM)
+  NativeMachineType = IMAGE_FILE_MACHINE_ARMNT
+#else
+  NativeMachineType = IMAGE_FILE_MACHINE_UNKNOWN
 #endif
 };
 
@@ -318,18 +324,18 @@
     using namespace llvm;
     // Print the PC in hexadecimal.
     DWORD64 PC = StackFrame.AddrPC.Offset;
-#if defined(_M_X64)
+#if defined(_M_X64) || defined(_M_ARM64)
     OS << format("0x%016llX", PC);
-#elif defined(_M_IX86)
+#elif defined(_M_IX86) || defined(_M_ARM)
     OS << format("0x%08lX", static_cast<DWORD>(PC));
 #endif
 
 // Print the parameters.  Assume there are four.
-#if defined(_M_X64)
+#if defined(_M_X64) || defined(_M_ARM64)
     OS << format(" (0x%016llX 0x%016llX 0x%016llX 0x%016llX)",
             StackFrame.Params[0], StackFrame.Params[1], StackFrame.Params[2],
             StackFrame.Params[3]);
-#elif defined(_M_IX86)
+#elif defined(_M_IX86) || defined(_M_ARM)
     OS << format(" (0x%08lX 0x%08lX 0x%08lX 0x%08lX)",
             static_cast<DWORD>(StackFrame.Params[0]),
             static_cast<DWORD>(StackFrame.Params[1]),
@@ -526,10 +532,14 @@
   StackFrame.AddrPC.Offset = Context.Rip;
   StackFrame.AddrStack.Offset = Context.Rsp;
   StackFrame.AddrFrame.Offset = Context.Rbp;
-#else
+#elif defined(_M_IX86)
   StackFrame.AddrPC.Offset = Context.Eip;
   StackFrame.AddrStack.Offset = Context.Esp;
   StackFrame.AddrFrame.Offset = Context.Ebp;
+#elif defined(_M_ARM64) || defined(_M_ARM)
+  StackFrame.AddrPC.Offset = Context.Pc;
+  StackFrame.AddrStack.Offset = Context.Sp;
+  StackFrame.AddrFrame.Offset = Context.Fp;
 #endif
   StackFrame.AddrPC.Mode = AddrModeFlat;
   StackFrame.AddrStack.Mode = AddrModeFlat;
@@ -804,6 +814,13 @@
   StackFrame.AddrStack.Mode = AddrModeFlat;
   StackFrame.AddrFrame.Offset = ep->ContextRecord->Ebp;
   StackFrame.AddrFrame.Mode = AddrModeFlat;
+#elif defined(_M_ARM64) || defined(_M_ARM)
+  StackFrame.AddrPC.Offset = ep->ContextRecord->Pc;
+  StackFrame.AddrPC.Mode = AddrModeFlat;
+  StackFrame.AddrStack.Offset = ep->ContextRecord->Sp;
+  StackFrame.AddrStack.Mode = AddrModeFlat;
+  StackFrame.AddrFrame.Offset = ep->ContextRecord->Fp;
+  StackFrame.AddrFrame.Mode = AddrModeFlat;
 #endif
 
   HANDLE hProcess = GetCurrentProcess();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21813.109651.patch
Type: text/x-patch
Size: 2643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170803/b892076a/attachment.bin>


More information about the llvm-commits mailing list