blob: a84e0d3074435a57fce8b6ee288ad19430638e16 [file] [log] [blame]
//===- ObjectWriter.h -----------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_OBJECT_WRITER_INTERFACE_H
#define MCLD_OBJECT_WRITER_INTERFACE_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <llvm/Support/system_error.h>
namespace mcld {
class Module;
class MemoryArea;
class GNULDBackend;
/** \class ObjectWriter
* \brief ObjectWriter provides a common interface for object file writers.
*/
class ObjectWriter
{
protected:
ObjectWriter(GNULDBackend& pBackend);
public:
virtual ~ObjectWriter();
virtual llvm::error_code writeObject(Module& pModule, MemoryArea& pOutput) = 0;
};
} // namespace of mcld
#endif