MCRelocationInfo.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/MC/MCRelocationInfo.h -------------------------------*- 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. //
  14. // This file declares the MCRelocationInfo class, which provides methods to
  15. // create MCExprs from relocations, either found in an object::ObjectFile
  16. // (object::RelocationRef), or provided through the C API.
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
  20. #define LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
  21. namespace llvm {
  22. class MCContext;
  23. class MCExpr;
  24. /// Create MCExprs from relocations found in an object file.
  25. class MCRelocationInfo {
  26. protected:
  27. MCContext &Ctx;
  28. public:
  29. MCRelocationInfo(MCContext &Ctx);
  30. MCRelocationInfo(const MCRelocationInfo &) = delete;
  31. MCRelocationInfo &operator=(const MCRelocationInfo &) = delete;
  32. virtual ~MCRelocationInfo();
  33. /// Create an MCExpr for the target-specific \p VariantKind.
  34. /// The VariantKinds are defined in llvm-c/Disassembler.h.
  35. /// Used by MCExternalSymbolizer.
  36. /// \returns If possible, an MCExpr corresponding to VariantKind, else 0.
  37. virtual const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
  38. unsigned VariantKind);
  39. };
  40. } // end namespace llvm
  41. #endif // LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif