blob: 6030ae660d38b843c17462ac9b16df531e23be53 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- llvm/MC/MCRelocationInfo.h -------------------------------*- 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// This file declares the MCRelocationInfo class, which provides methods to
11// create MCExprs from relocations, either found in an object::ObjectFile
12// (object::RelocationRef), or provided through the C API.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
17#define LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
18
19namespace llvm {
20
21class MCContext;
22class MCExpr;
23
Andrew Scullcdfcccc2018-10-05 20:58:37 +010024/// Create MCExprs from relocations found in an object file.
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010025class MCRelocationInfo {
26protected:
27 MCContext &Ctx;
28
29public:
30 MCRelocationInfo(MCContext &Ctx);
31 MCRelocationInfo(const MCRelocationInfo &) = delete;
32 MCRelocationInfo &operator=(const MCRelocationInfo &) = delete;
33 virtual ~MCRelocationInfo();
34
Andrew Scullcdfcccc2018-10-05 20:58:37 +010035 /// Create an MCExpr for the target-specific \p VariantKind.
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010036 /// The VariantKinds are defined in llvm-c/Disassembler.h.
37 /// Used by MCExternalSymbolizer.
38 /// \returns If possible, an MCExpr corresponding to VariantKind, else 0.
39 virtual const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
40 unsigned VariantKind);
41};
42
43} // end namespace llvm
44
45#endif // LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H