LLVM
22.0.0git
lib
Target
ARM
MCTargetDesc
ARMMachORelocationInfo.cpp
Go to the documentation of this file.
1
//===- ARMMachORelocationInfo.cpp -----------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
ARMMCAsmInfo.h
"
10
#include "
MCTargetDesc/ARMMCTargetDesc.h
"
11
#include "
llvm-c/Disassembler.h
"
12
#include "
llvm/MC/MCDisassembler/MCRelocationInfo.h
"
13
#include "
llvm/MC/MCExpr.h
"
14
15
using namespace
llvm
;
16
17
namespace
{
18
19
class
ARMMachORelocationInfo :
public
MCRelocationInfo
{
20
public
:
21
ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
22
23
const
MCExpr *createExprForCAPIVariantKind(
const
MCExpr *SubExpr,
24
unsigned
VariantKind)
override
{
25
switch
(VariantKind) {
26
case
LLVMDisassembler_VariantKind_ARM_HI16
:
27
return
ARM::createUpper16
(SubExpr, Ctx);
28
case
LLVMDisassembler_VariantKind_ARM_LO16
:
29
return
ARM::createLower16
(SubExpr, Ctx);
30
default
:
31
return
MCRelocationInfo::createExprForCAPIVariantKind
(SubExpr,
32
VariantKind);
33
}
34
}
35
};
36
37
}
// end anonymous namespace
38
39
/// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
40
MCRelocationInfo
*
llvm::createARMMachORelocationInfo
(
MCContext
&Ctx) {
41
return
new
ARMMachORelocationInfo(Ctx);
42
}
ARMMCAsmInfo.h
ARMMCTargetDesc.h
MCExpr.h
MCRelocationInfo.h
llvm::MCContext
Context object for machine code objects.
Definition
MCContext.h:83
llvm::MCRelocationInfo
Create MCExprs from relocations found in an object file.
Definition
MCRelocationInfo.h:26
llvm::MCRelocationInfo::createExprForCAPIVariantKind
virtual const MCExpr * createExprForCAPIVariantKind(const MCExpr *SubExpr, unsigned VariantKind)
Create an MCExpr for the target-specific VariantKind.
Definition
MCRelocationInfo.cpp:20
LLVMDisassembler_VariantKind_ARM_HI16
#define LLVMDisassembler_VariantKind_ARM_HI16
The ARM target VariantKinds.
Definition
DisassemblerTypes.h:93
LLVMDisassembler_VariantKind_ARM_LO16
#define LLVMDisassembler_VariantKind_ARM_LO16
Definition
DisassemblerTypes.h:94
Disassembler.h
llvm::ARM::createLower16
const MCSpecifierExpr * createLower16(const MCExpr *Expr, MCContext &Ctx)
Definition
ARMMCAsmInfo.cpp:197
llvm::ARM::createUpper16
const MCSpecifierExpr * createUpper16(const MCExpr *Expr, MCContext &Ctx)
Definition
ARMMCAsmInfo.cpp:193
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::createARMMachORelocationInfo
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
Construct ARM Mach-O relocation info.
Definition
ARMMachORelocationInfo.cpp:40
Generated on
for LLVM by
1.14.0