1 //===-- llvm/MC/MCFixupKindInfo.h - Fixup Descriptors -----------*- 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 
9 #ifndef LLVM_MC_MCFIXUPKINDINFO_H
10 #define LLVM_MC_MCFIXUPKINDINFO_H
11 
12 namespace llvm {
13 
14 /// Target independent information on a fixup kind.
15 struct MCFixupKindInfo {
16   enum FixupKindFlags {
17     /// Is this fixup kind PCrelative? This is used by the assembler backend to
18     /// evaluate fixup values in a target independent manner when possible.
19     FKF_IsPCRel = (1 << 0),
20 
21     /// Should this fixup kind force a 4-byte aligned effective PC value?
22     FKF_IsAlignedDownTo32Bits = (1 << 1),
23 
24     /// Should this fixup be evaluated in a target dependent manner?
25     FKF_IsTarget = (1 << 2),
26 
27     /// This fixup kind should be resolved if defined.
28     /// FIXME This is a workaround because we don't support certain ARM
29     /// relocation types. This flag should eventually be removed.
30     FKF_Constant = 1 << 3,
31   };
32 
33   /// A target specific name for the fixup kind. The names will be unique for
34   /// distinct kinds on any given target.
35   const char *Name;
36 
37   /// The bit offset to write the relocation into.
38   unsigned TargetOffset;
39 
40   /// The number of bits written by this fixup. The bits are assumed to be
41   /// contiguous.
42   unsigned TargetSize;
43 
44   /// Flags describing additional information on this fixup kind.
45   unsigned Flags;
46 };
47 
48 } // End llvm namespace
49 
50 #endif
51