ObjectWriter.h revision 5460a1f25d9ddecb5c70667267d66d51af177a99
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 16namespace mcld 17{ 18 19class Output; 20class GNULDBackend; 21 22/** \class ObjectWriter 23 * \brief ObjectWriter provides a common interface for object file writers. 24 */ 25class ObjectWriter 26{ 27protected: 28 ObjectWriter(GNULDBackend& pBackend); 29 30public: 31 virtual ~ObjectWriter(); 32 33 virtual llvm::error_code writeObject(Output& pOutput) = 0; 34}; 35 36} // namespace of mcld 37 38#endif 39 40