Chris Lattner | b162290 | 2010-07-11 22:07:02 +0000 | [diff] [blame] | 1 | //===-- llvm/MC/WinCOFFObjectWriter.cpp -------------------------*- C++ -*-===// |
| 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 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains an implementation of a Win32 COFF object file writer. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #define DEBUG_TYPE "WinCOFFObjectWriter" |
| 15 | #include "llvm/MC/MCObjectWriter.h" |
| 16 | #include "llvm/MC/MCValue.h" |
| 17 | #include "llvm/MC/MCAssembler.h" |
| 18 | #include "llvm/MC/MCAsmLayout.h" |
| 19 | using namespace llvm; |
| 20 | |
| 21 | namespace { |
| 22 | |
| 23 | class WinCOFFObjectWriter : public MCObjectWriter { |
| 24 | public: |
| 25 | WinCOFFObjectWriter(raw_ostream &OS); |
| 26 | |
| 27 | // MCObjectWriter interface implementation. |
| 28 | |
| 29 | void ExecutePostLayoutBinding(MCAssembler &Asm); |
| 30 | |
| 31 | void RecordRelocation(const MCAssembler &Asm, |
| 32 | const MCAsmLayout &Layout, |
| 33 | const MCFragment *Fragment, |
| 34 | const MCFixup &Fixup, |
| 35 | MCValue Target, |
| 36 | uint64_t &FixedValue); |
| 37 | |
| 38 | void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout); |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS) |
| 43 | : MCObjectWriter(OS, true) { |
| 44 | } |
| 45 | |
| 46 | //////////////////////////////////////////////////////////////////////////////// |
| 47 | // MCObjectWriter interface implementations |
| 48 | |
| 49 | void WinCOFFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm) { |
| 50 | } |
| 51 | |
| 52 | void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm, |
| 53 | const MCAsmLayout &Layout, |
| 54 | const MCFragment *Fragment, |
| 55 | const MCFixup &Fixup, |
| 56 | MCValue Target, |
| 57 | uint64_t &FixedValue) { |
| 58 | } |
| 59 | |
| 60 | void WinCOFFObjectWriter::WriteObject(const MCAssembler &Asm, |
| 61 | const MCAsmLayout &Layout) { |
| 62 | } |
| 63 | |
| 64 | //------------------------------------------------------------------------------ |
| 65 | // WinCOFFObjectWriter factory function |
| 66 | |
| 67 | namespace llvm { |
| 68 | MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS) { |
| 69 | return new WinCOFFObjectWriter(OS); |
| 70 | } |
| 71 | } |