Path: blob/21.2-virgl/src/gallium/auxiliary/gallivm/lp_bld_init.h
4565 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/262728#ifndef LP_BLD_INIT_H29#define LP_BLD_INIT_H303132#include "pipe/p_compiler.h"33#include "util/u_pointer.h" // for func_pointer34#include "lp_bld.h"35#include <llvm-c/ExecutionEngine.h>3637#ifdef __cplusplus38extern "C" {39#endif4041struct lp_cached_code;42struct gallivm_state43{44char *module_name;45LLVMModuleRef module;46LLVMExecutionEngineRef engine;47LLVMTargetDataRef target;48LLVMPassManagerRef passmgr;49LLVMPassManagerRef cgpassmgr;50LLVMContextRef context;51LLVMBuilderRef builder;52LLVMMCJITMemoryManagerRef memorymgr;53struct lp_generated_code *code;54struct lp_cached_code *cache;55unsigned compiled;56LLVMValueRef coro_malloc_hook;57LLVMValueRef coro_free_hook;58LLVMValueRef debug_printf_hook;59};606162boolean63lp_build_init(void);646566struct gallivm_state *67gallivm_create(const char *name, LLVMContextRef context,68struct lp_cached_code *cache);6970void71gallivm_destroy(struct gallivm_state *gallivm);7273void74gallivm_free_ir(struct gallivm_state *gallivm);7576void77gallivm_verify_function(struct gallivm_state *gallivm,78LLVMValueRef func);7980void81gallivm_compile_module(struct gallivm_state *gallivm);8283func_pointer84gallivm_jit_function(struct gallivm_state *gallivm,85LLVMValueRef func);8687unsigned gallivm_get_perf_flags(void);8889#ifdef __cplusplus90}91#endif9293#endif /* !LP_BLD_INIT_H */949596