MCFixupKindInfo.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/MC/MCFixupKindInfo.h - Fixup Descriptors -----------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_MC_MCFIXUPKINDINFO_H
  14. #define LLVM_MC_MCFIXUPKINDINFO_H
  15. namespace llvm {
  16. /// Target independent information on a fixup kind.
  17. struct MCFixupKindInfo {
  18. enum FixupKindFlags {
  19. /// Is this fixup kind PCrelative? This is used by the assembler backend to
  20. /// evaluate fixup values in a target independent manner when possible.
  21. FKF_IsPCRel = (1 << 0),
  22. /// Should this fixup kind force a 4-byte aligned effective PC value?
  23. FKF_IsAlignedDownTo32Bits = (1 << 1),
  24. /// Should this fixup be evaluated in a target dependent manner?
  25. FKF_IsTarget = (1 << 2),
  26. /// This fixup kind should be resolved if defined.
  27. /// FIXME This is a workaround because we don't support certain ARM
  28. /// relocation types. This flag should eventually be removed.
  29. FKF_Constant = 1 << 3,
  30. };
  31. /// A target specific name for the fixup kind. The names will be unique for
  32. /// distinct kinds on any given target.
  33. const char *Name;
  34. /// The bit offset to write the relocation into.
  35. unsigned TargetOffset;
  36. /// The number of bits written by this fixup. The bits are assumed to be
  37. /// contiguous.
  38. unsigned TargetSize;
  39. /// Flags describing additional information on this fixup kind.
  40. unsigned Flags;
  41. };
  42. } // End llvm namespace
  43. #endif
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif