[llvm-commits] [llvm] r108103 - in /llvm/trunk: include/llvm/MC/MCObjectWriter.h lib/MC/CMakeLists.txt lib/MC/WinCOFFObjectWriter.cpp
Chris Lattner
sabre at nondot.org
Sun Jul 11 15:07:02 PDT 2010
Author: lattner
Date: Sun Jul 11 17:07:02 2010
New Revision: 108103
URL: http://llvm.org/viewvc/llvm-project?rev=108103&view=rev
Log:
introduce WinCOFFObjectWriter, patch by Michael Spencer!
Added:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Modified:
llvm/trunk/include/llvm/MC/MCObjectWriter.h
llvm/trunk/lib/MC/CMakeLists.txt
Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=108103&r1=108102&r2=108103&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Sun Jul 11 17:07:02 2010
@@ -162,6 +162,8 @@
/// @}
};
+MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS);
+
} // End llvm namespace
#endif
Modified: llvm/trunk/lib/MC/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=108103&r1=108102&r2=108103&view=diff
==============================================================================
--- llvm/trunk/lib/MC/CMakeLists.txt (original)
+++ llvm/trunk/lib/MC/CMakeLists.txt Sun Jul 11 17:07:02 2010
@@ -25,5 +25,6 @@
MCValue.cpp
MachObjectWriter.cpp
WinCOFFStreamer.cpp
+ WinCOFFObjectWriter.cpp
TargetAsmBackend.cpp
)
Added: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=108103&view=auto
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (added)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Sun Jul 11 17:07:02 2010
@@ -0,0 +1,71 @@
+//===-- llvm/MC/WinCOFFObjectWriter.cpp -------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains an implementation of a Win32 COFF object file writer.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "WinCOFFObjectWriter"
+#include "llvm/MC/MCObjectWriter.h"
+#include "llvm/MC/MCValue.h"
+#include "llvm/MC/MCAssembler.h"
+#include "llvm/MC/MCAsmLayout.h"
+using namespace llvm;
+
+namespace {
+
+ class WinCOFFObjectWriter : public MCObjectWriter {
+ public:
+ WinCOFFObjectWriter(raw_ostream &OS);
+
+ // MCObjectWriter interface implementation.
+
+ void ExecutePostLayoutBinding(MCAssembler &Asm);
+
+ void RecordRelocation(const MCAssembler &Asm,
+ const MCAsmLayout &Layout,
+ const MCFragment *Fragment,
+ const MCFixup &Fixup,
+ MCValue Target,
+ uint64_t &FixedValue);
+
+ void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout);
+ };
+}
+
+WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS)
+ : MCObjectWriter(OS, true) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// MCObjectWriter interface implementations
+
+void WinCOFFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm) {
+}
+
+void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
+ const MCAsmLayout &Layout,
+ const MCFragment *Fragment,
+ const MCFixup &Fixup,
+ MCValue Target,
+ uint64_t &FixedValue) {
+}
+
+void WinCOFFObjectWriter::WriteObject(const MCAssembler &Asm,
+ const MCAsmLayout &Layout) {
+}
+
+//------------------------------------------------------------------------------
+// WinCOFFObjectWriter factory function
+
+namespace llvm {
+ MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS) {
+ return new WinCOFFObjectWriter(OS);
+ }
+}
More information about the llvm-commits
mailing list