LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ARMMachORelocationInfo.cpp
Go to the documentation of this file.
1 //===-- ARMMachORelocationInfo.cpp ----------------------------------------===//
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 
11 #include "ARMMCExpr.h"
12 #include "llvm/MC/MCContext.h"
13 #include "llvm/MC/MCExpr.h"
15 #include "llvm-c/Disassembler.h"
16 
17 using namespace llvm;
18 using namespace object;
19 
20 namespace {
21 class ARMMachORelocationInfo : public MCRelocationInfo {
22 public:
23  ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
24 
25  const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
26  unsigned VariantKind) {
27  switch(VariantKind) {
29  return ARMMCExpr::CreateUpper16(SubExpr, Ctx);
31  return ARMMCExpr::CreateLower16(SubExpr, Ctx);
32  default:
34  VariantKind);
35  }
36  }
37 };
38 } // End unnamed namespace
39 
40 /// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
42  return new ARMMachORelocationInfo(Ctx);
43 }
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
createARMMachORelocationInfo - Construct ARM Mach-O relocation info.
static const ARMMCExpr * CreateLower16(const MCExpr *Expr, MCContext &Ctx)
Definition: ARMMCExpr.h:43
#define LLVMDisassembler_VariantKind_ARM_HI16
Create MCExprs from relocations found in an object file.
#define LLVMDisassembler_VariantKind_ARM_LO16
static const ARMMCExpr * CreateUpper16(const MCExpr *Expr, MCContext &Ctx)
Definition: ARMMCExpr.h:39
virtual const MCExpr * createExprForCAPIVariantKind(const MCExpr *SubExpr, unsigned VariantKind)
Create an MCExpr for the target-specific VariantKind. The VariantKinds are defined in llvm-c/Disassem...