blob: 3f2956d43d14d71a4f3173cf16b1dd2a4d6b7183 [file] [log] [blame]
Jan Voung44c3a802015-03-27 16:29:08 -07001//===- 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 Scull9612d322015-07-06 14:53:25 -07009///
10/// \file
Jim Stichnoth92a6e5b2015-12-02 16:52:44 -080011/// \brief Declares the driver for translating bitcode to native code.
Andrew Scull9612d322015-07-06 14:53:25 -070012///
Jan Voung44c3a802015-03-27 16:29:08 -070013//===----------------------------------------------------------------------===//
14
15#ifndef SUBZERO_SRC_ICECOMPILER_H
16#define SUBZERO_SRC_ICECOMPILER_H
17
18#include "IceDefs.h"
19
20namespace llvm {
21class DataStreamer;
22}
23
24namespace Ice {
25
John Portoc5bc5cb2016-03-21 11:18:02 -070026class ClFlags;
Jan Voung44c3a802015-03-27 16:29:08 -070027
Andrew Scull9612d322015-07-06 14:53:25 -070028/// A compiler driver. It may be called to handle a single compile request.
Jan Voung44c3a802015-03-27 16:29:08 -070029class Compiler {
30 Compiler(const Compiler &) = delete;
31 Compiler &operator=(const Compiler &) = delete;
32
33public:
Jim Stichnotheafb56c2015-06-22 10:35:22 -070034 Compiler() = default;
Jan Voung44c3a802015-03-27 16:29:08 -070035
Andrew Scull57e12682015-09-16 11:30:19 -070036 /// Run the compiler with the given GlobalContext for compilation state. Upon
37 /// error, the Context's error status will be set.
John Portoc5bc5cb2016-03-21 11:18:02 -070038 void run(const ClFlags &ExtraFlags, GlobalContext &Ctx,
Jan Voung44c3a802015-03-27 16:29:08 -070039 std::unique_ptr<llvm::DataStreamer> &&InputStream);
40};
41
42} // end of namespace Ice
43
44#endif // SUBZERO_SRC_ICECOMPILER_H