LLVM
8.0.1
lib
Target
ARM
MCTargetDesc
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
10
#include "
ARMMCExpr.h
"
11
#include "
MCTargetDesc/ARMMCTargetDesc.h
"
12
#include "
llvm-c/Disassembler.h
"
13
#include "
llvm/MC/MCDisassembler/MCRelocationInfo.h
"
14
#include "
llvm/MC/MCExpr.h
"
15
16
using namespace
llvm
;
17
18
namespace
{
19
20
class
ARMMachORelocationInfo :
public
MCRelocationInfo
{
21
public
:
22
ARMMachORelocationInfo(
MCContext
&Ctx) :
MCRelocationInfo
(Ctx) {}
23
24
const
MCExpr
*createExprForCAPIVariantKind(
const
MCExpr
*SubExpr,
25
unsigned
VariantKind)
override
{
26
switch
(VariantKind) {
27
case
LLVMDisassembler_VariantKind_ARM_HI16
:
28
return
ARMMCExpr::createUpper16
(SubExpr, Ctx);
29
case
LLVMDisassembler_VariantKind_ARM_LO16
:
30
return
ARMMCExpr::createLower16
(SubExpr, Ctx);
31
default
:
32
return
MCRelocationInfo::createExprForCAPIVariantKind
(SubExpr,
33
VariantKind);
34
}
35
}
36
};
37
38
}
// end anonymous namespace
39
40
/// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
41
MCRelocationInfo
*
llvm::createARMMachORelocationInfo
(
MCContext
&Ctx) {
42
return
new
ARMMachORelocationInfo(Ctx);
43
}
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
Disassembler.h
llvm::createARMMachORelocationInfo
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
Construct ARM Mach-O relocation info.
Definition:
ARMMachORelocationInfo.cpp:41
ARMMCTargetDesc.h
MCRelocationInfo.h
LLVMDisassembler_VariantKind_ARM_HI16
#define LLVMDisassembler_VariantKind_ARM_HI16
The ARM target VariantKinds.
Definition:
DisassemblerTypes.h:87
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition:
MCExpr.h:36
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:63
llvm::ARMMCExpr::createLower16
static const ARMMCExpr * createLower16(const MCExpr *Expr, MCContext &Ctx)
Definition:
ARMMCExpr.h:43
LLVMDisassembler_VariantKind_ARM_LO16
#define LLVMDisassembler_VariantKind_ARM_LO16
Definition:
DisassemblerTypes.h:88
MCExpr.h
llvm::MCRelocationInfo
Create MCExprs from relocations found in an object file.
Definition:
MCRelocationInfo.h:25
ARMMCExpr.h
llvm::ARMMCExpr::createUpper16
static const ARMMCExpr * createUpper16(const MCExpr *Expr, MCContext &Ctx)
Definition:
ARMMCExpr.h:39
llvm::MCRelocationInfo::createExprForCAPIVariantKind
virtual const MCExpr * createExprForCAPIVariantKind(const MCExpr *SubExpr, unsigned VariantKind)
Create an MCExpr for the target-specific VariantKind.
Definition:
MCRelocationInfo.cpp:21
Generated on Sun Dec 20 2020 13:56:37 for LLVM by
1.8.13