mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Merge pull request #1156 from odin-lang/llvm-12.0.1-windows
Update Windows to LLVM 12.0.1
This commit is contained in:
BIN
Binary file not shown.
Binary file not shown.
@@ -49,7 +49,8 @@ set compiler_warnings= ^
|
|||||||
-wd4100 -wd4101 -wd4127 -wd4146 ^
|
-wd4100 -wd4101 -wd4127 -wd4146 ^
|
||||||
-wd4456 -wd4457
|
-wd4456 -wd4457
|
||||||
|
|
||||||
set compiler_includes=
|
set compiler_includes= ^
|
||||||
|
/Isrc\
|
||||||
set libs= ^
|
set libs= ^
|
||||||
kernel32.lib ^
|
kernel32.lib ^
|
||||||
bin\llvm\windows\LLVM-C.lib
|
bin\llvm\windows\LLVM-C.lib
|
||||||
|
|||||||
@@ -50,20 +50,20 @@ XXH_DISABLE_PREFETCH :: #config(XXH_DISABLE_PREFETCH, true)
|
|||||||
/*
|
/*
|
||||||
llvm.prefetch fails code generation on Linux.
|
llvm.prefetch fails code generation on Linux.
|
||||||
*/
|
*/
|
||||||
when XXH_DISABLE_PREFETCH {
|
when !XXH_DISABLE_PREFETCH {
|
||||||
import "core:sys/llvm"
|
|
||||||
|
|
||||||
prefetch_address :: #force_inline proc(address: rawptr) {
|
prefetch_address :: #force_inline proc(address: rawptr) {
|
||||||
llvm.prefetch(address, .Read, .High, .Data)
|
intrinsics.prefetch_read_data(address, /*high*/3)
|
||||||
}
|
}
|
||||||
prefetch_offset :: #force_inline proc(address: rawptr, auto_cast offset: uintptr) {
|
prefetch_offset :: #force_inline proc(address: rawptr, #any_int offset: uintptr) {
|
||||||
ptr := rawptr(uintptr(address) + offset)
|
ptr := rawptr(uintptr(address) + offset)
|
||||||
prefetch_address(ptr)
|
prefetch_address(ptr)
|
||||||
}
|
}
|
||||||
prefetch :: proc { prefetch_address, prefetch_offset, }
|
prefetch :: proc { prefetch_address, prefetch_offset, }
|
||||||
} else {
|
} else {
|
||||||
prefetch_address :: #force_inline proc(address: rawptr) {}
|
prefetch_address :: #force_inline proc(address: rawptr) {
|
||||||
prefetch_offset :: #force_inline proc(address: rawptr, auto_cast offset: uintptr) {}
|
}
|
||||||
|
prefetch_offset :: #force_inline proc(address: rawptr, #any_int offset: uintptr) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ fixed_point_div :: proc(lhs, rhs: $T, #const scale: uint) -> T where type_is
|
|||||||
fixed_point_mul_sat :: proc(lhs, rhs: $T, #const scale: uint) -> T where type_is_integer(T) ---
|
fixed_point_mul_sat :: proc(lhs, rhs: $T, #const scale: uint) -> T where type_is_integer(T) ---
|
||||||
fixed_point_div_sat :: proc(lhs, rhs: $T, #const scale: uint) -> T where type_is_integer(T) ---
|
fixed_point_div_sat :: proc(lhs, rhs: $T, #const scale: uint) -> T where type_is_integer(T) ---
|
||||||
|
|
||||||
|
prefetch_read_instruction :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
|
||||||
|
prefetch_read_data :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
|
||||||
|
prefetch_write_instruction :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
|
||||||
|
prefetch_write_data :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
|
||||||
|
|
||||||
// Compiler Hints
|
// Compiler Hints
|
||||||
expect :: proc(val, expected_val: T) -> T ---
|
expect :: proc(val, expected_val: T) -> T ---
|
||||||
|
|
||||||
|
|||||||
+35
-1
@@ -2646,7 +2646,41 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
|
|||||||
operand->type = x.type;
|
operand->type = x.type;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BuiltinProc_prefetch_read_instruction:
|
||||||
|
case BuiltinProc_prefetch_read_data:
|
||||||
|
case BuiltinProc_prefetch_write_instruction:
|
||||||
|
case BuiltinProc_prefetch_write_data:
|
||||||
|
{
|
||||||
|
operand->mode = Addressing_NoValue;
|
||||||
|
operand->type = nullptr;
|
||||||
|
|
||||||
|
Operand x = {};
|
||||||
|
Operand y = {};
|
||||||
|
check_expr(c, &x, ce->args[0]);
|
||||||
|
check_expr(c, &y, ce->args[1]);
|
||||||
|
if (x.mode == Addressing_Invalid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (y.mode == Addressing_Invalid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
check_assignment(c, &x, t_rawptr, builtin_name);
|
||||||
|
if (x.mode == Addressing_Invalid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (y.mode != Addressing_Constant && is_type_integer(y.type)) {
|
||||||
|
error(y.expr, "Second argument to '%.*s' representing the locality must be an integer in the range 0..=3", LIT(builtin_name));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
i64 locality = exact_value_to_i64(y.value);
|
||||||
|
if (!(0 <= locality && locality <= 3)) {
|
||||||
|
error(y.expr, "Second argument to '%.*s' representing the locality must be an integer in the range 0..=3", LIT(builtin_name));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BuiltinProc_syscall:
|
case BuiltinProc_syscall:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,6 +69,11 @@ enum BuiltinProcId {
|
|||||||
|
|
||||||
BuiltinProc_volatile_store,
|
BuiltinProc_volatile_store,
|
||||||
BuiltinProc_volatile_load,
|
BuiltinProc_volatile_load,
|
||||||
|
|
||||||
|
BuiltinProc_prefetch_read_instruction,
|
||||||
|
BuiltinProc_prefetch_read_data,
|
||||||
|
BuiltinProc_prefetch_write_instruction,
|
||||||
|
BuiltinProc_prefetch_write_data,
|
||||||
|
|
||||||
BuiltinProc_atomic_fence,
|
BuiltinProc_atomic_fence,
|
||||||
BuiltinProc_atomic_fence_acq,
|
BuiltinProc_atomic_fence_acq,
|
||||||
@@ -305,6 +310,11 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_COUNT] = {
|
|||||||
|
|
||||||
{STR_LIT("volatile_store"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
{STR_LIT("volatile_store"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("volatile_load"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("volatile_load"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
|
|
||||||
|
{STR_LIT("prefetch_read_instruction"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
|
{STR_LIT("prefetch_read_data"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
|
{STR_LIT("prefetch_write_instruction"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
|
{STR_LIT("prefetch_write_data"), 2, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
|
|
||||||
{STR_LIT("atomic_fence"), 0, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
{STR_LIT("atomic_fence"), 0, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("atomic_fence_acq"), 0, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
{STR_LIT("atomic_fence_acq"), 0, false, Expr_Stmt, BuiltinProcPkg_intrinsics},
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#ifndef LLVM_C_ANALYSIS_H
|
#ifndef LLVM_C_ANALYSIS_H
|
||||||
#define LLVM_C_ANALYSIS_H
|
#define LLVM_C_ANALYSIS_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#ifndef LLVM_C_BITREADER_H
|
#ifndef LLVM_C_BITREADER_H
|
||||||
#define LLVM_C_BITREADER_H
|
#define LLVM_C_BITREADER_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#ifndef LLVM_C_BITWRITER_H
|
#ifndef LLVM_C_BITWRITER_H
|
||||||
#define LLVM_C_BITWRITER_H
|
#define LLVM_C_BITWRITER_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@
|
|||||||
#ifndef LLVM_C_COMDAT_H
|
#ifndef LLVM_C_COMDAT_H
|
||||||
#define LLVM_C_COMDAT_H
|
#define LLVM_C_COMDAT_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
#define LLVM_USE_PERF 0
|
#define LLVM_USE_PERF 0
|
||||||
|
|
||||||
/* Major version of the LLVM API */
|
/* Major version of the LLVM API */
|
||||||
#define LLVM_VERSION_MAJOR 11
|
#define LLVM_VERSION_MAJOR 12
|
||||||
|
|
||||||
/* Minor version of the LLVM API */
|
/* Minor version of the LLVM API */
|
||||||
#define LLVM_VERSION_MINOR 0
|
#define LLVM_VERSION_MINOR 0
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
#define LLVM_VERSION_PATCH 1
|
#define LLVM_VERSION_PATCH 1
|
||||||
|
|
||||||
/* LLVM version string */
|
/* LLVM version string */
|
||||||
#define LLVM_VERSION_STRING "11.0.1"
|
#define LLVM_VERSION_STRING "12.0.1"
|
||||||
|
|
||||||
/* Whether LLVM records statistics for use with GetStatistics(),
|
/* Whether LLVM records statistics for use with GetStatistics(),
|
||||||
* PrintStatistics() or PrintStatisticsJSON()
|
* PrintStatistics() or PrintStatisticsJSON()
|
||||||
|
|||||||
+57
-9
@@ -15,9 +15,9 @@
|
|||||||
#ifndef LLVM_C_CORE_H
|
#ifndef LLVM_C_CORE_H
|
||||||
#define LLVM_C_CORE_H
|
#define LLVM_C_CORE_H
|
||||||
|
|
||||||
#include "ErrorHandling.h"
|
#include "llvm-c/ErrorHandling.h"
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -162,7 +162,8 @@ typedef enum {
|
|||||||
LLVMX86_MMXTypeKind, /**< X86 MMX */
|
LLVMX86_MMXTypeKind, /**< X86 MMX */
|
||||||
LLVMTokenTypeKind, /**< Tokens */
|
LLVMTokenTypeKind, /**< Tokens */
|
||||||
LLVMScalableVectorTypeKind, /**< Scalable SIMD vector type */
|
LLVMScalableVectorTypeKind, /**< Scalable SIMD vector type */
|
||||||
LLVMBFloatTypeKind /**< 16 bit brain floating point type */
|
LLVMBFloatTypeKind, /**< 16 bit brain floating point type */
|
||||||
|
LLVMX86_AMXTypeKind /**< X86 AMX */
|
||||||
} LLVMTypeKind;
|
} LLVMTypeKind;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -281,6 +282,7 @@ typedef enum {
|
|||||||
LLVMInlineAsmValueKind,
|
LLVMInlineAsmValueKind,
|
||||||
|
|
||||||
LLVMInstructionValueKind,
|
LLVMInstructionValueKind,
|
||||||
|
LLVMPoisonValueValueKind
|
||||||
} LLVMValueKind;
|
} LLVMValueKind;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -602,6 +604,17 @@ unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A);
|
|||||||
*/
|
*/
|
||||||
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A);
|
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a type attribute
|
||||||
|
*/
|
||||||
|
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
|
||||||
|
LLVMTypeRef type_ref);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type attribute's value.
|
||||||
|
*/
|
||||||
|
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a string attribute.
|
* Create a string attribute.
|
||||||
*/
|
*/
|
||||||
@@ -624,6 +637,12 @@ const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
|
|||||||
*/
|
*/
|
||||||
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A);
|
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A);
|
||||||
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A);
|
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A);
|
||||||
|
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a Type from a context by its registered name.
|
||||||
|
*/
|
||||||
|
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@@ -866,9 +885,7 @@ LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty,
|
|||||||
*/
|
*/
|
||||||
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
|
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
|
||||||
|
|
||||||
/**
|
/** Deprecated: Use LLVMGetTypeByName2 instead. */
|
||||||
* Obtain a Type from a module by its registered name.
|
|
||||||
*/
|
|
||||||
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
|
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1444,9 +1461,21 @@ unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
|
|||||||
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
|
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the number of elements in a vector type.
|
* Create a vector type that contains a defined type and has a scalable
|
||||||
|
* number of elements.
|
||||||
*
|
*
|
||||||
* This only works on types that represent vectors.
|
* The created type will exist in the context thats its element type
|
||||||
|
* exists in.
|
||||||
|
*
|
||||||
|
* @see llvm::ScalableVectorType::get()
|
||||||
|
*/
|
||||||
|
LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
|
||||||
|
unsigned ElementCount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the (possibly scalable) number of elements in a vector type.
|
||||||
|
*
|
||||||
|
* This only works on types that represent vectors (fixed or scalable).
|
||||||
*
|
*
|
||||||
* @see llvm::VectorType::getNumElements()
|
* @see llvm::VectorType::getNumElements()
|
||||||
*/
|
*/
|
||||||
@@ -1477,6 +1506,11 @@ LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
|
|||||||
*/
|
*/
|
||||||
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
|
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a X86 AMX type in a context.
|
||||||
|
*/
|
||||||
|
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a token type in a context.
|
* Create a token type in a context.
|
||||||
*/
|
*/
|
||||||
@@ -1494,6 +1528,7 @@ LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
|
|||||||
LLVMTypeRef LLVMVoidType(void);
|
LLVMTypeRef LLVMVoidType(void);
|
||||||
LLVMTypeRef LLVMLabelType(void);
|
LLVMTypeRef LLVMLabelType(void);
|
||||||
LLVMTypeRef LLVMX86MMXType(void);
|
LLVMTypeRef LLVMX86MMXType(void);
|
||||||
|
LLVMTypeRef LLVMX86AMXType(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@@ -1550,6 +1585,7 @@ LLVMTypeRef LLVMX86MMXType(void);
|
|||||||
macro(Function) \
|
macro(Function) \
|
||||||
macro(GlobalVariable) \
|
macro(GlobalVariable) \
|
||||||
macro(UndefValue) \
|
macro(UndefValue) \
|
||||||
|
macro(PoisonValue) \
|
||||||
macro(Instruction) \
|
macro(Instruction) \
|
||||||
macro(UnaryOperator) \
|
macro(UnaryOperator) \
|
||||||
macro(BinaryOperator) \
|
macro(BinaryOperator) \
|
||||||
@@ -1683,6 +1719,11 @@ LLVMBool LLVMIsConstant(LLVMValueRef Val);
|
|||||||
*/
|
*/
|
||||||
LLVMBool LLVMIsUndef(LLVMValueRef Val);
|
LLVMBool LLVMIsUndef(LLVMValueRef Val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether a value instance is poisonous.
|
||||||
|
*/
|
||||||
|
LLVMBool LLVMIsPoison(LLVMValueRef Val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert value instances between types.
|
* Convert value instances between types.
|
||||||
*
|
*
|
||||||
@@ -1841,6 +1882,13 @@ LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty);
|
|||||||
*/
|
*/
|
||||||
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
|
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a constant value referring to a poison value of a type.
|
||||||
|
*
|
||||||
|
* @see llvm::PoisonValue::get()
|
||||||
|
*/
|
||||||
|
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a value instance is null.
|
* Determine whether a value instance is null.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -77,8 +77,4 @@ typedef signed int ssize_t;
|
|||||||
# define UINT64_MAX 0xffffffffffffffffULL
|
# define UINT64_MAX 0xffffffffffffffffULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HUGE_VALF
|
|
||||||
#define HUGE_VALF (float)HUGE_VAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LLVM_C_DATATYPES_H */
|
#endif /* LLVM_C_DATATYPES_H */
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
#ifndef LLVM_C_DEBUGINFO_H
|
#ifndef LLVM_C_DEBUGINFO_H
|
||||||
#define LLVM_C_DEBUGINFO_H
|
#define LLVM_C_DEBUGINFO_H
|
||||||
|
|
||||||
#include "Core.h"
|
#include "llvm-c/Core.h"
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -159,7 +159,9 @@ enum {
|
|||||||
LLVMDIImportedEntityMetadataKind,
|
LLVMDIImportedEntityMetadataKind,
|
||||||
LLVMDIMacroMetadataKind,
|
LLVMDIMacroMetadataKind,
|
||||||
LLVMDIMacroFileMetadataKind,
|
LLVMDIMacroFileMetadataKind,
|
||||||
LLVMDICommonBlockMetadataKind
|
LLVMDICommonBlockMetadataKind,
|
||||||
|
LLVMDIStringTypeMetadataKind,
|
||||||
|
LLVMDIGenericSubrangeMetadataKind
|
||||||
};
|
};
|
||||||
typedef unsigned LLVMMetadataKind;
|
typedef unsigned LLVMMetadataKind;
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef LLVM_C_DISASSEMBLER_H
|
#ifndef LLVM_C_DISASSEMBLER_H
|
||||||
#define LLVM_C_DISASSEMBLER_H
|
#define LLVM_C_DISASSEMBLER_H
|
||||||
|
|
||||||
#include "DisassemblerTypes.h"
|
#include "llvm-c/DisassemblerTypes.h"
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup LLVMCDisassembler Disassembler
|
* @defgroup LLVMCDisassembler Disassembler
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#ifndef LLVM_DISASSEMBLER_TYPES_H
|
#ifndef LLVM_DISASSEMBLER_TYPES_H
|
||||||
#define LLVM_DISASSEMBLER_TYPES_H
|
#define LLVM_DISASSEMBLER_TYPES_H
|
||||||
|
|
||||||
#include "DataTypes.h"
|
#include "llvm-c/DataTypes.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#else
|
#else
|
||||||
|
|||||||
+6
-1
@@ -14,7 +14,7 @@
|
|||||||
#ifndef LLVM_C_ERROR_H
|
#ifndef LLVM_C_ERROR_H
|
||||||
#define LLVM_C_ERROR_H
|
#define LLVM_C_ERROR_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -62,6 +62,11 @@ void LLVMDisposeErrorMessage(char *ErrMsg);
|
|||||||
*/
|
*/
|
||||||
LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
|
LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a StringError.
|
||||||
|
*/
|
||||||
|
LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_END
|
LLVM_C_EXTERN_C_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#ifndef LLVM_C_ERROR_HANDLING_H
|
#ifndef LLVM_C_ERROR_HANDLING_H
|
||||||
#define LLVM_C_ERROR_HANDLING_H
|
#define LLVM_C_ERROR_HANDLING_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
#ifndef LLVM_C_EXECUTIONENGINE_H
|
#ifndef LLVM_C_EXECUTIONENGINE_H
|
||||||
#define LLVM_C_EXECUTIONENGINE_H
|
#define LLVM_C_EXECUTIONENGINE_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Target.h"
|
#include "llvm-c/Target.h"
|
||||||
#include "TargetMachine.h"
|
#include "llvm-c/TargetMachine.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
#ifndef LLVM_C_IRREADER_H
|
#ifndef LLVM_C_IRREADER_H
|
||||||
#define LLVM_C_IRREADER_H
|
#define LLVM_C_IRREADER_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
#ifndef LLVM_C_INITIALIZATION_H
|
#ifndef LLVM_C_INITIALIZATION_H
|
||||||
#define LLVM_C_INITIALIZATION_H
|
#define LLVM_C_INITIALIZATION_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@
|
|||||||
#ifndef LLVM_C_LINKER_H
|
#ifndef LLVM_C_LINKER_H
|
||||||
#define LLVM_C_LINKER_H
|
#define LLVM_C_LINKER_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -19,9 +19,9 @@
|
|||||||
#ifndef LLVM_C_OBJECT_H
|
#ifndef LLVM_C_OBJECT_H
|
||||||
#define LLVM_C_OBJECT_H
|
#define LLVM_C_OBJECT_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
#include "Config/llvm-config.h"
|
#include "llvm-c/Config/llvm-config.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef LLVM_C_REMARKS_H
|
#ifndef LLVM_C_REMARKS_H
|
||||||
#define LLVM_C_REMARKS_H
|
#define LLVM_C_REMARKS_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
#ifndef LLVM_C_SUPPORT_H
|
#ifndef LLVM_C_SUPPORT_H
|
||||||
#define LLVM_C_SUPPORT_H
|
#define LLVM_C_SUPPORT_H
|
||||||
|
|
||||||
#include "DataTypes.h"
|
#include "llvm-c/DataTypes.h"
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -19,9 +19,9 @@
|
|||||||
#ifndef LLVM_C_TARGET_H
|
#ifndef LLVM_C_TARGET_H
|
||||||
#define LLVM_C_TARGET_H
|
#define LLVM_C_TARGET_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
#include "Config/llvm-config.h"
|
#include "llvm-c/Config/llvm-config.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -40,34 +40,34 @@ typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef;
|
|||||||
/* Declare all of the target-initialization functions that are available. */
|
/* Declare all of the target-initialization functions that are available. */
|
||||||
#define LLVM_TARGET(TargetName) \
|
#define LLVM_TARGET(TargetName) \
|
||||||
void LLVMInitialize##TargetName##TargetInfo(void);
|
void LLVMInitialize##TargetName##TargetInfo(void);
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void);
|
#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void);
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
#define LLVM_TARGET(TargetName) \
|
#define LLVM_TARGET(TargetName) \
|
||||||
void LLVMInitialize##TargetName##TargetMC(void);
|
void LLVMInitialize##TargetName##TargetMC(void);
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
/* Declare all of the available assembly printer initialization functions. */
|
/* Declare all of the available assembly printer initialization functions. */
|
||||||
#define LLVM_ASM_PRINTER(TargetName) \
|
#define LLVM_ASM_PRINTER(TargetName) \
|
||||||
void LLVMInitialize##TargetName##AsmPrinter(void);
|
void LLVMInitialize##TargetName##AsmPrinter(void);
|
||||||
#include "Config/AsmPrinters.def"
|
#include "llvm-c/Config/AsmPrinters.def"
|
||||||
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
|
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
/* Declare all of the available assembly parser initialization functions. */
|
/* Declare all of the available assembly parser initialization functions. */
|
||||||
#define LLVM_ASM_PARSER(TargetName) \
|
#define LLVM_ASM_PARSER(TargetName) \
|
||||||
void LLVMInitialize##TargetName##AsmParser(void);
|
void LLVMInitialize##TargetName##AsmParser(void);
|
||||||
#include "Config/AsmParsers.def"
|
#include "llvm-c/Config/AsmParsers.def"
|
||||||
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
|
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
/* Declare all of the available disassembler initialization functions. */
|
/* Declare all of the available disassembler initialization functions. */
|
||||||
#define LLVM_DISASSEMBLER(TargetName) \
|
#define LLVM_DISASSEMBLER(TargetName) \
|
||||||
void LLVMInitialize##TargetName##Disassembler(void);
|
void LLVMInitialize##TargetName##Disassembler(void);
|
||||||
#include "Config/Disassemblers.def"
|
#include "llvm-c/Config/Disassemblers.def"
|
||||||
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
|
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
|
||||||
|
|
||||||
/** LLVMInitializeAllTargetInfos - The main program should call this function if
|
/** LLVMInitializeAllTargetInfos - The main program should call this function if
|
||||||
@@ -75,7 +75,7 @@ typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef;
|
|||||||
support. */
|
support. */
|
||||||
static inline void LLVMInitializeAllTargetInfos(void) {
|
static inline void LLVMInitializeAllTargetInfos(void) {
|
||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ static inline void LLVMInitializeAllTargetInfos(void) {
|
|||||||
support. */
|
support. */
|
||||||
static inline void LLVMInitializeAllTargets(void) {
|
static inline void LLVMInitializeAllTargets(void) {
|
||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ static inline void LLVMInitializeAllTargets(void) {
|
|||||||
support. */
|
support. */
|
||||||
static inline void LLVMInitializeAllTargetMCs(void) {
|
static inline void LLVMInitializeAllTargetMCs(void) {
|
||||||
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
|
#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
|
||||||
#include "Config/Targets.def"
|
#include "llvm-c/Config/Targets.def"
|
||||||
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ static inline void LLVMInitializeAllTargetMCs(void) {
|
|||||||
available via the TargetRegistry. */
|
available via the TargetRegistry. */
|
||||||
static inline void LLVMInitializeAllAsmPrinters(void) {
|
static inline void LLVMInitializeAllAsmPrinters(void) {
|
||||||
#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
|
#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
|
||||||
#include "Config/AsmPrinters.def"
|
#include "llvm-c/Config/AsmPrinters.def"
|
||||||
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
|
#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ static inline void LLVMInitializeAllAsmPrinters(void) {
|
|||||||
available via the TargetRegistry. */
|
available via the TargetRegistry. */
|
||||||
static inline void LLVMInitializeAllAsmParsers(void) {
|
static inline void LLVMInitializeAllAsmParsers(void) {
|
||||||
#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
|
#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
|
||||||
#include "Config/AsmParsers.def"
|
#include "llvm-c/Config/AsmParsers.def"
|
||||||
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
|
#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ static inline void LLVMInitializeAllAsmParsers(void) {
|
|||||||
static inline void LLVMInitializeAllDisassemblers(void) {
|
static inline void LLVMInitializeAllDisassemblers(void) {
|
||||||
#define LLVM_DISASSEMBLER(TargetName) \
|
#define LLVM_DISASSEMBLER(TargetName) \
|
||||||
LLVMInitialize##TargetName##Disassembler();
|
LLVMInitialize##TargetName##Disassembler();
|
||||||
#include "Config/Disassemblers.def"
|
#include "llvm-c/Config/Disassemblers.def"
|
||||||
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
|
#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
#ifndef LLVM_C_TARGETMACHINE_H
|
#ifndef LLVM_C_TARGETMACHINE_H
|
||||||
#define LLVM_C_TARGETMACHINE_H
|
#define LLVM_C_TARGETMACHINE_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "Target.h"
|
#include "llvm-c/Target.h"
|
||||||
#include "Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_AGGRESSIVEINSTCOMBINE_H
|
#ifndef LLVM_C_TRANSFORMS_AGGRESSIVEINSTCOMBINE_H
|
||||||
#define LLVM_C_TRANSFORMS_AGGRESSIVEINSTCOMBINE_H
|
#define LLVM_C_TRANSFORMS_AGGRESSIVEINSTCOMBINE_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_COROUTINES_H
|
#ifndef LLVM_C_TRANSFORMS_COROUTINES_H
|
||||||
#define LLVM_C_TRANSFORMS_COROUTINES_H
|
#define LLVM_C_TRANSFORMS_COROUTINES_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
#include "PassManagerBuilder.h"
|
#include "llvm-c/Transforms/PassManagerBuilder.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_IPO_H
|
#ifndef LLVM_C_TRANSFORMS_IPO_H
|
||||||
#define LLVM_C_TRANSFORMS_IPO_H
|
#define LLVM_C_TRANSFORMS_IPO_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -57,9 +57,6 @@ void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
|
|||||||
/** See llvm::createGlobalOptimizerPass function. */
|
/** See llvm::createGlobalOptimizerPass function. */
|
||||||
void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
|
void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
/** See llvm::createIPConstantPropagationPass function. */
|
|
||||||
void LLVMAddIPConstantPropagationPass(LLVMPassManagerRef PM);
|
|
||||||
|
|
||||||
/** See llvm::createPruneEHPass function. */
|
/** See llvm::createPruneEHPass function. */
|
||||||
void LLVMAddPruneEHPass(LLVMPassManagerRef PM);
|
void LLVMAddPruneEHPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_INSTCOMBINE_H
|
#ifndef LLVM_C_TRANSFORMS_INSTCOMBINE_H
|
||||||
#define LLVM_C_TRANSFORMS_INSTCOMBINE_H
|
#define LLVM_C_TRANSFORMS_INSTCOMBINE_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
|
#ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
|
||||||
#define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
|
#define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef;
|
typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef;
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_SCALAR_H
|
#ifndef LLVM_C_TRANSFORMS_SCALAR_H
|
||||||
#define LLVM_C_TRANSFORMS_SCALAR_H
|
#define LLVM_C_TRANSFORMS_SCALAR_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -67,6 +67,9 @@ void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
|
|||||||
/** See llvm::createInstructionCombiningPass function. */
|
/** See llvm::createInstructionCombiningPass function. */
|
||||||
void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
|
void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
/** See llvm::createInstSimplifyLegacyPass function. */
|
||||||
|
void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
/** See llvm::createJumpThreadingPass function. */
|
/** See llvm::createJumpThreadingPass function. */
|
||||||
void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
|
void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
@@ -125,9 +128,6 @@ void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
|
|||||||
/** See llvm::createTailCallEliminationPass function. */
|
/** See llvm::createTailCallEliminationPass function. */
|
||||||
void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
|
void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
/** See llvm::createConstantPropagationPass function. */
|
|
||||||
void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
|
|
||||||
|
|
||||||
/** See llvm::demotePromoteMemoryToRegisterPass function. */
|
/** See llvm::demotePromoteMemoryToRegisterPass function. */
|
||||||
void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
|
void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_UTILS_H
|
#ifndef LLVM_C_TRANSFORMS_UTILS_H
|
||||||
#define LLVM_C_TRANSFORMS_UTILS_H
|
#define LLVM_C_TRANSFORMS_UTILS_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef LLVM_C_TRANSFORMS_VECTORIZE_H
|
#ifndef LLVM_C_TRANSFORMS_VECTORIZE_H
|
||||||
#define LLVM_C_TRANSFORMS_VECTORIZE_H
|
#define LLVM_C_TRANSFORMS_VECTORIZE_H
|
||||||
|
|
||||||
#include "../ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
#include "../Types.h"
|
#include "llvm-c/Types.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@
|
|||||||
#ifndef LLVM_C_TYPES_H
|
#ifndef LLVM_C_TYPES_H
|
||||||
#define LLVM_C_TYPES_H
|
#define LLVM_C_TYPES_H
|
||||||
|
|
||||||
#include "DataTypes.h"
|
#include "llvm-c/DataTypes.h"
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
LLVM_C_EXTERN_C_BEGIN
|
LLVM_C_EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
#ifndef LLVM_C_LTO_H
|
#ifndef LLVM_C_LTO_H
|
||||||
#define LLVM_C_LTO_H
|
#define LLVM_C_LTO_H
|
||||||
|
|
||||||
#include "ExternC.h"
|
#include "llvm-c/ExternC.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#if LLVM_VERSION_MAJOR < 11
|
#if LLVM_VERSION_MAJOR < 11
|
||||||
#error "LLVM Version 11 is the minimum required"
|
#error "LLVM Version 11 is the minimum required"
|
||||||
|
#elif LLVM_VERSION_MAJOR == 12 && !(LLVM_VERSION_MINOR > 0 || LLVM_VERSION_PATCH > 0)
|
||||||
|
#error "If LLVM Version 12.x.y is wanted, at least LLVM 12.0.1 is required"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -22,18 +22,18 @@ void lb_add_must_preserve_predicate_pass(lbModule *m, LLVMPassManagerRef fpm, i3
|
|||||||
|
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR < 12
|
#if LLVM_VERSION_MAJOR < 12
|
||||||
#define LLVM_ADD_CONSTNAT_VALUE_PASS LLVMAddConstantPropagationPass
|
#define LLVM_ADD_CONSTANT_VALUE_PASS LLVMAddConstantPropagationPass
|
||||||
#else
|
#else
|
||||||
#define LLVM_ADD_CONSTNAT_VALUE_PASS LLVMAddCorrelatedValuePropagationPass
|
#define LLVM_ADD_CONSTANT_VALUE_PASS LLVMAddCorrelatedValuePropagationPass
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lb_basic_populate_function_pass_manager(LLVMPassManagerRef fpm) {
|
void lb_basic_populate_function_pass_manager(LLVMPassManagerRef fpm) {
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddEarlyCSEPass(fpm);
|
LLVMAddEarlyCSEPass(fpm);
|
||||||
|
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddCFGSimplificationPass(fpm);
|
LLVMAddCFGSimplificationPass(fpm);
|
||||||
@@ -64,10 +64,10 @@ void lb_populate_function_pass_manager(lbModule *m, LLVMPassManagerRef fpm, bool
|
|||||||
LLVMAddMemCpyOptPass(fpm);
|
LLVMAddMemCpyOptPass(fpm);
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddEarlyCSEPass(fpm);
|
LLVMAddEarlyCSEPass(fpm);
|
||||||
|
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddCFGSimplificationPass(fpm);
|
LLVMAddCFGSimplificationPass(fpm);
|
||||||
@@ -105,10 +105,10 @@ void lb_populate_function_pass_manager_specific(lbModule *m, LLVMPassManagerRef
|
|||||||
LLVMAddMemCpyOptPass(fpm);
|
LLVMAddMemCpyOptPass(fpm);
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddEarlyCSEPass(fpm);
|
LLVMAddEarlyCSEPass(fpm);
|
||||||
|
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(fpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddCFGSimplificationPass(fpm);
|
LLVMAddCFGSimplificationPass(fpm);
|
||||||
@@ -165,7 +165,7 @@ void lb_add_function_simplifcation_passes(LLVMPassManagerRef mpm, i32 optimizati
|
|||||||
|
|
||||||
LLVMAddInstructionCombiningPass(mpm);
|
LLVMAddInstructionCombiningPass(mpm);
|
||||||
LLVMAddJumpThreadingPass(mpm);
|
LLVMAddJumpThreadingPass(mpm);
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(mpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(mpm);
|
||||||
LLVMAddDeadStoreEliminationPass(mpm);
|
LLVMAddDeadStoreEliminationPass(mpm);
|
||||||
LLVMAddLICMPass(mpm);
|
LLVMAddLICMPass(mpm);
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ void lb_populate_module_pass_manager(LLVMTargetMachineRef target_machine, LLVMPa
|
|||||||
LLVMAddInstructionCombiningPass(mpm);
|
LLVMAddInstructionCombiningPass(mpm);
|
||||||
if (optimization_level >= 2) {
|
if (optimization_level >= 2) {
|
||||||
LLVMAddEarlyCSEPass(mpm);
|
LLVMAddEarlyCSEPass(mpm);
|
||||||
LLVM_ADD_CONSTNAT_VALUE_PASS(mpm);
|
LLVM_ADD_CONSTANT_VALUE_PASS(mpm);
|
||||||
LLVMAddLICMPass(mpm);
|
LLVMAddLICMPass(mpm);
|
||||||
LLVMAddLoopUnswitchPass(mpm);
|
LLVMAddLoopUnswitchPass(mpm);
|
||||||
LLVMAddCFGSimplificationPass(mpm);
|
LLVMAddCFGSimplificationPass(mpm);
|
||||||
|
|||||||
@@ -1831,6 +1831,54 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
|
|||||||
return lb_emit_conv(p, res, t);
|
return lb_emit_conv(p, res, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case BuiltinProc_prefetch_read_instruction:
|
||||||
|
case BuiltinProc_prefetch_read_data:
|
||||||
|
case BuiltinProc_prefetch_write_instruction:
|
||||||
|
case BuiltinProc_prefetch_write_data:
|
||||||
|
{
|
||||||
|
lbValue ptr = lb_emit_conv(p, lb_build_expr(p, ce->args[0]), t_rawptr);
|
||||||
|
unsigned long long locality = cast(unsigned long long)exact_value_to_i64(ce->args[1]->tav.value);
|
||||||
|
unsigned long long rw = 0;
|
||||||
|
unsigned long long cache = 0;
|
||||||
|
switch (id) {
|
||||||
|
case BuiltinProc_prefetch_read_instruction:
|
||||||
|
rw = 0;
|
||||||
|
cache = 0;
|
||||||
|
break;
|
||||||
|
case BuiltinProc_prefetch_read_data:
|
||||||
|
rw = 0;
|
||||||
|
cache = 1;
|
||||||
|
break;
|
||||||
|
case BuiltinProc_prefetch_write_instruction:
|
||||||
|
rw = 1;
|
||||||
|
cache = 0;
|
||||||
|
break;
|
||||||
|
case BuiltinProc_prefetch_write_data:
|
||||||
|
rw = 1;
|
||||||
|
cache = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
char const *name = "llvm.prefetch";
|
||||||
|
|
||||||
|
LLVMTypeRef types[1] = {lb_type(p->module, t_rawptr)};
|
||||||
|
unsigned id = LLVMLookupIntrinsicID(name, gb_strlen(name));
|
||||||
|
GB_ASSERT_MSG(id != 0, "Unable to find %s.%s", name, LLVMPrintTypeToString(types[0]));
|
||||||
|
LLVMValueRef ip = LLVMGetIntrinsicDeclaration(p->module->mod, id, types, gb_count_of(types));
|
||||||
|
|
||||||
|
LLVMTypeRef llvm_i32 = lb_type(p->module, t_i32);
|
||||||
|
LLVMValueRef args[4] = {};
|
||||||
|
args[0] = ptr.value;
|
||||||
|
args[1] = LLVMConstInt(llvm_i32, rw, false);
|
||||||
|
args[2] = LLVMConstInt(llvm_i32, locality, false);
|
||||||
|
args[3] = LLVMConstInt(llvm_i32, cache, false);
|
||||||
|
|
||||||
|
lbValue res = {};
|
||||||
|
res.value = LLVMBuildCall(p->builder, ip, args, gb_count_of(args), "");
|
||||||
|
res.type = nullptr;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
case BuiltinProc_syscall:
|
case BuiltinProc_syscall:
|
||||||
{
|
{
|
||||||
unsigned arg_count = cast(unsigned)ce->args.count;
|
unsigned arg_count = cast(unsigned)ce->args.count;
|
||||||
|
|||||||
Reference in New Issue
Block a user