• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Declares the driver for translating bitcode to native code.
12 ///
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 ClFlags;
27 
28 /// A compiler driver. It may be called to handle a single compile request.
29 class Compiler {
30   Compiler(const Compiler &) = delete;
31   Compiler &operator=(const Compiler &) = delete;
32 
33 public:
34   Compiler() = default;
35 
36   /// Run the compiler with the given GlobalContext for compilation state. Upon
37   /// error, the Context's error status will be set.
38   void run(const ClFlags &ExtraFlags, GlobalContext &Ctx,
39            std::unique_ptr<llvm::DataStreamer> &&InputStream);
40 };
41 
42 } // end of namespace Ice
43 
44 #endif // SUBZERO_SRC_ICECOMPILER_H
45