/*
* Copyright © 2012 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see .
*
* Author: Benjamin Segovia
*/
/**
* \file llvm_to_gen.hpp
* \author Benjamin Segovia
*/
#ifndef __GBE_IR_LLVM_TO_GEN_HPP__
#define __GBE_IR_LLVM_TO_GEN_HPP__
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 39
#include "llvm/IR/LLVMContext.h"
#endif
namespace gbe {
namespace ir {
// The code is output into an IR unit
class Unit;
} /* namespace ir */
/*! Convert the LLVM IR code to a GEN IR code,
optLevel 0 equal to clang -O1 and 1 equal to clang -O2*/
bool llvmToGen(ir::Unit &unit, const char *fileName, const void* module,
int optLevel, bool strictMath, int profiling, std::string &errors);
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 39
extern llvm::LLVMContext& GBEGetLLVMContext();
#endif
} /* namespace gbe */
#endif /* __GBE_IR_LLVM_TO_GEN_HPP__ */