LLVM  3.7.0
AMDGPUELFObjectWriter.cpp
Go to the documentation of this file.
1 //===-- AMDGPUELFObjectWriter.cpp - AMDGPU ELF Writer ----------------------==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 /// \file
9 //===----------------------------------------------------------------------===//
10 
11 #include "AMDGPUMCTargetDesc.h"
13 #include "llvm/MC/MCFixup.h"
14 
15 using namespace llvm;
16 
17 namespace {
18 
19 class AMDGPUELFObjectWriter : public MCELFObjectTargetWriter {
20 public:
21  AMDGPUELFObjectWriter(bool Is64Bit);
22 protected:
23  unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
24  bool IsPCRel) const override {
25  return Fixup.getKind();
26  }
27 
28 };
29 
30 
31 } // End anonymous namespace
32 
33 AMDGPUELFObjectWriter::AMDGPUELFObjectWriter(bool Is64Bit)
35  ELF::EM_AMDGPU, false) { }
36 
38  MCELFObjectTargetWriter *MOTW = new AMDGPUELFObjectWriter(Is64Bit);
39  return createELFObjectWriter(MOTW, OS, true);
40 }
This represents an "assembler immediate".
Definition: MCValue.h:44
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:62
#define false
Definition: ConvertUTF.c:65
MCFixupKind getKind() const
Definition: MCFixup.h:89
PowerPC TLS Dynamic Call Fixup
Target - Wrapper for Target specific information.
Provides AMDGPU specific target descriptions.
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:321
MCObjectWriter * createAMDGPUELFObjectWriter(bool Is64Bit, raw_pwrite_stream &OS)