LLVM 22.0.0git
SystemZGOFFObjectWriter.cpp
Go to the documentation of this file.
1//===- SystemZGOFFObjectWriter.cpp - SystemZ GOFF writer ------------------===//
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
10#include "SystemZMCAsmInfo.h"
12#include <memory>
13
14using namespace llvm;
15
16namespace {
17class SystemZGOFFObjectWriter : public MCGOFFObjectTargetWriter {
18public:
19 SystemZGOFFObjectWriter();
20
21 unsigned getRelocType(const MCValue &Target,
22 const MCFixup &Fixup) const override;
23};
24} // end anonymous namespace
25
26SystemZGOFFObjectWriter::SystemZGOFFObjectWriter()
28
29unsigned SystemZGOFFObjectWriter::getRelocType(const MCValue &Target,
30 const MCFixup &Fixup) const {
31 switch (Target.getSpecifier()) {
32 case SystemZ::S_RCon:
33 return Reloc_Type_RCon;
34 case SystemZ::S_VCon:
35 return Reloc_Type_VCon;
36 case SystemZ::S_QCon:
37 return Reloc_Type_QCon;
38 case SystemZ::S_None:
39 if (Fixup.isPCRel())
40 return Reloc_Type_RICon;
41 return Reloc_Type_ACon;
42 }
43 llvm_unreachable("Modifier not supported");
44}
45
46std::unique_ptr<MCObjectTargetWriter> llvm::createSystemZGOFFObjectWriter() {
47 return std::make_unique<SystemZGOFFObjectWriter>();
48}
PowerPC TLS Dynamic Call Fixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition MCFixup.h:61
Target - Wrapper for Target specific information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createSystemZGOFFObjectWriter()