LLVM 20.0.0git
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 "ARMMCExpr.h"
11#include "llvm-c/Disassembler.h"
13#include "llvm/MC/MCExpr.h"
14
15using namespace llvm;
16
17namespace {
18
19class ARMMachORelocationInfo : public MCRelocationInfo {
20public:
21 ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
22
23 const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
24 unsigned VariantKind) override {
25 switch(VariantKind) {
27 return ARMMCExpr::createUpper16(SubExpr, Ctx);
29 return ARMMCExpr::createLower16(SubExpr, Ctx);
30 default:
32 VariantKind);
33 }
34 }
35};
36
37} // end anonymous namespace
38
39/// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
41 return new ARMMachORelocationInfo(Ctx);
42}
static const ARMMCExpr * createLower16(const MCExpr *Expr, MCContext &Ctx)
Definition: ARMMCExpr.h:51
static const ARMMCExpr * createUpper16(const MCExpr *Expr, MCContext &Ctx)
Definition: ARMMCExpr.h:47
Context object for machine code objects.
Definition: MCContext.h:83
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
Create MCExprs from relocations found in an object file.
virtual const MCExpr * createExprForCAPIVariantKind(const MCExpr *SubExpr, unsigned VariantKind)
Create an MCExpr for the target-specific VariantKind.
#define LLVMDisassembler_VariantKind_ARM_HI16
The ARM target VariantKinds.
#define LLVMDisassembler_VariantKind_ARM_LO16
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
Construct ARM Mach-O relocation info.