LLVM API Documentation

MCRelocationInfo.h
Go to the documentation of this file.
00001 //==-- llvm/MC/MCRelocationInfo.h --------------------------------*- C++ -*-==//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the MCRelocationInfo class, which provides methods to
00011 // create MCExprs from relocations, either found in an object::ObjectFile
00012 // (object::RelocationRef), or provided through the C API.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #ifndef LLVM_MC_MCRELOCATIONINFO_H
00017 #define LLVM_MC_MCRELOCATIONINFO_H
00018 
00019 #include "llvm/Support/Compiler.h"
00020 
00021 namespace llvm {
00022 
00023 namespace object {
00024 class RelocationRef;
00025 }
00026 class MCExpr;
00027 class MCContext;
00028 
00029 /// \brief Create MCExprs from relocations found in an object file.
00030 class MCRelocationInfo {
00031   MCRelocationInfo(const MCRelocationInfo &) LLVM_DELETED_FUNCTION;
00032   void operator=(const MCRelocationInfo &) LLVM_DELETED_FUNCTION;
00033 
00034 protected:
00035   MCContext &Ctx;
00036 
00037 public:
00038   MCRelocationInfo(MCContext &Ctx);
00039   virtual ~MCRelocationInfo();
00040 
00041   /// \brief Create an MCExpr for the relocation \p Rel.
00042   /// \returns If possible, an MCExpr corresponding to Rel, else 0.
00043   virtual const MCExpr *createExprForRelocation(object::RelocationRef Rel);
00044 
00045   /// \brief Create an MCExpr for the target-specific \p VariantKind.
00046   /// The VariantKinds are defined in llvm-c/Disassembler.h.
00047   /// Used by MCExternalSymbolizer.
00048   /// \returns If possible, an MCExpr corresponding to VariantKind, else 0.
00049   virtual const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
00050                                                      unsigned VariantKind);
00051 };
00052 
00053 }
00054 
00055 #endif