Path: blob/21.2-virgl/src/gallium/auxiliary/gallivm/lp_bld.h
4565 views
/**************************************************************************1*2* Copyright 2010 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**************************************************************************/2627/**28* @file29* Wrapper for LLVM header file #includes.30*/313233#ifndef LP_BLD_H34#define LP_BLD_H353637/**38* @file39* LLVM IR building helpers interfaces.40*41* We use LLVM-C bindings for now. They are not documented, but follow the C++42* interfaces very closely, and appear to be complete enough for code43* genration. See44* http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html45* for a standalone example.46*/4748#include <llvm/Config/llvm-config.h>4950#include <llvm-c/Core.h>51525354/**55* Redefine these LLVM entrypoints as invalid macros to make sure we56* don't accidentally use them. We need to use the functions which57* take an explicit LLVMContextRef parameter.58*/59#define LLVMInt1Type ILLEGAL_LLVM_FUNCTION60#define LLVMInt8Type ILLEGAL_LLVM_FUNCTION61#define LLVMInt16Type ILLEGAL_LLVM_FUNCTION62#define LLVMInt32Type ILLEGAL_LLVM_FUNCTION63#define LLVMInt64Type ILLEGAL_LLVM_FUNCTION64#define LLVMIntType ILLEGAL_LLVM_FUNCTION65#define LLVMFloatType ILLEGAL_LLVM_FUNCTION66#define LLVMDoubleType ILLEGAL_LLVM_FUNCTION67#define LLVMX86FP80Type ILLEGAL_LLVM_FUNCTION68#define LLVMFP128Type ILLEGAL_LLVM_FUNCTION69#define LLVMPPCFP128Type ILLEGAL_LLVM_FUNCTION70#define LLVMStructType ILLEGAL_LLVM_FUNCTION71#define LLVMVoidType ILLEGAL_LLVM_FUNCTION72#define LLVMLabelType ILLEGAL_LLVM_FUNCTION73#define LLVMOpaqueType ILLEGAL_LLVM_FUNCTION74#define LLVMUnionType ILLEGAL_LLVM_FUNCTION75#define LLVMMDString ILLEGAL_LLVM_FUNCTION76#define LLVMMDNode ILLEGAL_LLVM_FUNCTION77#define LLVMConstString ILLEGAL_LLVM_FUNCTION78#define LLVMConstStruct ILLEGAL_LLVM_FUNCTION79#define LLVMAppendBasicBlock ILLEGAL_LLVM_FUNCTION80#define LLVMInsertBasicBlock ILLEGAL_LLVM_FUNCTION81#define LLVMCreateBuilder ILLEGAL_LLVM_FUNCTION8283#if LLVM_VERSION_MAJOR >= 884#define GALLIVM_HAVE_CORO 185#else86#define GALLIVM_HAVE_CORO 087#endif8889#endif /* LP_BLD_H */909192