Path: blob/21.2-virgl/src/gallium/auxiliary/gallivm/lp_bld_misc.h
4565 views
/**************************************************************************1*2* Copyright 2012 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_MISC_H29#define LP_BLD_MISC_H303132#include "lp_bld.h"33#include <llvm/Config/llvm-config.h>34#include <llvm-c/ExecutionEngine.h>35#include <llvm-c/Target.h>363738#ifdef __cplusplus39extern "C" {40#endif4142/*43* some shaders use function pointers incorrectly so can't be relinked44* properly. (mostly the fallback fetch shaders).45* We should fix them, but the dont_cache flag can be set for now,46* so they don't end up getting cached at all.47*/48struct lp_cached_code {49void *data;50size_t data_size;51bool dont_cache;52void *jit_obj_cache;53};5455struct lp_generated_code;5657extern LLVMTargetLibraryInfoRef58gallivm_create_target_library_info(const char *triple);5960extern void61gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info);6263extern void64lp_set_target_options(void);656667extern int68lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,69struct lp_generated_code **OutCode,70struct lp_cached_code *cache_out,71LLVMModuleRef M,72LLVMMCJITMemoryManagerRef MM,73unsigned OptLevel,74char **OutError);7576extern void77lp_free_generated_code(struct lp_generated_code *code);7879extern LLVMMCJITMemoryManagerRef80lp_get_default_memory_manager();8182extern void83lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);8485extern LLVMValueRef86lp_get_called_value(LLVMValueRef call);8788extern bool89lp_is_function(LLVMValueRef v);9091void92lp_free_objcache(void *objcache);93#ifdef __cplusplus94}95#endif969798#endif /* !LP_BLD_MISC_H */99100101