1 //===- ObjectWriter.h -----------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #ifndef MCLD_OBJECT_WRITER_INTERFACE_H 10 #define MCLD_OBJECT_WRITER_INTERFACE_H 11 #ifdef ENABLE_UNITTEST 12 #include <gtest.h> 13 #endif 14 #include <llvm/Support/system_error.h> 15 16 namespace mcld 17 { 18 19 class Output; 20 class GNULDBackend; 21 22 /** \class ObjectWriter 23 * \brief ObjectWriter provides a common interface for object file writers. 24 */ 25 class ObjectWriter 26 { 27 protected: 28 ObjectWriter(GNULDBackend& pBackend); 29 30 public: 31 virtual ~ObjectWriter(); 32 33 virtual llvm::error_code writeObject(Output& pOutput) = 0; 34 }; 35 36 } // namespace of mcld 37 38 #endif 39