Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 1 | //===- subzero/src/IceCompiler.h - Compiler driver --------------*- C++ -*-===// |
| 2 | // |
| 3 | // The Subzero Code Generator |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Andrew Scull | 9612d32 | 2015-07-06 14:53:25 -0700 | [diff] [blame] | 9 | /// |
| 10 | /// \file |
| 11 | /// This file declares the driver for translating bitcode to native code. |
| 12 | /// |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef SUBZERO_SRC_ICECOMPILER_H |
| 16 | #define SUBZERO_SRC_ICECOMPILER_H |
| 17 | |
| 18 | #include "IceDefs.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | class DataStreamer; |
| 22 | } |
| 23 | |
| 24 | namespace Ice { |
| 25 | |
| 26 | class ClFlagsExtra; |
| 27 | |
Andrew Scull | 9612d32 | 2015-07-06 14:53:25 -0700 | [diff] [blame] | 28 | /// A compiler driver. It may be called to handle a single compile request. |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 29 | class Compiler { |
| 30 | Compiler(const Compiler &) = delete; |
| 31 | Compiler &operator=(const Compiler &) = delete; |
| 32 | |
| 33 | public: |
Jim Stichnoth | eafb56c | 2015-06-22 10:35:22 -0700 | [diff] [blame] | 34 | Compiler() = default; |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 35 | |
Andrew Scull | 9612d32 | 2015-07-06 14:53:25 -0700 | [diff] [blame] | 36 | /// Run the compiler with the given GlobalContext for compilation |
| 37 | /// state. Upon error, the Context's error status will be set. |
Jan Voung | 44c3a80 | 2015-03-27 16:29:08 -0700 | [diff] [blame] | 38 | void run(const ClFlagsExtra &ExtraFlags, GlobalContext &Ctx, |
| 39 | std::unique_ptr<llvm::DataStreamer> &&InputStream); |
| 40 | }; |
| 41 | |
| 42 | } // end of namespace Ice |
| 43 | |
| 44 | #endif // SUBZERO_SRC_ICECOMPILER_H |