Merge pull request #3887 from odin-lang/windows-llvm-18

Update to LLVM 18.1.8 for Windows
This commit is contained in:
gingerBill
2024-07-08 13:25:22 +01:00
committed by GitHub
36 changed files with 651 additions and 113 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -19,8 +19,8 @@
#ifndef LLVM_C_ANALYSIS_H
#define LLVM_C_ANALYSIS_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -19,8 +19,8 @@
#ifndef LLVM_C_BITREADER_H
#define LLVM_C_BITREADER_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -19,8 +19,8 @@
#ifndef LLVM_C_BITWRITER_H
#define LLVM_C_BITWRITER_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -14,8 +14,8 @@
#ifndef LLVM_C_COMDAT_H
#define LLVM_C_COMDAT_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -27,18 +27,20 @@
LLVM_ASM_PARSER(AArch64)
LLVM_ASM_PARSER(AMDGPU)
LLVM_ASM_PARSER(ARM)
LLVM_ASM_PARSER(AVR)
LLVM_ASM_PARSER(BPF)
LLVM_ASM_PARSER(Hexagon)
LLVM_ASM_PARSER(Lanai)
LLVM_ASM_PARSER(LoongArch)
LLVM_ASM_PARSER(Mips)
LLVM_ASM_PARSER(MSP430)
LLVM_ASM_PARSER(PowerPC)
LLVM_ASM_PARSER(RISCV)
LLVM_ASM_PARSER(Sparc)
LLVM_ASM_PARSER(SystemZ)
LLVM_ASM_PARSER(VE)
LLVM_ASM_PARSER(WebAssembly)
LLVM_ASM_PARSER(X86)
LLVM_ASM_PARSER(AVR)
#undef LLVM_ASM_PARSER

View File

@@ -27,9 +27,11 @@
LLVM_ASM_PRINTER(AArch64)
LLVM_ASM_PRINTER(AMDGPU)
LLVM_ASM_PRINTER(ARM)
LLVM_ASM_PRINTER(AVR)
LLVM_ASM_PRINTER(BPF)
LLVM_ASM_PRINTER(Hexagon)
LLVM_ASM_PRINTER(Lanai)
LLVM_ASM_PRINTER(LoongArch)
LLVM_ASM_PRINTER(Mips)
LLVM_ASM_PRINTER(MSP430)
LLVM_ASM_PRINTER(NVPTX)
@@ -37,10 +39,10 @@ LLVM_ASM_PRINTER(PowerPC)
LLVM_ASM_PRINTER(RISCV)
LLVM_ASM_PRINTER(Sparc)
LLVM_ASM_PRINTER(SystemZ)
LLVM_ASM_PRINTER(VE)
LLVM_ASM_PRINTER(WebAssembly)
LLVM_ASM_PRINTER(X86)
LLVM_ASM_PRINTER(XCore)
LLVM_ASM_PRINTER(AVR)
#undef LLVM_ASM_PRINTER

View File

@@ -27,19 +27,21 @@
LLVM_DISASSEMBLER(AArch64)
LLVM_DISASSEMBLER(AMDGPU)
LLVM_DISASSEMBLER(ARM)
LLVM_DISASSEMBLER(AVR)
LLVM_DISASSEMBLER(BPF)
LLVM_DISASSEMBLER(Hexagon)
LLVM_DISASSEMBLER(Lanai)
LLVM_DISASSEMBLER(LoongArch)
LLVM_DISASSEMBLER(Mips)
LLVM_DISASSEMBLER(MSP430)
LLVM_DISASSEMBLER(PowerPC)
LLVM_DISASSEMBLER(RISCV)
LLVM_DISASSEMBLER(Sparc)
LLVM_DISASSEMBLER(SystemZ)
LLVM_DISASSEMBLER(VE)
LLVM_DISASSEMBLER(WebAssembly)
LLVM_DISASSEMBLER(X86)
LLVM_DISASSEMBLER(XCore)
LLVM_DISASSEMBLER(AVR)
#undef LLVM_DISASSEMBLER

View File

@@ -0,0 +1,33 @@
/*===----- llvm/Config/TargetExegesis.def - LLVM Target Exegesis-*- C++ -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. *|
|* See https://llvm.org/LICENSE.txt for license information. *|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file enumerates all of the target's of llvm-exegesis *|
|* supported by this build of LLVM. Clients of this file should define *|
|* the LLVM_EXEGISIS macro to be a function-like macro with a *|
|* single parameter (the name of the target whose assembly can be *|
|* generated); including this file will then enumerate all of the *|
|* targets with target llvm-exegsis support. *|
|* *|
|* The set of targets supported by LLVM is generated at configuration *|
|* time, at which point this header is generated. Do not modify this *|
|* header directly. *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifndef LLVM_EXEGESIS
# error Please define the macro LLVM_EXEGESIS(TargetName)
#endif
LLVM_EXEGESIS(AArch64)
LLVM_EXEGESIS(Mips)
LLVM_EXEGESIS(PowerPC)
LLVM_EXEGESIS(X86)
#undef LLVM_EXEGESIS

View File

@@ -0,0 +1,32 @@
/*===------ llvm/Config/TargetMCAs.def - LLVM Target MCAs -------*- C++ -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. *|
|* See https://llvm.org/LICENSE.txt for license information. *|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file enumerates all of the target MCAs *|
|* supported by this build of LLVM. Clients of this file should define *|
|* the LLVM_TARGETMCA macro to be a function-like macro with a *|
|* single parameter (the name of the target whose assembly can be *|
|* generated); including this file will then enumerate all of the *|
|* targets with target MCAs. *|
|* *|
|* The set of targets supported by LLVM is generated at configuration *|
|* time, at which point this header is generated. Do not modify this *|
|* header directly. *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifndef LLVM_TARGETMCA
# error Please define the macro LLVM_TARGETMCA(TargetName)
#endif
LLVM_TARGETMCA(AMDGPU)
LLVM_TARGETMCA(RISCV)
LLVM_TARGETMCA(X86)
#undef LLVM_TARGETMCA

View File

@@ -26,9 +26,11 @@
LLVM_TARGET(AArch64)
LLVM_TARGET(AMDGPU)
LLVM_TARGET(ARM)
LLVM_TARGET(AVR)
LLVM_TARGET(BPF)
LLVM_TARGET(Hexagon)
LLVM_TARGET(Lanai)
LLVM_TARGET(LoongArch)
LLVM_TARGET(Mips)
LLVM_TARGET(MSP430)
LLVM_TARGET(NVPTX)
@@ -36,10 +38,10 @@ LLVM_TARGET(PowerPC)
LLVM_TARGET(RISCV)
LLVM_TARGET(Sparc)
LLVM_TARGET(SystemZ)
LLVM_TARGET(VE)
LLVM_TARGET(WebAssembly)
LLVM_TARGET(X86)
LLVM_TARGET(XCore)
LLVM_TARGET(AVR)
#undef LLVM_TARGET

View File

@@ -1,4 +1,4 @@
/*===------- llvm-c/Config//abi-breaking.h - llvm configuration -------*- C -*-===*/
/*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/
/* */
/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */
/* Exceptions. */
@@ -20,7 +20,7 @@
/* Allow selectively disabling link-time mismatch checking so that header-only
ADT content from LLVM can be used without linking libSupport. */
#if !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
#if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
// ABI_BREAKING_CHECKS protection: provides link-time failure when clients build
// mismatch with LLVM

View File

@@ -1,4 +1,4 @@
/*===------- llvm-c/Config//llvm-config.h - llvm configuration -------*- C -*-===*/
/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/
/* */
/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */
/* Exceptions. */
@@ -17,10 +17,8 @@
/* Define if LLVM_ENABLE_DUMP is enabled */
/* #undef LLVM_ENABLE_DUMP */
/* Define if we link Polly to the tools */
/* #undef LINK_POLLY_INTO_TOOLS */
/* Target triple LLVM will generate code for by default */
/* Doesn't use `cmakedefine` because it is allowed to be empty. */
#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-pc-windows-msvc"
/* Define if threads enabled */
@@ -53,6 +51,84 @@
/* LLVM name for the native target MC init function, if available */
#define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC
/* LLVM name for the native target MCA init function, if available */
/* #undef LLVM_NATIVE_TARGETMCA */
/* Define if the AArch64 target is built in */
#define LLVM_HAS_AARCH64_TARGET 1
/* Define if the AMDGPU target is built in */
#define LLVM_HAS_AMDGPU_TARGET 1
/* Define if the ARC target is built in */
#define LLVM_HAS_ARC_TARGET 0
/* Define if the ARM target is built in */
#define LLVM_HAS_ARM_TARGET 1
/* Define if the AVR target is built in */
#define LLVM_HAS_AVR_TARGET 1
/* Define if the BPF target is built in */
#define LLVM_HAS_BPF_TARGET 1
/* Define if the CSKY target is built in */
#define LLVM_HAS_CSKY_TARGET 0
/* Define if the DirectX target is built in */
#define LLVM_HAS_DIRECTX_TARGET 0
/* Define if the Hexagon target is built in */
#define LLVM_HAS_HEXAGON_TARGET 1
/* Define if the Lanai target is built in */
#define LLVM_HAS_LANAI_TARGET 1
/* Define if the LoongArch target is built in */
#define LLVM_HAS_LOONGARCH_TARGET 1
/* Define if the M68k target is built in */
#define LLVM_HAS_M68K_TARGET 0
/* Define if the Mips target is built in */
#define LLVM_HAS_MIPS_TARGET 1
/* Define if the MSP430 target is built in */
#define LLVM_HAS_MSP430_TARGET 1
/* Define if the NVPTX target is built in */
#define LLVM_HAS_NVPTX_TARGET 1
/* Define if the PowerPC target is built in */
#define LLVM_HAS_POWERPC_TARGET 1
/* Define if the RISCV target is built in */
#define LLVM_HAS_RISCV_TARGET 1
/* Define if the Sparc target is built in */
#define LLVM_HAS_SPARC_TARGET 1
/* Define if the SPIRV target is built in */
#define LLVM_HAS_SPIRV_TARGET 0
/* Define if the SystemZ target is built in */
#define LLVM_HAS_SYSTEMZ_TARGET 1
/* Define if the VE target is built in */
#define LLVM_HAS_VE_TARGET 1
/* Define if the WebAssembly target is built in */
#define LLVM_HAS_WEBASSEMBLY_TARGET 1
/* Define if the X86 target is built in */
#define LLVM_HAS_X86_TARGET 1
/* Define if the XCore target is built in */
#define LLVM_HAS_XCORE_TARGET 1
/* Define if the Xtensa target is built in */
#define LLVM_HAS_XTENSA_TARGET 0
/* Define if this is Unixish platform */
/* #undef LLVM_ON_UNIX */
@@ -66,20 +142,60 @@
#define LLVM_USE_PERF 0
/* Major version of the LLVM API */
#define LLVM_VERSION_MAJOR 17
#define LLVM_VERSION_MAJOR 18
/* Minor version of the LLVM API */
#define LLVM_VERSION_MINOR 0
#define LLVM_VERSION_MINOR 1
/* Patch version of the LLVM API */
#define LLVM_VERSION_PATCH 1
#define LLVM_VERSION_PATCH 8
/* LLVM version string */
#define LLVM_VERSION_STRING "17.0.1"
#define LLVM_VERSION_STRING "18.1.8"
/* Whether LLVM records statistics for use with GetStatistics(),
* PrintStatistics() or PrintStatisticsJSON()
*/
#define LLVM_FORCE_ENABLE_STATS 0
/* Define if we have z3 and want to build it */
/* #undef LLVM_WITH_Z3 */
/* Define if we have curl and want to use it */
/* #undef LLVM_ENABLE_CURL */
/* Define if we have cpp-httplib and want to use it */
/* #undef LLVM_ENABLE_HTTPLIB */
/* Define if zlib compression is available */
#define LLVM_ENABLE_ZLIB 0
/* Define if zstd compression is available */
#define LLVM_ENABLE_ZSTD 0
/* Define if LLVM is using tflite */
/* #undef LLVM_HAVE_TFLITE */
/* Define to 1 if you have the <sysexits.h> header file. */
/* #undef HAVE_SYSEXITS_H */
/* Define if building libLLVM shared library */
/* #undef LLVM_BUILD_LLVM_DYLIB */
/* Define if building LLVM with BUILD_SHARED_LIBS */
/* #undef LLVM_BUILD_SHARED_LIBS */
/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */
/* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN */
/* Define if llvm_unreachable should be optimized with undefined behavior
* in non assert builds */
#define LLVM_UNREACHABLE_OPTIMIZE 1
/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
#define LLVM_ENABLE_DIA_SDK 1
/* Define if plugins enabled */
/* #undef LLVM_ENABLE_PLUGINS */
#endif

View File

@@ -15,11 +15,11 @@
#ifndef LLVM_C_CORE_H
#define LLVM_C_CORE_H
#include "llvm-c/Deprecated.h"
#include "llvm-c/ErrorHandling.h"
#include "llvm-c/ExternC.h"
#include "Deprecated.h"
#include "ErrorHandling.h"
#include "ExternC.h"
#include "llvm-c/Types.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN
@@ -216,7 +216,6 @@ typedef enum {
LLVMColdCallConv = 9,
LLVMGHCCallConv = 10,
LLVMHiPECallConv = 11,
LLVMWebKitJSCallConv = 12,
LLVMAnyRegCallConv = 13,
LLVMPreserveMostCallConv = 14,
LLVMPreserveAllCallConv = 15,
@@ -468,8 +467,45 @@ enum {
LLVMAttributeFunctionIndex = -1,
};
/**
* Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
*
* Note that 'musttail' implies 'tail'.
*
* @see CallInst::TailCallKind
*/
typedef enum {
LLVMTailCallKindNone = 0,
LLVMTailCallKindTail = 1,
LLVMTailCallKindMustTail = 2,
LLVMTailCallKindNoTail = 3,
} LLVMTailCallKind;
typedef unsigned LLVMAttributeIndex;
enum {
LLVMFastMathAllowReassoc = (1 << 0),
LLVMFastMathNoNaNs = (1 << 1),
LLVMFastMathNoInfs = (1 << 2),
LLVMFastMathNoSignedZeros = (1 << 3),
LLVMFastMathAllowReciprocal = (1 << 4),
LLVMFastMathAllowContract = (1 << 5),
LLVMFastMathApproxFunc = (1 << 6),
LLVMFastMathNone = 0,
LLVMFastMathAll = LLVMFastMathAllowReassoc | LLVMFastMathNoNaNs |
LLVMFastMathNoInfs | LLVMFastMathNoSignedZeros |
LLVMFastMathAllowReciprocal | LLVMFastMathAllowContract |
LLVMFastMathApproxFunc,
};
/**
* Flags to indicate what fast-math-style optimizations are allowed
* on operations.
*
* See https://llvm.org/docs/LangRef.html#fast-math-flags
*/
typedef unsigned LLVMFastMathFlags;
/**
* @}
*/
@@ -890,12 +926,58 @@ void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
*
* @see InlineAsm::get()
*/
LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, char *AsmString,
size_t AsmStringSize, char *Constraints,
LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString,
size_t AsmStringSize, const char *Constraints,
size_t ConstraintsSize, LLVMBool HasSideEffects,
LLVMBool IsAlignStack,
LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
/**
* Get the template string used for an inline assembly snippet
*
*/
const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len);
/**
* Get the raw constraint string for an inline assembly snippet
*
*/
const char *LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal,
size_t *Len);
/**
* Get the dialect used by the inline asm snippet
*
*/
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal);
/**
* Get the function type of the inline assembly snippet. The same type that
* was passed into LLVMGetInlineAsm originally
*
* @see LLVMGetInlineAsm
*
*/
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal);
/**
* Get if the inline asm snippet has side effects
*
*/
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal);
/**
* Get if the inline asm snippet needs an aligned stack
*
*/
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal);
/**
* Get if the inline asm snippet may unwind the stack
*
*/
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal);
/**
* Obtain the context to which this module is associated.
*
@@ -2216,45 +2298,26 @@ LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
LLVMValueRef *ConstantIndices, unsigned NumIndices);
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
LLVMValueRef *ConstantIndices,
unsigned NumIndices);
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
LLVMTypeRef ToType);
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
LLVMTypeRef ToType);
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
LLVMTypeRef ToType);
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
LLVMTypeRef ToType);
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
LLVMBool isSigned);
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
LLVMValueRef IndexConstant);
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
@@ -2960,6 +3023,74 @@ LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals,
/** Deprecated: Use LLVMMDNodeInContext2 instead. */
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
/**
* @}
*/
/**
* @defgroup LLVMCCoreOperandBundle Operand Bundles
*
* Functions in this group operate on LLVMOperandBundleRef instances that
* correspond to llvm::OperandBundleDef instances.
*
* @see llvm::OperandBundleDef
*
* @{
*/
/**
* Create a new operand bundle.
*
* Every invocation should be paired with LLVMDisposeOperandBundle() or memory
* will be leaked.
*
* @param Tag Tag name of the operand bundle
* @param TagLen Length of Tag
* @param Args Memory address of an array of bundle operands
* @param NumArgs Length of Args
*/
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen,
LLVMValueRef *Args,
unsigned NumArgs);
/**
* Destroy an operand bundle.
*
* This must be called for every created operand bundle or memory will be
* leaked.
*/
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle);
/**
* Obtain the tag of an operand bundle as a string.
*
* @param Bundle Operand bundle to obtain tag of.
* @param Len Out parameter which holds the length of the returned string.
* @return The tag name of Bundle.
* @see OperandBundleDef::getTag()
*/
const char *LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len);
/**
* Obtain the number of operands for an operand bundle.
*
* @param Bundle Operand bundle to obtain operand count of.
* @return The number of operands.
* @see OperandBundleDef::input_size()
*/
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle);
/**
* Obtain the operand for an operand bundle at the given index.
*
* @param Bundle Operand bundle to obtain operand of.
* @param Index An operand index, must be less than
* LLVMGetNumOperandBundleArgs().
* @return The operand.
*/
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle,
unsigned Index);
/**
* @}
*/
@@ -3411,6 +3542,24 @@ LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C);
*/
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr);
/**
* Obtain the number of operand bundles attached to this instruction.
*
* This only works on llvm::CallInst and llvm::InvokeInst instructions.
*
* @see llvm::CallBase::getNumOperandBundles()
*/
unsigned LLVMGetNumOperandBundles(LLVMValueRef C);
/**
* Obtain the operand bundle attached to this instruction at the given index.
* Use LLVMDisposeOperandBundle to free the operand bundle.
*
* This only works on llvm::CallInst and llvm::InvokeInst instructions.
*/
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C,
unsigned Index);
/**
* Obtain whether a call instruction is a tail call.
*
@@ -3429,6 +3578,20 @@ LLVMBool LLVMIsTailCall(LLVMValueRef CallInst);
*/
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
/**
* Obtain a tail call kind of the call instruction.
*
* @see llvm::CallInst::setTailCallKind()
*/
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst);
/**
* Set the call kind of the call instruction.
*
* @see llvm::CallInst::getTailCallKind()
*/
void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind);
/**
* Return the normal destination basic block.
*
@@ -3761,6 +3924,10 @@ LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn,
LLVMValueRef *Args, unsigned NumArgs,
LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
const char *Name);
LLVMValueRef LLVMBuildInvokeWithOperandBundles(
LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args,
unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
/* Exception Handling */
@@ -3920,6 +4087,55 @@ void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
/**
* Gets if the instruction has the non-negative flag set.
* Only valid for zext instructions.
*/
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst);
/**
* Sets the non-negative flag for the instruction.
* Only valid for zext instructions.
*/
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
/**
* Get the flags for which fast-math-style optimizations are allowed for this
* value.
*
* Only valid on floating point instructions.
* @see LLVMCanValueUseFastMathFlags
*/
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst);
/**
* Sets the flags for which fast-math-style optimizations are allowed for this
* value.
*
* Only valid on floating point instructions.
* @see LLVMCanValueUseFastMathFlags
*/
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF);
/**
* Check if a given value can potentially have fast math flags.
*
* Will return true for floating point arithmetic instructions, and for select,
* phi, and call instructions whose type is a floating point type, or a vector
* or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
*/
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst);
/**
* Gets whether the instruction has the disjoint flag set.
* Only valid for or instructions.
*/
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst);
/**
* Sets the disjoint flag for the instruction.
* Only valid for or instructions.
*/
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
/* Memory */
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
@@ -4045,6 +4261,11 @@ LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn,
LLVMValueRef *Args, unsigned NumArgs,
const char *Name);
LLVMValueRef
LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn,
LLVMValueRef *Args, unsigned NumArgs,
LLVMOperandBundleRef *Bundles,
unsigned NumBundles, const char *Name);
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
LLVMValueRef Then, LLVMValueRef Else,
const char *Name);

View File

@@ -16,8 +16,8 @@
#ifndef LLVM_C_DEBUGINFO_H
#define LLVM_C_DEBUGINFO_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -15,8 +15,8 @@
#ifndef LLVM_C_DISASSEMBLER_H
#define LLVM_C_DISASSEMBLER_H
#include "llvm-c/DisassemblerTypes.h"
#include "llvm-c/ExternC.h"
#include "DisassemblerTypes.h"
#include "ExternC.h"
/**
* @defgroup LLVMCDisassembler Disassembler

View File

@@ -10,7 +10,7 @@
#ifndef LLVM_C_DISASSEMBLERTYPES_H
#define LLVM_C_DISASSEMBLERTYPES_H
#include "llvm-c/DataTypes.h"
#include "DataTypes.h"
#ifdef __cplusplus
#include <cstddef>
#else

View File

@@ -14,7 +14,7 @@
#ifndef LLVM_C_ERROR_H
#define LLVM_C_ERROR_H
#include "llvm-c/ExternC.h"
#include "ExternC.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -14,7 +14,7 @@
#ifndef LLVM_C_ERRORHANDLING_H
#define LLVM_C_ERRORHANDLING_H
#include "llvm-c/ExternC.h"
#include "ExternC.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -19,10 +19,10 @@
#ifndef LLVM_C_EXECUTIONENGINE_H
#define LLVM_C_EXECUTIONENGINE_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Target.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Target.h"
#include "TargetMachine.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -14,8 +14,8 @@
#ifndef LLVM_C_IRREADER_H
#define LLVM_C_IRREADER_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -1,4 +1,4 @@
/*===----------- llvm-c/LLJIT.h - OrcV2 LLJIT C bindings --------*- C++ -*-===*\
/*===----------- llvm-c/LLJIT.h - OrcV2 LLJIT C bindings ----------*- C -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. *|
@@ -24,10 +24,10 @@
#ifndef LLVM_C_LLJIT_H
#define LLVM_C_LLJIT_H
#include "llvm-c/Error.h"
#include "llvm-c/Orc.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
#include "Error.h"
#include "Orc.h"
#include "TargetMachine.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

52
src/llvm-c/LLJITUtils.h Normal file
View File

@@ -0,0 +1,52 @@
/*===------- llvm-c/LLJITUtils.h - Advanced LLJIT features --------*- C -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. *|
|* See https://llvm.org/LICENSE.txt for license information. *|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header declares the C interface for extra utilities to be used with *|
|* the LLJIT class from the llvm-c/LLJIT.h header. It requires to following *|
|* link libraries in addition to libLLVMOrcJIT.a: *|
|* - libLLVMOrcDebugging.a *|
|* *|
|* Many exotic languages can interoperate with C code but have a harder time *|
|* with C++ due to name mangling. So in addition to C, this interface enables *|
|* tools written in such languages. *|
|* *|
|* Note: This interface is experimental. It is *NOT* stable, and may be *|
|* changed without warning. Only C API usage documentation is *|
|* provided. See the C++ documentation for all higher level ORC API *|
|* details. *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifndef LLVM_C_LLJITUTILS_H
#define LLVM_C_LLJITUTILS_H
#include "LLJIT.h"
LLVM_C_EXTERN_C_BEGIN
/**
* @defgroup LLVMCExecutionEngineLLJITUtils LLJIT Utilities
* @ingroup LLVMCExecutionEngineLLJIT
*
* @{
*/
/**
* Install the plugin that submits debug objects to the executor. Executors must
* expose the llvm_orc_registerJITLoaderGDBWrapper symbol.
*/
LLVMErrorRef LLVMOrcLLJITEnableDebugSupport(LLVMOrcLLJITRef J);
/**
* @}
*/
LLVM_C_EXTERN_C_END
#endif /* LLVM_C_LLJITUTILS_H */

View File

@@ -14,8 +14,8 @@
#ifndef LLVM_C_LINKER_H
#define LLVM_C_LINKER_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -19,9 +19,9 @@
#ifndef LLVM_C_OBJECT_H
#define LLVM_C_OBJECT_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "llvm-c/Config//llvm-config.h"
#include "ExternC.h"
#include "Types.h"
#include "Config/llvm-config.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -27,9 +27,9 @@
#ifndef LLVM_C_ORC_H
#define LLVM_C_ORC_H
#include "llvm-c/Error.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
#include "Error.h"
#include "TargetMachine.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN
@@ -346,7 +346,7 @@ typedef struct LLVMOrcOpaqueLookupState *LLVMOrcLookupStateRef;
* into.
*
* The JDLookupFlags argument can be inspected to determine whether the original
* lookup included non-exported symobls.
* lookup included non-exported symbols.
*
* Finally, the LookupSet argument contains the set of symbols that could not
* be found in JD already (the set of generation candidates).
@@ -508,7 +508,7 @@ void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
* Intern a string in the ExecutionSession's SymbolStringPool and return a
* reference to it. This increments the ref-count of the pool entry, and the
* returned value should be released once the client is done with it by
* calling LLVMOrReleaseSymbolStringPoolEntry.
* calling LLVMOrcReleaseSymbolStringPoolEntry.
*
* Since strings are uniqued within the SymbolStringPool
* LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string
@@ -796,7 +796,7 @@ void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
* method returns an error then clients should log it and call
* LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies
* have been registered for the symbols covered by this
* MaterializationResponsibiility then this method is guaranteed to return
* MaterializationResponsibility then this method is guaranteed to return
* LLVMErrorSuccess.
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
@@ -813,7 +813,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
* method returns an error then clients should log it and call
* LLVMOrcMaterializationResponsibilityFailMaterialization.
* If no dependencies have been registered for the symbols covered by this
* MaterializationResponsibiility then this method is guaranteed to return
* MaterializationResponsibility then this method is guaranteed to return
* LLVMErrorSuccess.
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
@@ -839,7 +839,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
/**
* Notify all not-yet-emitted covered by this MaterializationResponsibility
* instance that an error has occurred.
* This will remove all symbols covered by this MaterializationResponsibilty
* This will remove all symbols covered by this MaterializationResponsibility
* from the target JITDylib, and send an error to any queries waiting on
* these symbols.
*/

View File

@@ -24,11 +24,11 @@
#ifndef LLVM_C_ORCEE_H
#define LLVM_C_ORCEE_H
#include "llvm-c/Error.h"
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/Orc.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
#include "Error.h"
#include "ExecutionEngine.h"
#include "Orc.h"
#include "TargetMachine.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -15,8 +15,8 @@
#ifndef LLVM_C_REMARKS_H
#define LLVM_C_REMARKS_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Types.h"
#ifdef __cplusplus
#include <cstddef>
#else

View File

@@ -14,9 +14,9 @@
#ifndef LLVM_C_SUPPORT_H
#define LLVM_C_SUPPORT_H
#include "llvm-c/DataTypes.h"
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "DataTypes.h"
#include "ExternC.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN

View File

@@ -19,9 +19,9 @@
#ifndef LLVM_C_TARGET_H
#define LLVM_C_TARGET_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "llvm-c/Config//llvm-config.h"
#include "ExternC.h"
#include "Types.h"
#include "Config/llvm-config.h"
LLVM_C_EXTERN_C_BEGIN
@@ -40,34 +40,34 @@ typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef;
/* Declare all of the target-initialization functions that are available. */
#define LLVM_TARGET(TargetName) \
void LLVMInitialize##TargetName##TargetInfo(void);
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void);
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
#define LLVM_TARGET(TargetName) \
void LLVMInitialize##TargetName##TargetMC(void);
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
/* Declare all of the available assembly printer initialization functions. */
#define LLVM_ASM_PRINTER(TargetName) \
void LLVMInitialize##TargetName##AsmPrinter(void);
#include "llvm-c/Config//AsmPrinters.def"
#include "Config/AsmPrinters.def"
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
/* Declare all of the available assembly parser initialization functions. */
#define LLVM_ASM_PARSER(TargetName) \
void LLVMInitialize##TargetName##AsmParser(void);
#include "llvm-c/Config//AsmParsers.def"
#include "Config/AsmParsers.def"
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
/* Declare all of the available disassembler initialization functions. */
#define LLVM_DISASSEMBLER(TargetName) \
void LLVMInitialize##TargetName##Disassembler(void);
#include "llvm-c/Config//Disassemblers.def"
#include "Config/Disassemblers.def"
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
/** LLVMInitializeAllTargetInfos - The main program should call this function if
@@ -75,7 +75,7 @@ typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef;
support. */
static inline void LLVMInitializeAllTargetInfos(void) {
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
}
@@ -84,7 +84,7 @@ static inline void LLVMInitializeAllTargetInfos(void) {
support. */
static inline void LLVMInitializeAllTargets(void) {
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
}
@@ -93,7 +93,7 @@ static inline void LLVMInitializeAllTargets(void) {
support. */
static inline void LLVMInitializeAllTargetMCs(void) {
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
#include "llvm-c/Config//Targets.def"
#include "Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
}
@@ -102,7 +102,7 @@ static inline void LLVMInitializeAllTargetMCs(void) {
available via the TargetRegistry. */
static inline void LLVMInitializeAllAsmPrinters(void) {
#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
#include "llvm-c/Config//AsmPrinters.def"
#include "Config/AsmPrinters.def"
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
}
@@ -111,7 +111,7 @@ static inline void LLVMInitializeAllAsmPrinters(void) {
available via the TargetRegistry. */
static inline void LLVMInitializeAllAsmParsers(void) {
#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
#include "llvm-c/Config//AsmParsers.def"
#include "Config/AsmParsers.def"
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
}
@@ -121,7 +121,7 @@ static inline void LLVMInitializeAllAsmParsers(void) {
static inline void LLVMInitializeAllDisassemblers(void) {
#define LLVM_DISASSEMBLER(TargetName) \
LLVMInitialize##TargetName##Disassembler();
#include "llvm-c/Config//Disassemblers.def"
#include "Config/Disassemblers.def"
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
}

View File

@@ -19,9 +19,9 @@
#ifndef LLVM_C_TARGETMACHINE_H
#define LLVM_C_TARGETMACHINE_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Target.h"
#include "llvm-c/Types.h"
#include "ExternC.h"
#include "Target.h"
#include "Types.h"
LLVM_C_EXTERN_C_BEGIN
@@ -31,6 +31,7 @@ LLVM_C_EXTERN_C_BEGIN
* @{
*/
typedef struct LLVMOpaqueTargetMachineOptions *LLVMTargetMachineOptionsRef;
typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
typedef struct LLVMTarget *LLVMTargetRef;
@@ -66,6 +67,12 @@ typedef enum {
LLVMObjectFile
} LLVMCodeGenFileType;
typedef enum {
LLVMGlobalISelAbortEnable,
LLVMGlobalISelAbortDisable,
LLVMGlobalISelAbortDisableWithDiag,
} LLVMGlobalISelAbortMode;
/** Returns the first llvm::Target in the registered targets list. */
LLVMTargetRef LLVMGetFirstTarget(void);
/** Returns the next llvm::Target given a previous one (or null if there's none) */
@@ -98,6 +105,55 @@ LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T);
LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
/*===-- Target Machine ----------------------------------------------------===*/
/**
* Create a new set of options for an llvm::TargetMachine.
*
* The returned option structure must be released with
* LLVMDisposeTargetMachineOptions() after the call to
* LLVMCreateTargetMachineWithOptions().
*/
LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void);
/**
* Dispose of an LLVMTargetMachineOptionsRef instance.
*/
void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options);
void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options,
const char *CPU);
/**
* Set the list of features for the target machine.
*
* \param Features a comma-separated list of features.
*/
void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options,
const char *Features);
void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options,
const char *ABI);
void LLVMTargetMachineOptionsSetCodeGenOptLevel(
LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level);
void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options,
LLVMRelocMode Reloc);
void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options,
LLVMCodeModel CodeModel);
/**
* Create a new llvm::TargetMachine.
*
* \param T the target to create a machine for.
* \param Triple a triple describing the target machine.
* \param Options additional configuration (see
* LLVMCreateTargetMachineOptions()).
*/
LLVMTargetMachineRef
LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char *Triple,
LLVMTargetMachineOptionsRef Options);
/** Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine */
LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T,
const char *Triple, const char *CPU, const char *Features,
@@ -132,6 +188,21 @@ LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T);
void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
LLVMBool VerboseAsm);
/** Enable fast-path instruction selection. */
void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable);
/** Enable global instruction selection. */
void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable);
/** Set abort behaviour when global instruction selection fails to lower/select
* an instruction. */
void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
LLVMGlobalISelAbortMode Mode);
/** Enable the MachineOutliner pass. */
void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T,
LLVMBool Enable);
/** Emits an asm or object file for the given module to the filename. This
wraps several c++ only classes (among them a file stream). Returns any
error in ErrorMessage. Use LLVMDisposeMessage to dispose the message. */

View File

@@ -14,9 +14,9 @@
#ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H
#define LLVM_C_TRANSFORMS_PASSBUILDER_H
#include "llvm-c/Error.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
#include "../Error.h"
#include "../TargetMachine.h"
#include "../Types.h"
/**
* @defgroup LLVMCCoreNewPM New Pass Manager

View File

@@ -14,8 +14,8 @@
#ifndef LLVM_C_TYPES_H
#define LLVM_C_TYPES_H
#include "llvm-c/DataTypes.h"
#include "llvm-c/ExternC.h"
#include "DataTypes.h"
#include "ExternC.h"
LLVM_C_EXTERN_C_BEGIN
@@ -132,6 +132,11 @@ typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
* @see llvm::Use */
typedef struct LLVMOpaqueUse *LLVMUseRef;
/**
* @see llvm::OperandBundleDef
*/
typedef struct LLVMOpaqueOperandBundle *LLVMOperandBundleRef;
/**
* Used to represent an attributes.
*

View File

@@ -16,7 +16,7 @@
#ifndef LLVM_C_LTO_H
#define LLVM_C_LTO_H
#include "llvm-c/ExternC.h"
#include "ExternC.h"
#ifdef __cplusplus
#include <cstddef>