LLVM  8.0.1
ARMWinEH.cpp
Go to the documentation of this file.
1 //===-- ARMWinEH.cpp - Windows on ARM EH Support Functions ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/Support/ARMWinEH.h"
12 
13 namespace llvm {
14 namespace ARM {
15 namespace WinEH {
16 std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF) {
17  uint8_t NumRegisters = RF.Reg();
18  uint8_t RegistersVFP = RF.R();
19  uint8_t LinkRegister = RF.L();
20  uint8_t ChainedFrame = RF.C();
21 
22  uint16_t GPRMask = (ChainedFrame << 11) | (LinkRegister << 14);
23  uint32_t VFPMask = 0;
24 
25  if (RegistersVFP)
26  VFPMask |= (((1 << ((NumRegisters + 1) % 8)) - 1) << 8);
27  else
28  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << 4);
29 
30  if (PrologueFolding(RF))
31  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << (~RF.StackAdjust() & 0x3));
32 
33  return std::make_pair(GPRMask, VFPMask);
34 }
35 }
36 }
37 }
38 
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool PrologueFolding(const RuntimeFunction &RF)
PrologueFolding - pseudo-flag derived from Stack Adjust indicating that the prologue has stack adjust...
Definition: ARMWinEH.h:186
RuntimeFunction - An entry in the table of procedure data (.pdata)
Definition: ARMWinEH.h:101
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:16
uint16_t StackAdjust() const
Definition: ARMWinEH.h:176