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