LLVM  9.0.0svn
ARMWinEH.cpp
Go to the documentation of this file.
1 //===-- ARMWinEH.cpp - Windows on ARM EH Support Functions ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
11 
12 namespace llvm {
13 namespace ARM {
14 namespace WinEH {
15 std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF) {
16  uint8_t NumRegisters = RF.Reg();
17  uint8_t RegistersVFP = RF.R();
18  uint8_t LinkRegister = RF.L();
19  uint8_t ChainedFrame = RF.C();
20 
21  uint16_t GPRMask = (ChainedFrame << 11) | (LinkRegister << 14);
22  uint32_t VFPMask = 0;
23 
24  if (RegistersVFP)
25  VFPMask |= (((1 << ((NumRegisters + 1) % 8)) - 1) << 8);
26  else
27  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << 4);
28 
29  if (PrologueFolding(RF))
30  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << (~RF.StackAdjust() & 0x3));
31 
32  return std::make_pair(GPRMask, VFPMask);
33 }
34 }
35 }
36 }
37 
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool PrologueFolding(const RuntimeFunction &RF)
PrologueFolding - pseudo-flag derived from Stack Adjust indicating that the prologue has stack adjust...
Definition: ARMWinEH.h:185
RuntimeFunction - An entry in the table of procedure data (.pdata)
Definition: ARMWinEH.h:100
Windows Exception Handling.
std::pair< uint16_t, uint32_t > SavedRegisterMask(const RuntimeFunction &RF)
SavedRegisterMask - Utility function to calculate the set of saved general purpose (r0-r15) and VFP (...
Definition: ARMWinEH.cpp:15
uint16_t StackAdjust() const
Definition: ARMWinEH.h:175