blob: 30d3b6041c4d8e859d6fa2e0351b4c5b135273d1 [file] [log] [blame]
Karl Schimpfe1e013c2014-06-27 09:15:29 -07001//===- subzero/src/IceConverter.h - Converts LLVM to ICE --------*- 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// This file declares the LLVM to ICE converter.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SUBZERO_SRC_ICECONVERTER_H
15#define SUBZERO_SRC_ICECONVERTER_H
16
Karl Schimpf8d7abae2014-07-07 14:50:30 -070017#include "IceTranslator.h"
Karl Schimpfe1e013c2014-06-27 09:15:29 -070018
19namespace llvm {
20class Module;
21}
22
23namespace Ice {
24
Karl Schimpf8d7abae2014-07-07 14:50:30 -070025class Converter : public Translator {
Karl Schimpfe1e013c2014-06-27 09:15:29 -070026public:
Karl Schimpf8d7abae2014-07-07 14:50:30 -070027 Converter(GlobalContext *Ctx, Ice::ClFlags &Flags) : Translator(Ctx, Flags) {}
Karl Schimpfb164d202014-07-11 10:26:34 -070028 /// Converts the LLVM Module to ICE. Sets exit status to false if successful,
29 /// true otherwise.
30 void convertToIce(llvm::Module *Mod);
Karl Schimpfe1e013c2014-06-27 09:15:29 -070031
Karl Schimpf8d7abae2014-07-07 14:50:30 -070032private:
Karl Schimpfb164d202014-07-11 10:26:34 -070033 // Converts globals to ICE, and then machine code.
34 void convertGlobals(llvm::Module *Mod);
35 // Converts functions to ICE, and then machine code.
36 void convertFunctions(llvm::Module *Mod);
Karl Schimpf8d7abae2014-07-07 14:50:30 -070037 Converter(const Converter &) LLVM_DELETED_FUNCTION;
38 Converter &operator=(const Converter &) LLVM_DELETED_FUNCTION;
39};
Karl Schimpfe1e013c2014-06-27 09:15:29 -070040}
41
Karl Schimpf8d7abae2014-07-07 14:50:30 -070042#endif // SUBZERO_SRC_ICECONVERTER_H