1 //===- 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 
19 namespace llvm {
20 
21 class MCContext;
22 class MCExpr;
23 
24 /// Create MCExprs from relocations found in an object file.
25 class MCRelocationInfo {
26 protected:
27   MCContext &Ctx;
28 
29 public:
30   MCRelocationInfo(MCContext &Ctx);
31   MCRelocationInfo(const MCRelocationInfo &) = delete;
32   MCRelocationInfo &operator=(const MCRelocationInfo &) = delete;
33   virtual ~MCRelocationInfo();
34 
35   /// Create an MCExpr for the target-specific \p VariantKind.
36   /// 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
46