summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-04-13 06:38:02 +0000
committerMartin Storsjo <martin@martin.st>2018-04-13 06:38:02 +0000
commit8293161712e68ff966d5dbfb623c5e33d96331f0 (patch)
tree677cb719e6389157d6cfae49d5c18f07e3bf893c /llvm/lib
parent254ed028a4bd4fa81d0049d90e6ab23d704dd366 (diff)
downloadbcm5719-llvm-8293161712e68ff966d5dbfb623c5e33d96331f0.tar.gz
bcm5719-llvm-8293161712e68ff966d5dbfb623c5e33d96331f0.zip
[Support] Fix building for Windows on ARM
The commit in SVN r310001 that added support for this actually didn't use the right struct field for the frame pointer - for ARM, there is no register named Fp in the CONTEXT struct. On Windows, the R11 register is used as frame pointer. Differential Revision: https://reviews.llvm.org/D45590 llvm-svn: 329991
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/Windows/Signals.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc
index 893d18acfde..e30522b4ebb 100644
--- a/llvm/lib/Support/Windows/Signals.inc
+++ b/llvm/lib/Support/Windows/Signals.inc
@@ -533,10 +533,14 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS) {
StackFrame.AddrPC.Offset = Context.Eip;
StackFrame.AddrStack.Offset = Context.Esp;
StackFrame.AddrFrame.Offset = Context.Ebp;
-#elif defined(_M_ARM64) || defined(_M_ARM)
+#elif defined(_M_ARM64)
StackFrame.AddrPC.Offset = Context.Pc;
StackFrame.AddrStack.Offset = Context.Sp;
StackFrame.AddrFrame.Offset = Context.Fp;
+#elif defined(_M_ARM)
+ StackFrame.AddrPC.Offset = Context.Pc;
+ StackFrame.AddrStack.Offset = Context.Sp;
+ StackFrame.AddrFrame.Offset = Context.R11;
#endif
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrStack.Mode = AddrModeFlat;
@@ -816,7 +820,11 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = ep->ContextRecord->Sp;
StackFrame.AddrStack.Mode = AddrModeFlat;
+#if defined(_M_ARM64)
StackFrame.AddrFrame.Offset = ep->ContextRecord->Fp;
+#else
+ StackFrame.AddrFrame.Offset = ep->ContextRecord->R11;
+#endif
StackFrame.AddrFrame.Mode = AddrModeFlat;
#endif
OpenPOWER on IntegriCloud