xref: /freebsd/contrib/llvm-project/llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1 //===-- MCRelocationInfo.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 "llvm/MC/MCDisassembler/MCRelocationInfo.h"
10 #include "llvm-c/DisassemblerTypes.h"
11 #include "llvm/MC/TargetRegistry.h"
12 
13 using namespace llvm;
14 
MCRelocationInfo(MCContext & Ctx)15 MCRelocationInfo::MCRelocationInfo(MCContext &Ctx) : Ctx(Ctx) {}
16 
17 MCRelocationInfo::~MCRelocationInfo() = default;
18 
19 const MCExpr *
createExprForCAPIVariantKind(const MCExpr * SubExpr,unsigned VariantKind)20 MCRelocationInfo::createExprForCAPIVariantKind(const MCExpr *SubExpr,
21                                                unsigned VariantKind) {
22   if (VariantKind != LLVMDisassembler_VariantKind_None)
23     return nullptr;
24   return SubExpr;
25 }
26 
createMCRelocationInfo(const Triple & TT,MCContext & Ctx)27 MCRelocationInfo *llvm::createMCRelocationInfo(const Triple &TT,
28                                                MCContext &Ctx) {
29   return new MCRelocationInfo(Ctx);
30 }
31