brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 1b48cdb Raw
52 lines · c
1//===-- arm-ehabi-helpers.h - Supplementary ARM EHABI declarations --------===//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-exception6//7//===--------------------------------------------------------------------===//8 9#ifndef UNWIND_EHABI_HELPERS_H10#define UNWIND_EHABI_HELPERS_H11 12#include <stdint.h>13// NOTE: see reasoning for this inclusion below14#include <unwind.h>15 16#if !defined(__ARM_EABI_UNWINDER__)17 18// NOTE: _URC_OK, _URC_FAILURE must be present as preprocessor tokens.  This19// allows for a substitution of a constant which can be cast into the20// appropriate enumerated type.  This header is expected to always be included21// AFTER unwind.h (which is why it is forcefully included above).  This ensures22// that we do not overwrite the token for the enumeration.  Subsequent uses of23// the token would be clean to rewrite with constant values.24//25// The typedef redeclaration should be safe.  Due to the protection granted to26// us by the `__ARM_EABI_UNWINDER__` above, we are guaranteed that we are in a27// header not vended by gcc.  The HP unwinder (being an itanium unwinder) does28// not support EHABI, and the GNU unwinder, derived from the HP unwinder, also29// does not support EHABI as of the introduction of this header.  As such, we30// are fairly certain that we are in the LLVM case.  Here, _Unwind_State is a31// typedef, and so we can get away with a redeclaration.32//33// Guarded redefinitions of the needed unwind state prevent the redefinition of34// those states.35 36#define _URC_OK 037#define _URC_FAILURE 938 39typedef uint32_t _Unwind_State;40 41#if !defined(_US_UNWIND_FRAME_STARTING)42#define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)43#endif44 45#if !defined(_US_ACTION_MASK)46#define _US_ACTION_MASK ((_Unwind_State)3)47#endif48 49#endif50 51#endif52