Path: blob/21.2-virgl/src/gallium/frontends/clover/llvm/codegen.hpp
4573 views
//1// Copyright 2016 Francisco Jerez2//3// Permission is hereby granted, free of charge, to any person obtaining a4// copy of this software and associated documentation files (the "Software"),5// to deal in the Software without restriction, including without limitation6// the rights to use, copy, modify, merge, publish, distribute, sublicense,7// and/or sell copies of the Software, and to permit persons to whom the8// Software is furnished to do so, subject to the following conditions:9//10// The above copyright notice and this permission notice shall be included in11// all copies or substantial portions of the Software.12//13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR17// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19// OTHER DEALINGS IN THE SOFTWARE.20//2122///23/// \file24/// Tools to generate various forms of binary code from existing LLVM IR in25/// the given llvm::Module object and output the result as a clover::module.26///2728#ifndef CLOVER_LLVM_CODEGEN_HPP29#define CLOVER_LLVM_CODEGEN_HPP3031#include "llvm/util.hpp"32#include "core/module.hpp"3334#include <llvm/IR/Module.h>3536#include <clang/Frontend/CompilerInstance.h>3738namespace clover {39namespace llvm {40std::string41print_module_bitcode(const ::llvm::Module &mod);4243module44build_module_library(const ::llvm::Module &mod,45enum module::section::type section_type);4647std::unique_ptr< ::llvm::Module>48parse_module_library(const module &m, ::llvm::LLVMContext &ctx,49std::string &r_log);5051module52build_module_native(::llvm::Module &mod, const target &target,53const clang::CompilerInstance &c,54std::string &r_log);5556std::string57print_module_native(const ::llvm::Module &mod, const target &target);5859module60build_module_common(const ::llvm::Module &mod,61const std::vector<char> &code,62const std::map<std::string, unsigned> &offsets,63const clang::CompilerInstance &c);64}65}6667#endif686970