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_LD_OBJECTWRITER_H 10#define MCLD_LD_OBJECTWRITER_H 11#include <system_error> 12 13namespace mcld { 14 15class Module; 16class FileOutputBuffer; 17 18/** \class ObjectWriter 19 * \brief ObjectWriter provides a common interface for object file writers. 20 */ 21class ObjectWriter 22{ 23protected: 24 ObjectWriter(); 25 26public: 27 virtual ~ObjectWriter(); 28 29 virtual std::error_code writeObject(Module& pModule, 30 FileOutputBuffer& pOutput) = 0; 31 32 virtual size_t getOutputSize(const Module& pModule) const = 0; 33}; 34 35} // namespace of mcld 36 37#endif 38 39