Update Windows' version of LLVM to 22.1.8

This commit is contained in:
gingerBill committed 2026-10-11 11:38:24 +01:00
1 parent 9672dca06d
commit 64f3934c59
38 files changed
+2658 -1918

No files matched your search

BIN
View File
Binary file not shown.
Binary file not shown.
+10 -7
View File
@@ -19,8 +19,9 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -41,17 +42,19 @@ typedef enum {
/* Verifies that a module is valid, taking the specified action if not.
Optionally returns a human-readable description of any invalid constructs.
OutMessage must be disposed with LLVMDisposeMessage. */
LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
char **OutMessage);
LLVM_C_ABI LLVMBool LLVMVerifyModule(LLVMModuleRef M,
LLVMVerifierFailureAction Action,
char **OutMessage);
/* Verifies that a single function is valid, taking the specified action. Useful
for debugging. */
LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
LLVM_C_ABI LLVMBool LLVMVerifyFunction(LLVMValueRef Fn,
LLVMVerifierFailureAction Action);
/* Open up a ghostview window that displays the CFG of the current function.
Useful for debugging. */
void LLVMViewFunctionCFG(LLVMValueRef Fn);
void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
LLVM_C_ABI void LLVMViewFunctionCFG(LLVMValueRef Fn);
LLVM_C_ABI void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
/**
* @}
+38 -21
View File
@@ -19,8 +19,10 @@
#ifndef LLVM_C_BITREADER_H
#define LLVM_C_BITREADER_H
#include "llvm-c/ExternC.h"
#include "llvm-c/Types.h"
#include "Deprecated.h"
#include "ExternC.h"
#include "Types.h"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -36,30 +38,38 @@ LLVM_C_EXTERN_C_BEGIN
Optionally returns a human-readable error message via OutMessage.
This is deprecated. Use LLVMParseBitcode2. */
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
char **OutMessage);
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule, char **OutMessage),
"Use of the global context is deprecated, use LLVMParseBitcodeInContext2 "
"instead");
/* Builds a module from the bitcode in the specified memory buffer, returning a
reference to the module via the OutModule parameter. Returns 0 on success. */
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule);
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule),
"Use of the global context is deprecated, use LLVMParseBitcodeInContext2 "
"instead");
/* This is deprecated. Use LLVMParseBitcodeInContext2. */
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule, char **OutMessage);
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule,
char **OutMessage);
LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule);
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutModule);
/** Reads a module from the specified path, returning via the OutMP parameter
a module provider which performs lazy deserialization. Returns 0 on success.
Optionally returns a human-readable error message via OutMessage.
This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM, char **OutMessage);
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM,
char **OutMessage);
/** Reads a module from the given memory buffer, returning via the OutMP
* parameter a module provider which performs lazy deserialization.
@@ -68,15 +78,22 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
*
* Takes ownership of \p MemBuf if (and only if) the module was read
* successfully. */
LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM);
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM);
/* This is deprecated. Use LLVMGetBitcodeModule2. */
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
char **OutMessage);
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM, char **OutMessage),
"Use of the global context is deprecated, use "
"LLVMGetBitcodeModuleInContext2 instead");
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM),
"Use of the global context is deprecated, use "
"LLVMGetBitcodeModuleInContext2 instead");
/**
* @}
+8 -7
View File
@@ -19,8 +19,9 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -34,18 +35,18 @@ LLVM_C_EXTERN_C_BEGIN
/*===-- Operations on modules ---------------------------------------------===*/
/** Writes a module to the specified path. Returns 0 on success. */
int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
LLVM_C_ABI int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
/** Writes a module to an open file descriptor. Returns 0 on success. */
int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
int Unbuffered);
LLVM_C_ABI int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
int Unbuffered);
/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file
descriptor. Returns 0 on success. Closes the Handle. */
int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
LLVM_C_ABI int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
/** Writes a module to a new memory buffer and returns it. */
LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
LLVM_C_ABI LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
/**
* @}
+10 -7
View File
@@ -14,8 +14,9 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -43,35 +44,37 @@ typedef enum {
*
* @see llvm::Module::getOrInsertComdat()
*/
LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
LLVM_C_ABI LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M,
const char *Name);
/**
* Get the Comdat assigned to the given global object.
*
* @see llvm::GlobalObject::getComdat()
*/
LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
LLVM_C_ABI LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
/**
* Assign the Comdat to the given global object.
*
* @see llvm::GlobalObject::setComdat()
*/
void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
LLVM_C_ABI void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
/*
* Get the conflict resolution selection kind for the Comdat.
*
* @see llvm::Comdat::getSelectionKind()
*/
LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
LLVM_C_ABI LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
/*
* Set the conflict resolution selection kind for the Comdat.
*
* @see llvm::Comdat::setSelectionKind()
*/
void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
LLVM_C_ABI void LLVMSetComdatSelectionKind(LLVMComdatRef C,
LLVMComdatSelectionKind Kind);
/**
* @}
+3 -14
View File
@@ -25,22 +25,11 @@
#endif
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(BPF)
LLVM_ASM_PARSER(WebAssembly)
LLVM_ASM_PARSER(RISCV)
#undef LLVM_ASM_PARSER
+4 -16
View File
@@ -25,24 +25,12 @@
#endif
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)
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(BPF)
LLVM_ASM_PRINTER(WebAssembly)
LLVM_ASM_PRINTER(RISCV)
LLVM_ASM_PRINTER(NVPTX)
#undef LLVM_ASM_PRINTER
+3 -15
View File
@@ -25,23 +25,11 @@
#endif
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(BPF)
LLVM_DISASSEMBLER(WebAssembly)
LLVM_DISASSEMBLER(RISCV)
#undef LLVM_DISASSEMBLER
+1 -2
View File
@@ -25,9 +25,8 @@
#endif
LLVM_EXEGESIS(AArch64)
LLVM_EXEGESIS(Mips)
LLVM_EXEGESIS(PowerPC)
LLVM_EXEGESIS(X86)
LLVM_EXEGESIS(RISCV)
#undef LLVM_EXEGESIS
+1 -2
View File
@@ -24,9 +24,8 @@
# error Please define the macro LLVM_TARGETMCA(TargetName)
#endif
LLVM_TARGETMCA(AMDGPU)
LLVM_TARGETMCA(RISCV)
LLVM_TARGETMCA(X86)
LLVM_TARGETMCA(RISCV)
#undef LLVM_TARGETMCA
+4 -16
View File
@@ -24,24 +24,12 @@
#endif
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)
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(BPF)
LLVM_TARGET(WebAssembly)
LLVM_TARGET(RISCV)
LLVM_TARGET(NVPTX)
#undef LLVM_TARGET
+90
View File
@@ -0,0 +1,90 @@
/*===------- llvm/Config/Targets.h - LLVM target checks -----------*- 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 enables clients to know whether specific targets are enabled. */
#ifndef LLVM_CONFIG_TARGETS_H
#define LLVM_CONFIG_TARGETS_H
/* 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 0
/* 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 0
/* 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 0
/* Define if the Lanai target is built in */
#define LLVM_HAS_LANAI_TARGET 0
/* Define if the LoongArch target is built in */
#define LLVM_HAS_LOONGARCH_TARGET 0
/* 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 0
/* Define if the MSP430 target is built in */
#define LLVM_HAS_MSP430_TARGET 0
/* 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 0
/* 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 0
/* 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 0
/* Define if the VE target is built in */
#define LLVM_HAS_VE_TARGET 0
/* 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 0
/* Define if the Xtensa target is built in */
#define LLVM_HAS_XTENSA_TARGET 0
#endif
+31 -2
View File
@@ -12,12 +12,41 @@
#ifndef LLVM_ABI_BREAKING_CHECKS_H
#define LLVM_ABI_BREAKING_CHECKS_H
// llvm-config.h is required for LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS
#include "llvm-config.h"
/* Define to enable checks that alter the LLVM C++ ABI */
#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
/* Define to enable reverse iteration of unordered llvm containers */
#define LLVM_ENABLE_REVERSE_ITERATION 0
#if !defined(__has_attribute)
#define __has_attribute(attribute) 0
#endif
// Properly annotate EnableABIBreakingChecks or DisableABIBreakingChecks for
// export from shared library.
// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for
// two preprocessor definitions to gate LLVM_ABI macro definitions.
#if defined(LLVM_BUILD_STATIC) || !defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS)
#define ABI_BREAKING_EXPORT_ABI
#else
#if defined(_WIN32)
#if defined(LLVM_EXPORTS)
#define ABI_BREAKING_EXPORT_ABI __declspec(dllexport)
#else
#define ABI_BREAKING_EXPORT_ABI __declspec(dllimport)
#endif
#else
#if __has_attribute(visibility)
#define ABI_BREAKING_EXPORT_ABI __attribute__((__visibility__("default")))
#else
#define ABI_BREAKING_EXPORT_ABI
#endif
#endif
#endif
/* Allow selectively disabling link-time mismatch checking so that header-only
ADT content from LLVM can be used without linking libSupport. */
#if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
@@ -43,12 +72,12 @@
#endif
namespace llvm {
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
extern int EnableABIBreakingChecks;
ABI_BREAKING_EXPORT_ABI extern int EnableABIBreakingChecks;
LLVM_HIDDEN_VISIBILITY
__attribute__((weak)) int *VerifyEnableABIBreakingChecks =
&EnableABIBreakingChecks;
#else
extern int DisableABIBreakingChecks;
ABI_BREAKING_EXPORT_ABI extern int DisableABIBreakingChecks;
LLVM_HIDDEN_VISIBILITY
__attribute__((weak)) int *VerifyDisableABIBreakingChecks =
&DisableABIBreakingChecks;
+32 -78
View File
@@ -54,81 +54,6 @@
/* 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 */
@@ -142,16 +67,16 @@
#define LLVM_USE_PERF 0
/* Major version of the LLVM API */
#define LLVM_VERSION_MAJOR 20
#define LLVM_VERSION_MAJOR 22
/* Minor version of the LLVM API */
#define LLVM_VERSION_MINOR 1
/* Patch version of the LLVM API */
#define LLVM_VERSION_PATCH 0
#define LLVM_VERSION_PATCH 8
/* LLVM version string */
#define LLVM_VERSION_STRING "20.1.0"
#define LLVM_VERSION_STRING "22.1.8"
/* Whether LLVM records statistics for use with GetStatistics(),
* PrintStatistics() or PrintStatisticsJSON()
@@ -176,6 +101,9 @@
/* Define if LLVM is using tflite */
/* #undef LLVM_HAVE_TFLITE */
/* Define if we want to check profile consistency in lit tests */
/* #undef LLVM_ENABLE_PROFCHECK */
/* Define to 1 if you have the <sysexits.h> header file. */
/* #undef HAVE_SYSEXITS_H */
@@ -185,6 +113,12 @@
/* Define if building LLVM with BUILD_SHARED_LIBS */
/* #undef LLVM_BUILD_SHARED_LIBS */
/* Define if exporting LLVM public interface for shared library */
/* #undef LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS */
/* Define if exporting LLVM-C public interface for shared library */
/* #undef LLVM_ENABLE_LLVM_C_EXPORT_ANNOTATIONS */
/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */
/* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN */
@@ -192,10 +126,30 @@
* in non assert builds */
#define LLVM_UNREACHABLE_OPTIMIZE 1
/* Define if building LLVM with LLVM_ENABLE_IO_SANDBOX */
#define LLVM_ENABLE_IO_SANDBOX 0
/* 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 */
/* Define if logf128 is available */
/* #undef LLVM_HAS_LOGF128 */
/* Define if building LLVM with LLVM_ENABLE_TELEMETRY */
#define LLVM_ENABLE_TELEMETRY 1
/* Define to 1 to enable expensive checks for debug location coverage checking,
and to 0 otherwise. */
#define LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE 0
/* Define to 1 to enable expensive tracking of the origin of debug location
coverage bugs, and to 0 otherwise. */
#define LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN 0
/* Define to 1 to enable LLVM OnDisk Content Addressable Storage */
#define LLVM_ENABLE_ONDISK_CAS 1
#endif
+1383 -976
View File
File diff suppressed because it is too large. Load diff
+316 -233
View File
File diff suppressed because it is too large. Load diff
+18 -19
View File
@@ -15,8 +15,9 @@
#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"
#include "Visibility.h"
/**
* @defgroup LLVMCDisassembler Disassembler
@@ -35,9 +36,9 @@ LLVM_C_EXTERN_C_BEGIN
* returns NULL. This function is equivalent to calling
* LLVMCreateDisasmCPUFeatures() with an empty CPU name and feature set.
*/
LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
int TagType, LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp);
LLVM_C_ABI LLVMDisasmContextRef LLVMCreateDisasm(
const char *TripleName, void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp);
/**
* Create a disassembler for the TripleName and a specific CPU. Symbolic
@@ -47,10 +48,9 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
* disassembler context. If not, it returns NULL. This function is equivalent
* to calling LLVMCreateDisasmCPUFeatures() with an empty feature set.
*/
LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU,
void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp);
LLVM_C_ABI LLVMDisasmContextRef LLVMCreateDisasmCPU(
const char *Triple, const char *CPU, void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp);
/**
* Create a disassembler for the TripleName, a specific CPU and specific feature
@@ -59,17 +59,16 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU,
* described above. These can all be passed * as NULL. If successful, this
* returns a disassembler context. If not, it returns NULL.
*/
LLVMDisasmContextRef
LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
const char *Features, void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp);
LLVM_C_ABI LLVMDisasmContextRef LLVMCreateDisasmCPUFeatures(
const char *Triple, const char *CPU, const char *Features, void *DisInfo,
int TagType, LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp);
/**
* Set the disassembler's options. Returns 1 if it can set the Options and 0
* otherwise.
*/
int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
LLVM_C_ABI int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
/* The option to produce marked up assembly. */
#define LLVMDisassembler_Option_UseMarkup 1
@@ -87,7 +86,7 @@ int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
/**
* Dispose of a disassembler context.
*/
void LLVMDisasmDispose(LLVMDisasmContextRef DC);
LLVM_C_ABI void LLVMDisasmDispose(LLVMDisasmContextRef DC);
/**
* Disassemble a single instruction using the disassembler context specified in
@@ -99,9 +98,9 @@ void LLVMDisasmDispose(LLVMDisasmContextRef DC);
* function returns the number of bytes in the instruction or zero if there was
* no valid instruction.
*/
size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
uint64_t BytesSize, uint64_t PC,
char *OutString, size_t OutStringSize);
LLVM_C_ABI size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
uint64_t BytesSize, uint64_t PC,
char *OutString, size_t OutStringSize);
/**
* @}
+1 -1
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
+9 -8
View File
@@ -14,7 +14,8 @@
#ifndef LLVM_C_ERROR_H
#define LLVM_C_ERROR_H
#include "llvm-c/ExternC.h"
#include "ExternC.h"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -41,7 +42,7 @@ typedef const void *LLVMErrorTypeId;
* Returns the type id for the given error instance, which must be a failure
* value (i.e. non-null).
*/
LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
LLVM_C_ABI LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
/**
* Dispose of the given error without handling it. This operation consumes the
@@ -49,7 +50,7 @@ LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
* Note: This method *only* needs to be called if the error is not being passed
* to some other consuming operation, e.g. LLVMGetErrorMessage.
*/
void LLVMConsumeError(LLVMErrorRef Err);
LLVM_C_ABI void LLVMConsumeError(LLVMErrorRef Err);
/**
* Report a fatal error if Err is a failure value.
@@ -57,7 +58,7 @@ void LLVMConsumeError(LLVMErrorRef Err);
* This function can be used to wrap calls to fallible functions ONLY when it is
* known that the Error will always be a success value.
*/
void LLVMCantFail(LLVMErrorRef Err);
LLVM_C_ABI void LLVMCantFail(LLVMErrorRef Err);
/**
* Returns the given string's error message. This operation consumes the error,
@@ -65,22 +66,22 @@ void LLVMCantFail(LLVMErrorRef Err);
* The caller is responsible for disposing of the string by calling
* LLVMDisposeErrorMessage.
*/
char *LLVMGetErrorMessage(LLVMErrorRef Err);
LLVM_C_ABI char *LLVMGetErrorMessage(LLVMErrorRef Err);
/**
* Dispose of the given error message.
*/
void LLVMDisposeErrorMessage(char *ErrMsg);
LLVM_C_ABI void LLVMDisposeErrorMessage(char *ErrMsg);
/**
* Returns the type id for llvm StringError.
*/
LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
LLVM_C_ABI LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
/**
* Create a StringError.
*/
LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
LLVM_C_ABI LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
/**
* @}
+5 -4
View File
@@ -14,7 +14,8 @@
#ifndef LLVM_C_ERRORHANDLING_H
#define LLVM_C_ERRORHANDLING_H
#include "llvm-c/ExternC.h"
#include "ExternC.h"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -33,20 +34,20 @@ typedef void (*LLVMFatalErrorHandler)(const char *Reason);
* function allows you to install a callback that will be invoked prior to the
* call to exit(1).
*/
void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
LLVM_C_ABI void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
/**
* Reset the fatal error handler. This resets LLVM's fatal error handling
* behavior to the default.
*/
void LLVMResetFatalErrorHandler(void);
LLVM_C_ABI void LLVMResetFatalErrorHandler(void);
/**
* Enable LLVM's built-in stack trace code. This intercepts the OS's crash
* signals and prints which component of LLVM you were in at the time if the
* crash.
*/
void LLVMEnablePrettyStackTrace(void);
LLVM_C_ABI void LLVMEnablePrettyStackTrace(void);
/**
* @}
+84 -70
View File
@@ -19,10 +19,11 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -33,8 +34,16 @@ LLVM_C_EXTERN_C_BEGIN
* @{
*/
void LLVMLinkInMCJIT(void);
void LLVMLinkInInterpreter(void);
/**
* Empty function used to force the linker to link MCJIT.
* Has no effect when called on a pre-built library (dylib interface).
*/
LLVM_C_ABI void LLVMLinkInMCJIT(void);
/**
* Empty function used to force the linker to link the LLVM interpreter.
* Has no effect when called on a pre-built library (dylib interface).
*/
LLVM_C_ABI void LLVMLinkInInterpreter(void);
typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;
@@ -50,42 +59,42 @@ struct LLVMMCJITCompilerOptions {
/*===-- Operations on generic values --------------------------------------===*/
LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
unsigned long long N,
LLVMBool IsSigned);
LLVM_C_ABI LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
unsigned long long N,
LLVMBool IsSigned);
LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
LLVM_C_ABI LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N);
LLVM_C_ABI LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty,
double N);
unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
LLVM_C_ABI unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
LLVMBool IsSigned);
LLVM_C_ABI unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
LLVMBool IsSigned);
void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
LLVM_C_ABI void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal);
LLVM_C_ABI double LLVMGenericValueToFloat(LLVMTypeRef TyRef,
LLVMGenericValueRef GenVal);
void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
LLVM_C_ABI void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
/*===-- Operations on execution engines -----------------------------------===*/
LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE,
LLVMModuleRef M,
char **OutError);
LLVM_C_ABI LLVMBool LLVMCreateExecutionEngineForModule(
LLVMExecutionEngineRef *OutEE, LLVMModuleRef M, char **OutError);
LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp,
LLVMModuleRef M,
char **OutError);
LLVM_C_ABI LLVMBool LLVMCreateInterpreterForModule(
LLVMExecutionEngineRef *OutInterp, LLVMModuleRef M, char **OutError);
LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
LLVMModuleRef M,
unsigned OptLevel,
char **OutError);
LLVM_C_ABI LLVMBool
LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M,
unsigned OptLevel, char **OutError);
void LLVMInitializeMCJITCompilerOptions(
struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions);
LLVM_C_ABI void
LLVMInitializeMCJITCompilerOptions(struct LLVMMCJITCompilerOptions *Options,
size_t SizeOfOptions);
/**
* Create an MCJIT execution engine for a module, with the given options. It is
@@ -104,55 +113,60 @@ void LLVMInitializeMCJITCompilerOptions(
*
* LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
*/
LLVMBool LLVMCreateMCJITCompilerForModule(
LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M,
struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions,
char **OutError);
LLVM_C_ABI LLVMBool LLVMCreateMCJITCompilerForModule(
LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M,
struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions,
char **OutError);
void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
LLVM_C_ABI void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
LLVM_C_ABI void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
LLVM_C_ABI void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
unsigned ArgC, const char * const *ArgV,
const char * const *EnvP);
LLVM_C_ABI int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
unsigned ArgC, const char *const *ArgV,
const char *const *EnvP);
LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
unsigned NumArgs,
LLVMGenericValueRef *Args);
LLVM_C_ABI LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE,
LLVMValueRef F, unsigned NumArgs,
LLVMGenericValueRef *Args);
void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
LLVM_C_ABI void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE,
LLVMValueRef F);
void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M);
LLVM_C_ABI void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M);
LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M,
LLVMModuleRef *OutMod, char **OutError);
LLVM_C_ABI LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M,
LLVMModuleRef *OutMod, char **OutError);
LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
LLVMValueRef *OutFn);
LLVM_C_ABI LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE,
const char *Name, LLVMValueRef *OutFn);
void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE,
LLVMValueRef Fn);
LLVM_C_ABI void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE,
LLVMValueRef Fn);
LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
LLVMTargetMachineRef
LLVM_C_ABI LLVMTargetDataRef
LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
LLVM_C_ABI LLVMTargetMachineRef
LLVMGetExecutionEngineTargetMachine(LLVMExecutionEngineRef EE);
void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
void* Addr);
LLVM_C_ABI void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE,
LLVMValueRef Global, void *Addr);
void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
LLVM_C_ABI void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE,
LLVMValueRef Global);
uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name);
LLVM_C_ABI uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE,
const char *Name);
uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE, const char *Name);
LLVM_C_ABI uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE,
const char *Name);
/// Returns true on error, false on success. If true is returned then the error
/// message is copied to OutStr and cleared in the ExecutionEngine instance.
LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE,
char **OutError);
LLVM_C_ABI LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE,
char **OutError);
/*===-- Operations on memory managers -------------------------------------===*/
@@ -177,21 +191,21 @@ typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);
* @param FinalizeMemory Set page permissions and flush cache. Return 0 on
* success, 1 on error.
*/
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
void *Opaque,
LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
LLVMMemoryManagerDestroyCallback Destroy);
LLVM_C_ABI LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
void *Opaque,
LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
LLVMMemoryManagerDestroyCallback Destroy);
void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
LLVM_C_ABI void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
/*===-- JIT Event Listener functions -------------------------------------===*/
LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void);
LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void);
LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
LLVM_C_ABI LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
/**
* @}
+24 -5
View File
@@ -14,8 +14,9 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -32,12 +33,30 @@ LLVM_C_EXTERN_C_BEGIN
* Optionally returns a human-readable description of any errors that
* occurred during parsing IR. OutMessage must be disposed with
* LLVMDisposeMessage.
* The memory buffer is consumed by this function.
* This is deprecated. Use LLVMParseIRInContext2 instead.
*
* @see llvm::ParseIR()
*/
LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
char **OutMessage);
LLVM_C_ABI LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM,
char **OutMessage);
/**
* Read LLVM IR from a memory buffer and convert it into an in-memory Module
* object. Returns 0 on success.
* Optionally returns a human-readable description of any errors that
* occurred during parsing IR. OutMessage must be disposed with
* LLVMDisposeMessage.
* The memory buffer is not consumed by this function. It is the responsibility
* of the caller to free it with \c LLVMDisposeMemoryBuffer.
*
* @see llvm::ParseIR()
*/
LLVM_C_ABI LLVMBool LLVMParseIRInContext2(LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef *OutM,
char **OutMessage);
/**
* @}
+37 -34
View File
@@ -24,10 +24,11 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -71,14 +72,14 @@ typedef struct LLVMOrcOpaqueLLJIT *LLVMOrcLLJITRef;
* The client owns the resulting LLJITBuilder and should dispose of it using
* LLVMOrcDisposeLLJITBuilder once they are done with it.
*/
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void);
LLVM_C_ABI LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void);
/**
* Dispose of an LLVMOrcLLJITBuilderRef. This should only be called if ownership
* has not been passed to LLVMOrcCreateLLJIT (e.g. because some error prevented
* that function from being called).
*/
void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
LLVM_C_ABI void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
/**
* Set the JITTargetMachineBuilder to be used when constructing the LLJIT
@@ -89,13 +90,13 @@ void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
* This function takes ownership of the JTMB argument: clients should not
* dispose of the JITTargetMachineBuilder after calling this function.
*/
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
LLVM_C_ABI void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB);
/**
* Set an ObjectLinkingLayer creator function for this LLJIT instance.
*/
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
LLVM_C_ABI void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
LLVMOrcLLJITBuilderRef Builder,
LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx);
@@ -113,13 +114,13 @@ void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
* LLJIT instance will free all memory managed by the JIT, including JIT'd code
* and not-yet compiled modules.
*/
LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result,
LLVMOrcLLJITBuilderRef Builder);
LLVM_C_ABI LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result,
LLVMOrcLLJITBuilderRef Builder);
/**
* Dispose of an LLJIT instance.
*/
LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
/**
* Get a reference to the ExecutionSession for this LLJIT instance.
@@ -127,7 +128,8 @@ LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
* The ExecutionSession is owned by the LLJIT instance. The client is not
* responsible for managing its memory.
*/
LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMOrcExecutionSessionRef
LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
/**
* Return a reference to the Main JITDylib.
@@ -135,18 +137,18 @@ LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
* The JITDylib is owned by the LLJIT instance. The client is not responsible
* for managing its memory.
*/
LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J);
/**
* Return the target triple for this LLJIT instance. This string is owned by
* the LLJIT instance and should not be freed by the client.
*/
const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J);
LLVM_C_ABI const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J);
/**
* Returns the global prefix character according to the LLJIT's DataLayout.
*/
char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
LLVM_C_ABI char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
/**
* Mangles the given string according to the LLJIT instance's DataLayout, then
@@ -155,7 +157,7 @@ char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
* decrement the ref-count on the pool entry once they are finished with this
* value.
*/
LLVMOrcSymbolStringPoolEntryRef
LLVM_C_ABI LLVMOrcSymbolStringPoolEntryRef
LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
/**
@@ -167,8 +169,8 @@ LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
* Resources associated with the given object will be tracked by the given
* JITDylib's default resource tracker.
*/
LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
LLVMMemoryBufferRef ObjBuffer);
LLVM_C_ABI LLVMErrorRef LLVMOrcLLJITAddObjectFile(
LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer);
/**
* Add a buffer representing an object file to the given ResourceTracker's
@@ -179,9 +181,9 @@ LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
* Resources associated with the given object will be tracked by ResourceTracker
* RT.
*/
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
LLVMOrcResourceTrackerRef RT,
LLVMMemoryBufferRef ObjBuffer);
LLVM_C_ABI LLVMErrorRef
LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT,
LLVMMemoryBufferRef ObjBuffer);
/**
* Add an IR module to the given JITDylib in the given LLJIT instance. This
@@ -192,9 +194,8 @@ LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
* Resources associated with the given Module will be tracked by the given
* JITDylib's default resource tracker.
*/
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
LLVMOrcJITDylibRef JD,
LLVMOrcThreadSafeModuleRef TSM);
LLVM_C_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(
LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM);
/**
* Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT
@@ -205,34 +206,36 @@ LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
* Resources associated with the given Module will be tracked by ResourceTracker
* RT.
*/
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,
LLVMOrcResourceTrackerRef JD,
LLVMOrcThreadSafeModuleRef TSM);
LLVM_C_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(
LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef JD,
LLVMOrcThreadSafeModuleRef TSM);
/**
* Look up the given symbol in the main JITDylib of the given LLJIT instance.
*
* This operation does not take ownership of the Name argument.
*/
LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
LLVMOrcExecutorAddress *Result,
const char *Name);
LLVM_C_ABI LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
LLVMOrcExecutorAddress *Result,
const char *Name);
/**
* Returns a non-owning reference to the LLJIT instance's object linking layer.
*/
LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMOrcObjectLayerRef
LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J);
/**
* Returns a non-owning reference to the LLJIT instance's object linking layer.
*/
LLVMOrcObjectTransformLayerRef
LLVM_C_ABI LLVMOrcObjectTransformLayerRef
LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J);
/**
* Returns a non-owning reference to the LLJIT instance's IR transform layer.
*/
LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMOrcIRTransformLayerRef
LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
/**
* Get the LLJIT instance's default data layout string.
@@ -240,7 +243,7 @@ LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
* This string is owned by the LLJIT instance and does not need to be freed
* by the caller.
*/
const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J);
LLVM_C_ABI const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J);
/**
* @}
+4 -3
View File
@@ -26,7 +26,8 @@
#ifndef LLVM_C_LLJITUTILS_H
#define LLVM_C_LLJITUTILS_H
#include "llvm-c/LLJIT.h"
#include "LLJIT.h"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -39,9 +40,9 @@ LLVM_C_EXTERN_C_BEGIN
/**
* Install the plugin that submits debug objects to the executor. Executors must
* expose the llvm_orc_registerJITLoaderGDBWrapper symbol.
* expose the llvm_orc_registerJITLoaderGDBAllocAction symbol.
*/
LLVMErrorRef LLVMOrcLLJITEnableDebugSupport(LLVMOrcLLJITRef J);
LLVM_C_ABI LLVMErrorRef LLVMOrcLLJITEnableDebugSupport(LLVMOrcLLJITRef J);
/**
* @}
+4 -3
View File
@@ -14,8 +14,9 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -38,7 +39,7 @@ typedef enum {
* The return value is true if an error occurred, false otherwise.
* Use the diagnostic handler to get any diagnostic message.
*/
LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src);
LLVM_C_ABI LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src);
LLVM_C_EXTERN_C_END
+59 -55
View File
@@ -19,9 +19,10 @@
#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 "Visibility.h"
#include "Config/llvm-config.h"
LLVM_C_EXTERN_C_BEGIN
@@ -54,6 +55,7 @@ typedef enum {
LLVMBinaryTypeMachO64B, /**< MachO 64-bit, big endian. */
LLVMBinaryTypeWasm, /**< Web Assembly. */
LLVMBinaryTypeOffload, /**< Offloading fatbinary. */
LLVMBinaryTypeDXcontainer, /**< DirectX Binary Container. */
} LLVMBinaryType;
@@ -64,7 +66,7 @@ typedef enum {
* appropriate implementation selected. The context may be NULL except if
* the resulting file is an LLVM IR file.
*
* The memory buffer is not consumed by this function. It is the responsibilty
* The memory buffer is not consumed by this function. It is the responsibility
* of the caller to free it with \c LLVMDisposeMemoryBuffer.
*
* If NULL is returned, the \p ErrorMessage parameter is populated with the
@@ -73,17 +75,17 @@ typedef enum {
*
* @see llvm::object::createBinary
*/
LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
LLVMContextRef Context,
char **ErrorMessage);
LLVM_C_ABI LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
LLVMContextRef Context,
char **ErrorMessage);
/**
* Dispose of a binary file.
*
* The binary file does not own its backing buffer. It is the responsibilty
* The binary file does not own its backing buffer. It is the responsibility
* of the caller to free it with \c LLVMDisposeMemoryBuffer.
*/
void LLVMDisposeBinary(LLVMBinaryRef BR);
LLVM_C_ABI void LLVMDisposeBinary(LLVMBinaryRef BR);
/**
* Retrieves a copy of the memory buffer associated with this object file.
@@ -94,14 +96,14 @@ void LLVMDisposeBinary(LLVMBinaryRef BR);
*
* @see llvm::object::getMemoryBufferRef
*/
LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR);
LLVM_C_ABI LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR);
/**
* Retrieve the specific type of a binary.
*
* @see llvm::object::Binary::getType
*/
LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
LLVM_C_ABI LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
/*
* For a Mach-O universal binary file, retrieves the object file corresponding
@@ -114,10 +116,8 @@ LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
* It is the responsiblity of the caller to free the returned object file by
* calling \c LLVMDisposeBinary.
*/
LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
const char *Arch,
size_t ArchLen,
char **ErrorMessage);
LLVM_C_ABI LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(
LLVMBinaryRef BR, const char *Arch, size_t ArchLen, char **ErrorMessage);
/**
* Retrieve a copy of the section iterator for this object file.
@@ -130,15 +130,16 @@ LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
*
* @see llvm::object::sections()
*/
LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR);
LLVM_C_ABI LLVMSectionIteratorRef
LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR);
/**
* Returns whether the given section iterator is at the end.
*
* @see llvm::object::section_end
*/
LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
LLVMSectionIteratorRef SI);
LLVM_C_ABI LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(
LLVMBinaryRef BR, LLVMSectionIteratorRef SI);
/**
* Retrieve a copy of the symbol iterator for this object file.
@@ -151,78 +152,81 @@ LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
*
* @see llvm::object::symbols()
*/
LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR);
LLVM_C_ABI LLVMSymbolIteratorRef
LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR);
/**
* Returns whether the given symbol iterator is at the end.
*
* @see llvm::object::symbol_end
*/
LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR,
LLVMSymbolIteratorRef SI);
LLVM_C_ABI LLVMBool
LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR, LLVMSymbolIteratorRef SI);
void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
LLVM_C_ABI void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
LLVMSymbolIteratorRef Sym);
LLVM_C_ABI void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
LLVM_C_ABI void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
LLVMSymbolIteratorRef Sym);
// ObjectFile Symbol iterators
void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI);
void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI);
LLVM_C_ABI void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI);
LLVM_C_ABI void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI);
// SectionRef accessors
const char *LLVMGetSectionName(LLVMSectionIteratorRef SI);
uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI);
const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI);
uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI);
LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
LLVMSymbolIteratorRef Sym);
LLVM_C_ABI const char *LLVMGetSectionName(LLVMSectionIteratorRef SI);
LLVM_C_ABI uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI);
LLVM_C_ABI const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI);
LLVM_C_ABI uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI);
LLVM_C_ABI LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
LLVMSymbolIteratorRef Sym);
// Section Relocation iterators
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section);
void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI);
LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
LLVMRelocationIteratorRef RI);
void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI);
LLVM_C_ABI LLVMRelocationIteratorRef
LLVMGetRelocations(LLVMSectionIteratorRef Section);
LLVM_C_ABI void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI);
LLVM_C_ABI LLVMBool LLVMIsRelocationIteratorAtEnd(
LLVMSectionIteratorRef Section, LLVMRelocationIteratorRef RI);
LLVM_C_ABI void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI);
// SymbolRef accessors
const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI);
uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI);
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI);
LLVM_C_ABI const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI);
LLVM_C_ABI uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI);
LLVM_C_ABI uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI);
// RelocationRef accessors
uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI);
LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI);
uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
LLVM_C_ABI uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI);
LLVM_C_ABI LLVMSymbolIteratorRef
LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI);
LLVM_C_ABI uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
// NOTE: Caller takes ownership of returned string of the two
// following functions.
const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI);
const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
LLVM_C_ABI const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI);
LLVM_C_ABI const char *
LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
/** Deprecated: Use LLVMBinaryRef instead. */
typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef;
/** Deprecated: Use LLVMCreateBinary instead. */
LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf);
LLVM_C_ABI LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf);
/** Deprecated: Use LLVMDisposeBinary instead. */
void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile);
LLVM_C_ABI void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile);
/** Deprecated: Use LLVMObjectFileCopySectionIterator instead. */
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile);
LLVM_C_ABI LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile);
/** Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead. */
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSectionIteratorRef SI);
LLVM_C_ABI LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSectionIteratorRef SI);
/** Deprecated: Use LLVMObjectFileCopySymbolIterator instead. */
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile);
LLVM_C_ABI LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile);
/** Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead. */
LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSymbolIteratorRef SI);
LLVM_C_ABI LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSymbolIteratorRef SI);
/**
* @}
*/
+130 -107
View File
@@ -27,9 +27,10 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -488,7 +489,7 @@ typedef struct LLVMOrcOpaqueDumpObjects *LLVMOrcDumpObjectsRef;
* requesting definitions from the JIT will typically be delivered a
* FailureToMaterialize error instead).
*/
void LLVMOrcExecutionSessionSetErrorReporter(
LLVM_C_ABI void LLVMOrcExecutionSessionSetErrorReporter(
LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError,
void *Ctx);
@@ -498,7 +499,7 @@ void LLVMOrcExecutionSessionSetErrorReporter(
* Ownership of the pool remains with the ExecutionSession: The caller is
* not required to free the pool.
*/
LLVMOrcSymbolStringPoolRef
LLVM_C_ABI LLVMOrcSymbolStringPoolRef
LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);
/**
@@ -511,7 +512,8 @@ LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);
* entries will have become unreferenced, e.g. after removing a module or
* closing a JITDylib.
*/
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
LLVM_C_ABI void
LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
/**
* Intern a string in the ExecutionSession's SymbolStringPool and return a
@@ -525,7 +527,7 @@ void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
*
* Note that this function does not perform linker-mangling on the string.
*/
LLVMOrcSymbolStringPoolEntryRef
LLVM_C_ABI LLVMOrcSymbolStringPoolEntryRef
LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name);
/**
@@ -574,7 +576,7 @@ typedef void (*LLVMOrcExecutionSessionLookupHandleResultFunction)(
*
* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
*/
void LLVMOrcExecutionSessionLookup(
LLVM_C_ABI void LLVMOrcExecutionSessionLookup(
LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K,
LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize,
LLVMOrcCLookupSet Symbols, size_t SymbolsSize,
@@ -583,49 +585,56 @@ void LLVMOrcExecutionSessionLookup(
/**
* Increments the ref-count for a SymbolStringPool entry.
*/
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
LLVM_C_ABI void
LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
/**
* Reduces the ref-count for of a SymbolStringPool entry.
*/
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
LLVM_C_ABI void
LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
/**
* Return the c-string for the given symbol. This string will remain valid until
* the entry is freed (once all LLVMOrcSymbolStringPoolEntryRefs have been
* released).
*/
const char *LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S);
LLVM_C_ABI const char *
LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S);
/**
* Reduces the ref-count of a ResourceTracker.
*/
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);
LLVM_C_ABI void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);
/**
* Transfers tracking of all resources associated with resource tracker SrcRT
* to resource tracker DstRT.
*/
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,
LLVMOrcResourceTrackerRef DstRT);
LLVM_C_ABI void
LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,
LLVMOrcResourceTrackerRef DstRT);
/**
* Remove all resources associated with the given tracker. See
* ResourceTracker::remove().
*/
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
LLVM_C_ABI LLVMErrorRef
LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
/**
* Dispose of a JITDylib::DefinitionGenerator. This should only be called if
* ownership has not been passed to a JITDylib (e.g. because some error
* prevented the client from calling LLVMOrcJITDylibAddGenerator).
*/
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG);
LLVM_C_ABI void
LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG);
/**
* Dispose of a MaterializationUnit.
*/
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
LLVM_C_ABI void
LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
/**
* Create a custom MaterializationUnit.
@@ -660,7 +669,7 @@ void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
* either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing
* of it by calling LLVMOrcDisposeMaterializationUnit.
*/
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
LLVM_C_ABI LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,
size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,
LLVMOrcMaterializationUnitMaterializeFunction Materialize,
@@ -688,7 +697,7 @@ LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
* If a client wishes to reuse elements of the Sym array after this call they
* must explicitly retain each of the elements for themselves.
*/
LLVMOrcMaterializationUnitRef
LLVM_C_ABI LLVMOrcMaterializationUnitRef
LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
/**
@@ -712,7 +721,7 @@ LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
* If a client wishes to reuse elements of the CallableAliases array after this call they
* must explicitly retain each of the elements for themselves.
*/
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
LLVM_C_ABI LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM,
LLVMOrcJITDylibRef SourceRef, LLVMOrcCSymbolAliasMapPairs CallableAliases,
size_t NumPairs);
@@ -727,19 +736,20 @@ LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
* LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via
* LLVMOrcMaterializationResponsibilityFailMaterialization).
*/
void LLVMOrcDisposeMaterializationResponsibility(
LLVM_C_ABI void LLVMOrcDisposeMaterializationResponsibility(
LLVMOrcMaterializationResponsibilityRef MR);
/**
* Returns the target JITDylib that these symbols are being materialized into.
*/
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(
LLVM_C_ABI LLVMOrcJITDylibRef
LLVMOrcMaterializationResponsibilityGetTargetDylib(
LLVMOrcMaterializationResponsibilityRef MR);
/**
* Returns the ExecutionSession for this MaterializationResponsibility.
*/
LLVMOrcExecutionSessionRef
LLVM_C_ABI LLVMOrcExecutionSessionRef
LLVMOrcMaterializationResponsibilityGetExecutionSession(
LLVMOrcMaterializationResponsibilityRef MR);
@@ -753,7 +763,8 @@ LLVMOrcMaterializationResponsibilityGetExecutionSession(
* MaterializationResponsibility requires the caller to retain the symbols
* explicitly.
*/
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(
LLVM_C_ABI LLVMOrcCSymbolFlagsMapPairs
LLVMOrcMaterializationResponsibilityGetSymbols(
LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs);
/**
@@ -761,7 +772,8 @@ LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(
*
* Does not release the entries themselves.
*/
void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
LLVM_C_ABI void
LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
/**
* Returns the initialization pseudo-symbol, if any. This symbol will also
@@ -771,7 +783,7 @@ void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
* The returned symbol is not retained over any mutating operation of the
* MaterializationResponsbility or beyond the lifetime thereof.
*/
LLVMOrcSymbolStringPoolEntryRef
LLVM_C_ABI LLVMOrcSymbolStringPoolEntryRef
LLVMOrcMaterializationResponsibilityGetInitializerSymbol(
LLVMOrcMaterializationResponsibilityRef MR);
@@ -781,7 +793,7 @@ LLVMOrcMaterializationResponsibilityGetInitializerSymbol(
* information can be used to return responsibility for unrequested symbols
* back to the JITDylib via the delegate method.
*/
LLVMOrcSymbolStringPoolEntryRef *
LLVM_C_ABI LLVMOrcSymbolStringPoolEntryRef *
LLVMOrcMaterializationResponsibilityGetRequestedSymbols(
LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols);
@@ -790,7 +802,7 @@ LLVMOrcMaterializationResponsibilityGetRequestedSymbols(
*
* Does not release the symbols themselves.
*/
void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
LLVM_C_ABI void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
/**
* Notifies the target JITDylib that the given symbols have been resolved.
@@ -808,7 +820,7 @@ void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
* MaterializationResponsibility then this method is guaranteed to return
* LLVMErrorSuccess.
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
LLVM_C_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols,
size_t NumPairs);
@@ -838,7 +850,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
* MaterializationResponsibility then this method is guaranteed to return
* LLVMErrorSuccess.
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
LLVM_C_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcCSymbolDependenceGroup *SymbolDepGroups, size_t NumSymbolDepGroups);
@@ -855,7 +867,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
* additional symbols at materialization time (e.g. stubs, compile
* callbacks, metadata)
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
LLVM_C_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs);
@@ -866,7 +878,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
* from the target JITDylib, and send an error to any queries waiting on
* these symbols.
*/
void LLVMOrcMaterializationResponsibilityFailMaterialization(
LLVM_C_ABI void LLVMOrcMaterializationResponsibilityFailMaterialization(
LLVMOrcMaterializationResponsibilityRef MR);
/**
@@ -876,7 +888,7 @@ void LLVMOrcMaterializationResponsibilityFailMaterialization(
* by introspecting which symbols have actually been looked up and
* materializing only those).
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
LLVM_C_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcMaterializationUnitRef MU);
@@ -888,7 +900,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
* The caller retains responsibility of the the passed
* MaterializationResponsibility.
*/
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
LLVM_C_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,
LLVMOrcMaterializationResponsibilityRef *Result);
@@ -902,9 +914,8 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
* This call does not install any library code or symbols into the newly
* created JITDylib. The client is responsible for all configuration.
*/
LLVMOrcJITDylibRef
LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,
const char *Name);
LLVM_C_ABI LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(
LLVMOrcExecutionSessionRef ES, const char *Name);
/**
* Create a JITDylib.
@@ -918,25 +929,23 @@ LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,
* call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will
* always return success.
*/
LLVMErrorRef
LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,
LLVMOrcJITDylibRef *Result,
const char *Name);
LLVM_C_ABI LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(
LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result,
const char *Name);
/**
* Returns the JITDylib with the given name, or NULL if no such JITDylib
* exists.
*/
LLVMOrcJITDylibRef
LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES,
const char *Name);
LLVM_C_ABI LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(
LLVMOrcExecutionSessionRef ES, const char *Name);
/**
* Return a reference to a newly created resource tracker associated with JD.
* The tracker is returned with an initial ref-count of 1, and must be released
* with LLVMOrcReleaseResourceTracker when no longer needed.
*/
LLVMOrcResourceTrackerRef
LLVM_C_ABI LLVMOrcResourceTrackerRef
LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);
/**
@@ -944,7 +953,7 @@ LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);
* This operation will increase the retain count of the tracker: Clients should
* call LLVMOrcReleaseResourceTracker when the result is no longer needed.
*/
LLVMOrcResourceTrackerRef
LLVM_C_ABI LLVMOrcResourceTrackerRef
LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);
/**
@@ -954,14 +963,14 @@ LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);
* If the operation fails then ownership remains with the caller who should
* call LLVMOrcDisposeMaterializationUnit to destroy it.
*/
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,
LLVMOrcMaterializationUnitRef MU);
LLVM_C_ABI LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,
LLVMOrcMaterializationUnitRef MU);
/**
* Calls remove on all trackers associated with this JITDylib, see
* JITDylib::clear().
*/
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
LLVM_C_ABI LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
/**
* Add a DefinitionGenerator to the given JITDylib.
@@ -969,8 +978,8 @@ LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
* The JITDylib will take ownership of the given generator: The client is no
* longer responsible for managing its memory.
*/
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
LLVMOrcDefinitionGeneratorRef DG);
LLVM_C_ABI void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
LLVMOrcDefinitionGeneratorRef DG);
/**
* Create a custom generator.
@@ -985,7 +994,8 @@ void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
* Dispose is the disposal function for Ctx. This argument is permitted to be
* null (in which case the client is responsible for the lifetime of Ctx).
*/
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
LLVM_C_ABI LLVMOrcDefinitionGeneratorRef
LLVMOrcCreateCustomCAPIDefinitionGenerator(
LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx,
LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose);
@@ -993,8 +1003,8 @@ LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
* Continue a lookup that was suspended in a generator (see
* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).
*/
void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
LLVMErrorRef Err);
LLVM_C_ABI void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
LLVMErrorRef Err);
/**
* Get a DynamicLibrarySearchGenerator that will reflect process symbols into
@@ -1014,7 +1024,7 @@ void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
* function is the full mangled symbol: The client is responsible for stripping
* the global prefix if present.
*/
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
LLVM_C_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,
LLVMOrcSymbolPredicate Filter, void *FilterCtx);
@@ -1039,7 +1049,7 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
*
*/
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
LLVM_C_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,
char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx);
@@ -1057,30 +1067,43 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
*
*/
LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(
LLVM_C_ABI LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(
LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer,
const char *FileName, const char *TargetTriple);
const char *FileName);
/**
* Create a ThreadSafeContext containing a new LLVMContext.
* Create a ThreadSafeContextRef containing a new LLVMContext.
*
* Ownership of the underlying ThreadSafeContext data is shared: Clients
* can and should dispose of their ThreadSafeContext as soon as they no longer
* need to refer to it directly. Other references (e.g. from ThreadSafeModules)
* will keep the data alive as long as it is needed.
* can and should dispose of their ThreadSafeContextRef as soon as they no
* longer need to refer to it directly. Other references (e.g. from
* ThreadSafeModules) will keep the underlying data alive as long as it is
* needed.
*/
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);
LLVM_C_ABI LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);
/**
* Get a reference to the wrapped LLVMContext.
* Create a ThreadSafeContextRef from a given LLVMContext, which must not be
* associated with any existing ThreadSafeContext.
*
* The underlying ThreadSafeContext will take ownership of the LLVMContext
* object, so clients should not free the LLVMContext passed to this
* function.
*
* Ownership of the underlying ThreadSafeContext data is shared: Clients
* can and should dispose of their ThreadSafeContextRef as soon as they no
* longer need to refer to it directly. Other references (e.g. from
* ThreadSafeModules) will keep the underlying data alive as long as it is
* needed.
*/
LLVMContextRef
LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx);
LLVM_C_ABI LLVMOrcThreadSafeContextRef
LLVMOrcCreateNewThreadSafeContextFromLLVMContext(LLVMContextRef Ctx);
/**
* Dispose of a ThreadSafeContext.
*/
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
LLVM_C_ABI void
LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
/**
* Create a ThreadSafeModule wrapper around the given LLVM module. This takes
@@ -1092,24 +1115,22 @@ void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
* responsible for it. If it is not transferred to the JIT then the client
* should call LLVMOrcDisposeThreadSafeModule to dispose of it.
*/
LLVMOrcThreadSafeModuleRef
LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M,
LLVMOrcThreadSafeContextRef TSCtx);
LLVM_C_ABI LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(
LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx);
/**
* Dispose of a ThreadSafeModule. This should only be called if ownership has
* not been passed to LLJIT (e.g. because some error prevented the client from
* adding this to the JIT).
*/
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);
LLVM_C_ABI void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);
/**
* Apply the given function to the module contained in this ThreadSafeModule.
*/
LLVMErrorRef
LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM,
LLVMOrcGenericIRModuleOperationFunction F,
void *Ctx);
LLVM_C_ABI LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(
LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F,
void *Ctx);
/**
* Create a JITTargetMachineBuilder by detecting the host.
@@ -1119,7 +1140,7 @@ LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM,
* LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
* LLVMOrcDisposeJITTargetMachineBuilder.
*/
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
LLVM_C_ABI LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
LLVMOrcJITTargetMachineBuilderRef *Result);
/**
@@ -1131,14 +1152,14 @@ LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
* LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
* LLVMOrcDisposeJITTargetMachineBuilder.
*/
LLVMOrcJITTargetMachineBuilderRef
LLVM_C_ABI LLVMOrcJITTargetMachineBuilderRef
LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM);
/**
* Dispose of a JITTargetMachineBuilder.
*/
void LLVMOrcDisposeJITTargetMachineBuilder(
LLVMOrcJITTargetMachineBuilderRef JTMB);
LLVM_C_ABI void
LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB);
/**
* Returns the target triple for the given JITTargetMachineBuilder as a string.
@@ -1146,14 +1167,14 @@ void LLVMOrcDisposeJITTargetMachineBuilder(
* The caller owns the resulting string as must dispose of it by calling
* LLVMDisposeMessage
*/
char *LLVMOrcJITTargetMachineBuilderGetTargetTriple(
LLVM_C_ABI char *LLVMOrcJITTargetMachineBuilderGetTargetTriple(
LLVMOrcJITTargetMachineBuilderRef JTMB);
/**
* Sets the target triple for the given JITTargetMachineBuilder to the given
* string.
*/
void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
LLVM_C_ABI void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple);
/**
@@ -1167,9 +1188,9 @@ void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
* Resources associated with the given object will be tracked by the given
* JITDylib's default ResourceTracker.
*/
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,
LLVMOrcJITDylibRef JD,
LLVMMemoryBufferRef ObjBuffer);
LLVM_C_ABI LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(
LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD,
LLVMMemoryBufferRef ObjBuffer);
/**
* Add an object to an ObjectLayer using the given ResourceTracker.
@@ -1182,10 +1203,9 @@ LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,
* Resources associated with the given object will be tracked by
* ResourceTracker RT.
*/
LLVMErrorRef
LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer,
LLVMOrcResourceTrackerRef RT,
LLVMMemoryBufferRef ObjBuffer);
LLVM_C_ABI LLVMErrorRef LLVMOrcObjectLayerAddObjectFileWithRT(
LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT,
LLVMMemoryBufferRef ObjBuffer);
/**
* Emit an object buffer to an ObjectLayer.
@@ -1193,31 +1213,33 @@ LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer,
* Ownership of the responsibility object and object buffer pass to this
* function. The client is not responsible for cleanup.
*/
void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer,
LLVMOrcMaterializationResponsibilityRef R,
LLVMMemoryBufferRef ObjBuffer);
LLVM_C_ABI void
LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer,
LLVMOrcMaterializationResponsibilityRef R,
LLVMMemoryBufferRef ObjBuffer);
/**
* Dispose of an ObjectLayer.
*/
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer);
LLVM_C_ABI void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer);
void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcThreadSafeModuleRef TSM);
LLVM_C_ABI void
LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,
LLVMOrcMaterializationResponsibilityRef MR,
LLVMOrcThreadSafeModuleRef TSM);
/**
* Set the transform function of the provided transform layer, passing through a
* pointer to user provided context.
*/
void LLVMOrcIRTransformLayerSetTransform(
LLVM_C_ABI void LLVMOrcIRTransformLayerSetTransform(
LLVMOrcIRTransformLayerRef IRTransformLayer,
LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx);
/**
* Set the transform function on an LLVMOrcObjectTransformLayer.
*/
void LLVMOrcObjectTransformLayerSetTransform(
LLVM_C_ABI void LLVMOrcObjectTransformLayerSetTransform(
LLVMOrcObjectTransformLayerRef ObjTransformLayer,
LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx);
@@ -1227,15 +1249,16 @@ void LLVMOrcObjectTransformLayerSetTransform(
* The resulting IndirectStubsManager is owned by the client
* and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager.
*/
LLVMOrcIndirectStubsManagerRef
LLVM_C_ABI LLVMOrcIndirectStubsManagerRef
LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple);
/**
* Dispose of an IndirectStubsManager.
*/
void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM);
LLVM_C_ABI void
LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM);
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
LLVM_C_ABI LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
LLVMOrcJITTargetAddress ErrorHandlerAddr,
LLVMOrcLazyCallThroughManagerRef *LCTM);
@@ -1243,8 +1266,8 @@ LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
/**
* Dispose of an LazyCallThroughManager.
*/
void LLVMOrcDisposeLazyCallThroughManager(
LLVMOrcLazyCallThroughManagerRef LCTM);
LLVM_C_ABI void
LLVMOrcDisposeLazyCallThroughManager(LLVMOrcLazyCallThroughManagerRef LCTM);
/**
* Create a DumpObjects instance.
@@ -1260,19 +1283,19 @@ void LLVMOrcDisposeLazyCallThroughManager(
* <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain
* an extension, as a .o suffix will be added by DumpObjects.
*/
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir,
const char *IdentifierOverride);
LLVM_C_ABI LLVMOrcDumpObjectsRef
LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride);
/**
* Dispose of a DumpObjects instance.
*/
void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects);
LLVM_C_ABI void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects);
/**
* Dump the contents of the given MemoryBuffer.
*/
LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects,
LLVMMemoryBufferRef *ObjBuffer);
LLVM_C_ABI LLVMErrorRef LLVMOrcDumpObjects_CallOperator(
LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer);
/**
* @}
+26 -8
View File
@@ -24,11 +24,12 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -42,14 +43,31 @@ typedef void (*LLVMMemoryManagerNotifyTerminatingCallback)(void *CtxCtx);
* @{
*/
/**
* Create a ObjectLinkingLayer instance using the standard JITLink
* InProcessMemoryManager for memory management.
*/
LLVM_C_ABI LLVMErrorRef
LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager(
LLVMOrcObjectLayerRef *Result, LLVMOrcExecutionSessionRef ES);
/**
* Create a RTDyldObjectLinkingLayer instance using the standard
* SectionMemoryManager for memory management.
*/
LLVMOrcObjectLayerRef
LLVM_C_ABI LLVMOrcObjectLayerRef
LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(
LLVMOrcExecutionSessionRef ES);
/**
* Create a RTDyldObjectLinkingLayer instance using the standard
* SectionMemoryManager for memory management. If ReserveAlloc is true then
* a contiguous range of memory will be reserved for each object file.
*/
LLVM_C_ABI LLVMOrcObjectLayerRef
LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc(
LLVMOrcExecutionSessionRef ES, LLVMBool ReserveAlloc);
/**
* Create a RTDyldObjectLinkingLayer instance using MCJIT-memory-manager-like
* callbacks.
@@ -74,7 +92,7 @@ LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(
* This scheme simply reuses the CreateContextCtx pointer as the one-and-only
* allocation context.
*/
LLVMOrcObjectLayerRef
LLVM_C_ABI LLVMOrcObjectLayerRef
LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(
LLVMOrcExecutionSessionRef ES, void *CreateContextCtx,
LLVMMemoryManagerCreateContextCallback CreateContext,
@@ -90,7 +108,7 @@ LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(
* Note: Layer must be an RTDyldObjectLinkingLayer instance or
* behavior is undefined.
*/
void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(
LLVM_C_ABI void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(
LLVMOrcObjectLayerRef RTDyldObjLinkingLayer,
LLVMJITEventListenerRef Listener);
+39 -29
View File
@@ -15,8 +15,9 @@
#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"
#include "Visibility.h"
#ifdef __cplusplus
#include <cstddef>
#else
@@ -61,14 +62,15 @@ typedef struct LLVMRemarkOpaqueString *LLVMRemarkStringRef;
*
* \since REMARKS_API_VERSION=0
*/
extern const char *LLVMRemarkStringGetData(LLVMRemarkStringRef String);
LLVM_C_ABI extern const char *
LLVMRemarkStringGetData(LLVMRemarkStringRef String);
/**
* Returns the size of the string.
*
* \since REMARKS_API_VERSION=0
*/
extern uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String);
LLVM_C_ABI extern uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String);
/**
* DebugLoc containing File, Line and Column.
@@ -82,7 +84,7 @@ typedef struct LLVMRemarkOpaqueDebugLoc *LLVMRemarkDebugLocRef;
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef
LLVM_C_ABI extern LLVMRemarkStringRef
LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL);
/**
@@ -90,14 +92,16 @@ LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL);
*
* \since REMARKS_API_VERSION=0
*/
extern uint32_t LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL);
LLVM_C_ABI extern uint32_t
LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL);
/**
* Return the column in the source file for a debug location.
*
* \since REMARKS_API_VERSION=0
*/
extern uint32_t LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL);
LLVM_C_ABI extern uint32_t
LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL);
/**
* Element of the "Args" list. The key might give more information about what
@@ -114,14 +118,15 @@ typedef struct LLVMRemarkOpaqueArg *LLVMRemarkArgRef;
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg);
LLVM_C_ABI extern LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg);
/**
* Returns the value of an argument. This is a string that can contain newlines.
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
LLVM_C_ABI extern LLVMRemarkStringRef
LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
/**
* Returns the debug location that is attached to the value of this argument.
@@ -130,7 +135,8 @@ extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg);
LLVM_C_ABI extern LLVMRemarkDebugLocRef
LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg);
/**
* A remark emitted by the compiler.
@@ -144,7 +150,7 @@ typedef struct LLVMRemarkOpaqueEntry *LLVMRemarkEntryRef;
*
* \since REMARKS_API_VERSION=0
*/
extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
/**
* The type of the remark. For example, it can allow users to only keep the
@@ -152,14 +158,15 @@ extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern enum LLVMRemarkType LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern enum LLVMRemarkType
LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark);
/**
* Get the name of the pass that emitted this remark.
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef
LLVM_C_ABI extern LLVMRemarkStringRef
LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark);
/**
@@ -167,7 +174,7 @@ LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef
LLVM_C_ABI extern LLVMRemarkStringRef
LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark);
/**
@@ -175,7 +182,7 @@ LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkStringRef
LLVM_C_ABI extern LLVMRemarkStringRef
LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark);
/**
@@ -185,7 +192,7 @@ LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkDebugLocRef
LLVM_C_ABI extern LLVMRemarkDebugLocRef
LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark);
/**
@@ -195,14 +202,14 @@ LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark);
/**
* The number of arguments the remark holds.
*
* \since REMARKS_API_VERSION=0
*/
extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
/**
* Get a new iterator to iterate over a remark's argument.
@@ -213,7 +220,8 @@ extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern LLVMRemarkArgRef
LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
/**
* Get the next argument in \p Remark from the position of \p It.
@@ -224,8 +232,8 @@ extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It,
LLVMRemarkEntryRef Remark);
LLVM_C_ABI extern LLVMRemarkArgRef
LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It, LLVMRemarkEntryRef Remark);
typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef;
@@ -240,8 +248,8 @@ typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef;
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf,
uint64_t Size);
LLVM_C_ABI extern LLVMRemarkParserRef
LLVMRemarkParserCreateYAML(const void *Buf, uint64_t Size);
/**
* Creates a remark parser that can be used to parse the buffer located in \p
@@ -254,8 +262,8 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf,
*
* \since REMARKS_API_VERSION=1
*/
extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf,
uint64_t Size);
LLVM_C_ABI extern LLVMRemarkParserRef
LLVMRemarkParserCreateBitstream(const void *Buf, uint64_t Size);
/**
* Returns the next remark in the file.
@@ -299,14 +307,15 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf,
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser);
LLVM_C_ABI extern LLVMRemarkEntryRef
LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser);
/**
* Returns `1` if the parser encountered an error while parsing the buffer.
*
* \since REMARKS_API_VERSION=0
*/
extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
LLVM_C_ABI extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
/**
* Returns a null-terminated string containing an error message.
@@ -319,14 +328,15 @@ extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
*
* \since REMARKS_API_VERSION=0
*/
extern const char *LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser);
LLVM_C_ABI extern const char *
LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser);
/**
* Releases all the resources used by \p Parser.
*
* \since REMARKS_API_VERSION=0
*/
extern void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser);
LLVM_C_ABI extern void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser);
/**
* Returns the version of the remarks library.
+9 -8
View File
@@ -14,9 +14,10 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -32,7 +33,7 @@ LLVM_C_EXTERN_C_BEGIN
*
* @see sys::DynamicLibrary::LoadLibraryPermanently()
*/
LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
LLVM_C_ABI LLVMBool LLVMLoadLibraryPermanently(const char *Filename);
/**
* This function parses the given arguments using the LLVM command line parser.
@@ -42,8 +43,8 @@ LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
*
* @see llvm::cl::ParseCommandLineOptions()
*/
void LLVMParseCommandLineOptions(int argc, const char *const *argv,
const char *Overview);
LLVM_C_ABI void LLVMParseCommandLineOptions(int argc, const char *const *argv,
const char *Overview);
/**
* This function will search through all previously loaded dynamic
@@ -52,7 +53,7 @@ void LLVMParseCommandLineOptions(int argc, const char *const *argv,
*
* @see sys::DynamicLibrary::SearchForAddressOfSymbol()
*/
void *LLVMSearchForAddressOfSymbol(const char *symbolName);
LLVM_C_ABI void *LLVMSearchForAddressOfSymbol(const char *symbolName);
/**
* This functions permanently adds the symbol \p symbolName with the
@@ -61,7 +62,7 @@ void *LLVMSearchForAddressOfSymbol(const char *symbolName);
*
* @see sys::DynamicLibrary::AddSymbol()
*/
void LLVMAddSymbol(const char *symbolName, void *symbolValue);
LLVM_C_ABI void LLVMAddSymbol(const char *symbolName, void *symbolValue);
/**
* @}
+72 -53
View File
@@ -19,9 +19,11 @@
#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 "Deprecated.h"
#include "ExternC.h"
#include "Types.h"
#include "Visibility.h"
#include "Config/llvm-config.h"
LLVM_C_EXTERN_C_BEGIN
@@ -38,36 +40,37 @@ typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
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"
#define LLVM_TARGET(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##TargetInfo(void);
#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"
#define LLVM_TARGET(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##Target(void);
#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"
#define LLVM_TARGET(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##TargetMC(void);
#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"
#define LLVM_ASM_PRINTER(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##AsmPrinter(void);
#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"
#define LLVM_ASM_PARSER(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##AsmParser(void);
#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"
#define LLVM_DISASSEMBLER(TargetName) \
LLVM_C_ABI void LLVMInitialize##TargetName##Disassembler(void);
#include "Config/Disassemblers.def"
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
/** LLVMInitializeAllTargetInfos - The main program should call this function if
@@ -75,7 +78,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 +87,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 +96,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 +105,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 +114,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 +124,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 */
}
@@ -183,105 +186,121 @@ static inline LLVMBool LLVMInitializeNativeDisassembler(void) {
*
* @see Module::getDataLayout()
*/
LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
LLVM_C_ABI LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
/**
* Set the data layout for a module.
*
* @see Module::setDataLayout()
*/
void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
LLVM_C_ABI void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
/** Creates target data from a target layout string.
See the constructor llvm::DataLayout::DataLayout. */
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
LLVM_C_ABI LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
/** Deallocates a TargetData.
See the destructor llvm::DataLayout::~DataLayout. */
void LLVMDisposeTargetData(LLVMTargetDataRef TD);
LLVM_C_ABI void LLVMDisposeTargetData(LLVMTargetDataRef TD);
/** Adds target library information to a pass manager. This does not take
ownership of the target library info.
See the method llvm::PassManagerBase::add. */
void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
LLVMPassManagerRef PM);
LLVM_C_ABI void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
LLVMPassManagerRef PM);
/** Converts target data to a target layout string. The string must be disposed
with LLVMDisposeMessage.
See the constructor llvm::DataLayout::DataLayout. */
char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD);
LLVM_C_ABI char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD);
/** Returns the byte order of a target, either LLVMBigEndian or
LLVMLittleEndian.
See the method llvm::DataLayout::isLittleEndian. */
enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD);
LLVM_C_ABI enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD);
/** Returns the pointer size in bytes for a target.
See the method llvm::DataLayout::getPointerSize. */
unsigned LLVMPointerSize(LLVMTargetDataRef TD);
LLVM_C_ABI unsigned LLVMPointerSize(LLVMTargetDataRef TD);
/** Returns the pointer size in bytes for a target for a specified
address space.
See the method llvm::DataLayout::getPointerSize. */
unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
LLVM_C_ABI unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
/** Returns the integer type that is the same size as a pointer on a target.
See the method llvm::DataLayout::getIntPtrType. */
LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD);
LLVM_C_ABI
LLVM_ATTRIBUTE_C_DEPRECATED(LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD),
"Use of the global context is deprecated, use "
"LLVMIntPtrTypeInContext instead");
/** Returns the integer type that is the same size as a pointer on a target.
This version allows the address space to be specified.
See the method llvm::DataLayout::getIntPtrType. */
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS);
LLVM_C_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS),
"Use of the global context is deprecated, use LLVMIntPtrTypeForASInContext "
"instead");
/** Returns the integer type that is the same size as a pointer on a target.
See the method llvm::DataLayout::getIntPtrType. */
LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD);
LLVM_C_ABI LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C,
LLVMTargetDataRef TD);
/** Returns the integer type that is the same size as a pointer on a target.
This version allows the address space to be specified.
See the method llvm::DataLayout::getIntPtrType. */
LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD,
unsigned AS);
LLVM_C_ABI LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C,
LLVMTargetDataRef TD,
unsigned AS);
/** Computes the size of a type in bits for a target.
See the method llvm::DataLayout::getTypeSizeInBits. */
unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the storage size of a type in bytes for a target.
See the method llvm::DataLayout::getTypeStoreSize. */
unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the ABI size of a type in bytes for a target.
See the method llvm::DataLayout::getTypeAllocSize. */
unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the ABI alignment of a type in bytes for a target.
See the method llvm::DataLayout::getTypeABISize. */
unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the call frame alignment of a type in bytes for a target.
See the method llvm::DataLayout::getTypeABISize. */
unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the preferred alignment of a type in bytes for a target.
See the method llvm::DataLayout::getTypeABISize. */
unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
LLVM_C_ABI unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD,
LLVMTypeRef Ty);
/** Computes the preferred alignment of a global variable in bytes for a target.
See the method llvm::DataLayout::getPreferredAlignment. */
unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
LLVMValueRef GlobalVar);
LLVM_C_ABI unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
LLVMValueRef GlobalVar);
/** Computes the structure element that contains the byte offset for a target.
See the method llvm::StructLayout::getElementContainingOffset. */
unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
unsigned long long Offset);
LLVM_C_ABI unsigned LLVMElementAtOffset(LLVMTargetDataRef TD,
LLVMTypeRef StructTy,
unsigned long long Offset);
/** Computes the byte offset of the indexed struct element for a target.
See the method llvm::StructLayout::getElementContainingOffset. */
unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD,
LLVMTypeRef StructTy, unsigned Element);
LLVM_C_ABI unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD,
LLVMTypeRef StructTy,
unsigned Element);
/**
* @}
+72 -58
View File
@@ -19,9 +19,10 @@
#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"
#include "Visibility.h"
LLVM_C_EXTERN_C_BEGIN
@@ -74,35 +75,36 @@ typedef enum {
} LLVMGlobalISelAbortMode;
/** Returns the first llvm::Target in the registered targets list. */
LLVMTargetRef LLVMGetFirstTarget(void);
LLVM_C_ABI LLVMTargetRef LLVMGetFirstTarget(void);
/** Returns the next llvm::Target given a previous one (or null if there's none) */
LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
LLVM_C_ABI LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
/*===-- Target ------------------------------------------------------------===*/
/** Finds the target corresponding to the given name and stores it in \p T.
Returns 0 on success. */
LLVMTargetRef LLVMGetTargetFromName(const char *Name);
LLVM_C_ABI LLVMTargetRef LLVMGetTargetFromName(const char *Name);
/** Finds the target corresponding to the given triple and stores it in \p T.
Returns 0 on success. Optionally returns any error in ErrorMessage.
Use LLVMDisposeMessage to dispose the message. */
LLVMBool LLVMGetTargetFromTriple(const char* Triple, LLVMTargetRef *T,
char **ErrorMessage);
LLVM_C_ABI LLVMBool LLVMGetTargetFromTriple(const char *Triple,
LLVMTargetRef *T,
char **ErrorMessage);
/** Returns the name of a target. See llvm::Target::getName */
const char *LLVMGetTargetName(LLVMTargetRef T);
LLVM_C_ABI const char *LLVMGetTargetName(LLVMTargetRef T);
/** Returns the description of a target. See llvm::Target::getDescription */
const char *LLVMGetTargetDescription(LLVMTargetRef T);
LLVM_C_ABI const char *LLVMGetTargetDescription(LLVMTargetRef T);
/** Returns if the target has a JIT */
LLVMBool LLVMTargetHasJIT(LLVMTargetRef T);
LLVM_C_ABI LLVMBool LLVMTargetHasJIT(LLVMTargetRef T);
/** Returns if the target has a TargetMachine associated */
LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T);
LLVM_C_ABI LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T);
/** Returns if the target as an ASM backend (required for emitting output) */
LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
LLVM_C_ABI LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
/*===-- Target Machine ----------------------------------------------------===*/
/**
@@ -112,35 +114,42 @@ LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
* LLVMDisposeTargetMachineOptions() after the call to
* LLVMCreateTargetMachineWithOptions().
*/
LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void);
LLVM_C_ABI LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void);
/**
* Dispose of an LLVMTargetMachineOptionsRef instance.
*/
void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options);
LLVM_C_ABI void
LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options);
void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options,
const char *CPU);
LLVM_C_ABI 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);
LLVM_C_ABI void
LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options,
const char *Features);
void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options,
const char *ABI);
LLVM_C_ABI void
LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options,
const char *ABI);
void LLVMTargetMachineOptionsSetCodeGenOptLevel(
LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level);
LLVM_C_ABI void
LLVMTargetMachineOptionsSetCodeGenOptLevel(LLVMTargetMachineOptionsRef Options,
LLVMCodeGenOptLevel Level);
void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options,
LLVMRelocMode Reloc);
LLVM_C_ABI void
LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options,
LLVMRelocMode Reloc);
void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options,
LLVMCodeModel CodeModel);
LLVM_C_ABI void
LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options,
LLVMCodeModel CodeModel);
/**
* Create a new llvm::TargetMachine.
@@ -150,90 +159,95 @@ void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options,
* \param Options additional configuration (see
* LLVMCreateTargetMachineOptions()).
*/
LLVMTargetMachineRef
LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char *Triple,
LLVMTargetMachineOptionsRef Options);
LLVM_C_ABI 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,
LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel);
LLVM_C_ABI LLVMTargetMachineRef LLVMCreateTargetMachine(
LLVMTargetRef T, const char *Triple, const char *CPU, const char *Features,
LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel);
/** Dispose the LLVMTargetMachineRef instance generated by
LLVMCreateTargetMachine. */
void LLVMDisposeTargetMachine(LLVMTargetMachineRef T);
LLVM_C_ABI void LLVMDisposeTargetMachine(LLVMTargetMachineRef T);
/** Returns the Target used in a TargetMachine */
LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T);
LLVM_C_ABI LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T);
/** Returns the triple used creating this target machine. See
llvm::TargetMachine::getTriple. The result needs to be disposed with
LLVMDisposeMessage. */
char *LLVMGetTargetMachineTriple(LLVMTargetMachineRef T);
LLVM_C_ABI char *LLVMGetTargetMachineTriple(LLVMTargetMachineRef T);
/** Returns the cpu used creating this target machine. See
llvm::TargetMachine::getCPU. The result needs to be disposed with
LLVMDisposeMessage. */
char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
LLVM_C_ABI char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
/** Returns the feature string used creating this target machine. See
llvm::TargetMachine::getFeatureString. The result needs to be disposed with
LLVMDisposeMessage. */
char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
LLVM_C_ABI char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
/** Create a DataLayout based on the targetMachine. */
LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T);
LLVM_C_ABI LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T);
/** Set the target machine's ASM verbosity. */
void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
LLVMBool VerboseAsm);
LLVM_C_ABI void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
LLVMBool VerboseAsm);
/** Enable fast-path instruction selection. */
void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable);
LLVM_C_ABI void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T,
LLVMBool Enable);
/** Enable global instruction selection. */
void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable);
LLVM_C_ABI 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);
LLVM_C_ABI void
LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
LLVMGlobalISelAbortMode Mode);
/** Enable the MachineOutliner pass. */
void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T,
LLVMBool Enable);
LLVM_C_ABI 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. */
LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
const char *Filename,
LLVMCodeGenFileType codegen,
char **ErrorMessage);
LLVM_C_ABI LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T,
LLVMModuleRef M,
const char *Filename,
LLVMCodeGenFileType codegen,
char **ErrorMessage);
/** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */
LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
LLVM_C_ABI LLVMBool LLVMTargetMachineEmitToMemoryBuffer(
LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen,
char **ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
/*===-- Triple ------------------------------------------------------------===*/
/** Get a triple for the host machine as a string. The result needs to be
disposed with LLVMDisposeMessage. */
char* LLVMGetDefaultTargetTriple(void);
LLVM_C_ABI char *LLVMGetDefaultTargetTriple(void);
/** Normalize a target triple. The result needs to be disposed with
LLVMDisposeMessage. */
char* LLVMNormalizeTargetTriple(const char* triple);
LLVM_C_ABI char *LLVMNormalizeTargetTriple(const char *triple);
/** Get the host CPU as a string. The result needs to be disposed with
LLVMDisposeMessage. */
char* LLVMGetHostCPUName(void);
LLVM_C_ABI char *LLVMGetHostCPUName(void);
/** Get the host CPU's features as a string. The result needs to be disposed
with LLVMDisposeMessage. */
char* LLVMGetHostCPUFeatures(void);
LLVM_C_ABI char *LLVMGetHostCPUFeatures(void);
/** Adds the target-specific analysis passes to the pass manager. */
void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM);
LLVM_C_ABI void LLVMAddAnalysisPasses(LLVMTargetMachineRef T,
LLVMPassManagerRef PM);
/**
* @}
+48 -35
View File
@@ -14,9 +14,10 @@
#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"
#include "../Visibility.h"
/**
* @defgroup LLVMCCoreNewPM New Pass Manager
@@ -46,9 +47,9 @@ typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
* pipelines may also be invoked using `default<O3>` and friends. See opt for
* full reference of the Passes format.
*/
LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
LLVMTargetMachineRef TM,
LLVMPassBuilderOptionsRef Options);
LLVM_C_ABI LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
LLVMTargetMachineRef TM,
LLVMPassBuilderOptionsRef Options);
/**
* Construct and run a set of passes over a function.
@@ -56,9 +57,9 @@ LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
* This function behaves the same as LLVMRunPasses, but operates on a single
* function instead of an entire module.
*/
LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F, const char *Passes,
LLVMTargetMachineRef TM,
LLVMPassBuilderOptionsRef Options);
LLVM_C_ABI LLVMErrorRef LLVMRunPassesOnFunction(
LLVMValueRef F, const char *Passes, LLVMTargetMachineRef TM,
LLVMPassBuilderOptionsRef Options);
/**
* Create a new set of options for a PassBuilder
@@ -67,63 +68,75 @@ LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F, const char *Passes,
* responsible for it. The client should call LLVMDisposePassBuilderOptions
* to free the pass builder options.
*/
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
LLVM_C_ABI LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
/**
* Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
* inside the module is valid.
*/
void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,
LLVMBool VerifyEach);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,
LLVMBool VerifyEach);
/**
* Toggle debug logging when running the PassBuilder
*/
void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,
LLVMBool DebugLogging);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,
LLVMBool DebugLogging);
/**
* Specify a custom alias analysis pipeline for the PassBuilder to be used
* instead of the default one. The string argument is not copied; the caller
* is responsible for ensuring it outlives the PassBuilderOptions instance.
*/
void LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options,
const char *AAPipeline);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options,
const char *AAPipeline);
void LLVMPassBuilderOptionsSetLoopInterleaving(
LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options,
LLVMBool LoopInterleaving);
void LLVMPassBuilderOptionsSetLoopVectorization(
LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options,
LLVMBool LoopVectorization);
void LLVMPassBuilderOptionsSetSLPVectorization(
LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options,
LLVMBool SLPVectorization);
void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,
LLVMBool LoopUnrolling);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,
LLVMBool LoopUnrolling);
void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(
LLVM_C_ABI void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(
LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);
void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,
unsigned LicmMssaOptCap);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,
unsigned LicmMssaOptCap);
void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(
LLVM_C_ABI void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(
LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);
void LLVMPassBuilderOptionsSetCallGraphProfile(
LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options,
LLVMBool CallGraphProfile);
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
LLVMBool MergeFunctions);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
LLVMBool MergeFunctions);
void LLVMPassBuilderOptionsSetInlinerThreshold(
LLVMPassBuilderOptionsRef Options, int Threshold);
LLVM_C_ABI void
LLVMPassBuilderOptionsSetInlinerThreshold(LLVMPassBuilderOptionsRef Options,
int Threshold);
/**
* Dispose of a heap-allocated PassBuilderOptions instance
*/
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
LLVM_C_ABI void
LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
/**
* @}
+2 -2
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
+44
View File
@@ -0,0 +1,44 @@
/*===-- llvm-c/Visibility.h - Visibility macros for llvm-c ------*- 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 defines visibility macros used for the LLVM C interface. These *|
|* macros are used to annotate C functions that should be exported as part of *|
|* a shared library or DLL. *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifndef LLVM_C_VISIBILITY_H
#define LLVM_C_VISIBILITY_H
#include "Config/llvm-config.h"
/// LLVM_C_ABI is the export/visibility macro used to mark symbols declared in
/// llvm-c as exported when built as a shared library.
#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS)
// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for
// two preprocessor definitions to gate LLVM_ABI macro definitions.
#if defined(LLVM_ENABLE_LLVM_C_EXPORT_ANNOTATIONS) && \
!defined(LLVM_BUILD_STATIC)
#if defined(_WIN32) && !defined(__MINGW32__)
#if defined(LLVM_EXPORTS)
#define LLVM_C_ABI __declspec(dllexport)
#else
#define LLVM_C_ABI __declspec(dllimport)
#endif
#elif defined(__has_attribute) && __has_attribute(visibility)
#define LLVM_C_ABI __attribute__((visibility("default")))
#endif
#endif
#if !defined(LLVM_C_ABI)
#define LLVM_C_ABI
#endif
#endif
#endif
+20 -18
View File
@@ -17,6 +17,7 @@
#ifndef LLVM_C_BLAKE3_H
#define LLVM_C_BLAKE3_H
#include "Visibility.h"
#include <stddef.h>
#include <stdint.h>
@@ -24,7 +25,7 @@
extern "C" {
#endif
#define LLVM_BLAKE3_VERSION_STRING "1.3.1"
#define LLVM_BLAKE3_VERSION_STRING "1.8.2"
#define LLVM_BLAKE3_KEY_LEN 32
#define LLVM_BLAKE3_OUT_LEN 32
#define LLVM_BLAKE3_BLOCK_LEN 64
@@ -54,23 +55,24 @@ typedef struct {
uint8_t cv_stack[(LLVM_BLAKE3_MAX_DEPTH + 1) * LLVM_BLAKE3_OUT_LEN];
} llvm_blake3_hasher;
const char *llvm_blake3_version(void);
void llvm_blake3_hasher_init(llvm_blake3_hasher *self);
void llvm_blake3_hasher_init_keyed(llvm_blake3_hasher *self,
const uint8_t key[LLVM_BLAKE3_KEY_LEN]);
void llvm_blake3_hasher_init_derive_key(llvm_blake3_hasher *self,
const char *context);
void llvm_blake3_hasher_init_derive_key_raw(llvm_blake3_hasher *self,
const void *context,
size_t context_len);
void llvm_blake3_hasher_update(llvm_blake3_hasher *self, const void *input,
size_t input_len);
void llvm_blake3_hasher_finalize(const llvm_blake3_hasher *self, uint8_t *out,
size_t out_len);
void llvm_blake3_hasher_finalize_seek(const llvm_blake3_hasher *self,
uint64_t seek, uint8_t *out,
size_t out_len);
void llvm_blake3_hasher_reset(llvm_blake3_hasher *self);
LLVM_C_ABI const char *llvm_blake3_version(void);
LLVM_C_ABI void llvm_blake3_hasher_init(llvm_blake3_hasher *self);
LLVM_C_ABI void
llvm_blake3_hasher_init_keyed(llvm_blake3_hasher *self,
const uint8_t key[LLVM_BLAKE3_KEY_LEN]);
LLVM_C_ABI void llvm_blake3_hasher_init_derive_key(llvm_blake3_hasher *self,
const char *context);
LLVM_C_ABI void llvm_blake3_hasher_init_derive_key_raw(llvm_blake3_hasher *self,
const void *context,
size_t context_len);
LLVM_C_ABI void llvm_blake3_hasher_update(llvm_blake3_hasher *self,
const void *input, size_t input_len);
LLVM_C_ABI void llvm_blake3_hasher_finalize(const llvm_blake3_hasher *self,
uint8_t *out, size_t out_len);
LLVM_C_ABI void llvm_blake3_hasher_finalize_seek(const llvm_blake3_hasher *self,
uint64_t seek, uint8_t *out,
size_t out_len);
LLVM_C_ABI void llvm_blake3_hasher_reset(llvm_blake3_hasher *self);
#ifdef __cplusplus
}
+17 -2
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>
@@ -46,7 +46,7 @@ typedef bool lto_bool_t;
* @{
*/
#define LTO_API_VERSION 29
#define LTO_API_VERSION 30
/**
* \since prior to LTO_API_VERSION=3
@@ -286,6 +286,21 @@ lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
extern lto_symbol_attributes
lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
/**
* Returns the number of asm undefined symbols in the object module.
*
* \since prior to LTO_API_VERSION=30
*/
extern unsigned int lto_module_get_num_asm_undef_symbols(lto_module_t mod);
/**
* Returns the name of the ith asm undefined symbol in the object module.
*
* \since prior to LTO_API_VERSION=30
*/
extern const char *lto_module_get_asm_undef_symbol_name(lto_module_t mod,
unsigned int index);
/**
* Returns the module's linker options.
*