LLVM API Documentation

AMDGPUELFObjectWriter.cpp
Go to the documentation of this file.
00001 //===-- AMDGPUELFObjectWriter.cpp - AMDGPU ELF Writer ----------------------==//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 /// \file
00009 //===----------------------------------------------------------------------===//
00010 
00011 #include "AMDGPUMCTargetDesc.h"
00012 #include "llvm/MC/MCELFObjectWriter.h"
00013 #include "llvm/MC/MCFixup.h"
00014 
00015 using namespace llvm;
00016 
00017 namespace {
00018 
00019 class AMDGPUELFObjectWriter : public MCELFObjectTargetWriter {
00020 public:
00021   AMDGPUELFObjectWriter();
00022 protected:
00023   unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
00024                         bool IsPCRel) const override {
00025     return Fixup.getKind();
00026   }
00027 
00028 };
00029 
00030 
00031 } // End anonymous namespace
00032 
00033 AMDGPUELFObjectWriter::AMDGPUELFObjectWriter()
00034   : MCELFObjectTargetWriter(false, 0, 0, false) { }
00035 
00036 MCObjectWriter *llvm::createAMDGPUELFObjectWriter(raw_ostream &OS) {
00037   MCELFObjectTargetWriter *MOTW = new AMDGPUELFObjectWriter();
00038   return createELFObjectWriter(MOTW, OS, true);
00039 }