• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 class Module;
19 class MemoryArea;
20 
21 /** \class ObjectWriter
22  *  \brief ObjectWriter provides a common interface for object file writers.
23  */
24 class ObjectWriter
25 {
26 protected:
27   ObjectWriter();
28 
29 public:
30   virtual ~ObjectWriter();
31 
32   virtual llvm::error_code writeObject(Module& pModule, MemoryArea& pOutput) = 0;
33 };
34 
35 } // namespace of mcld
36 
37 #endif
38 
39