[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / lib / Target / CSKY / MCTargetDesc / CSKYELFObjectWriter.cpp
blob163632632290832c2a257594878e5cee33a81956
1 //===-- CSKYELFObjectWriter.cpp - CSKY ELF 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 //===----------------------------------------------------------------------===//
9 #include "CSKYMCTargetDesc.h"
10 #include "llvm/MC/MCContext.h"
11 #include "llvm/MC/MCELFObjectWriter.h"
12 #include "llvm/MC/MCObjectWriter.h"
14 #define DEBUG_TYPE "csky-elf-object-writer"
16 using namespace llvm;
18 namespace {
20 class CSKYELFObjectWriter : public MCELFObjectTargetWriter {
21 public:
22 CSKYELFObjectWriter(uint8_t OSABI = 0)
23 : MCELFObjectTargetWriter(false, OSABI, ELF::EM_CSKY, true){};
24 ~CSKYELFObjectWriter() {}
26 unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
27 const MCFixup &Fixup, bool IsPCRel) const override;
30 } // namespace
32 unsigned CSKYELFObjectWriter::getRelocType(MCContext &Ctx,
33 const MCValue &Target,
34 const MCFixup &Fixup,
35 bool IsPCRel) const {
36 // Determine the type of the relocation.
37 switch ((unsigned)Fixup.getKind()) {
38 default:
39 llvm_unreachable("invalid fixup kind!");
43 std::unique_ptr<MCObjectTargetWriter> llvm::createCSKYELFObjectWriter() {
44 return std::make_unique<CSKYELFObjectWriter>();