aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/include/llvm-c/Core.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/include/llvm-c/Core.h')
-rw-r--r--contrib/llvm/include/llvm-c/Core.h101
1 files changed, 77 insertions, 24 deletions
diff --git a/contrib/llvm/include/llvm-c/Core.h b/contrib/llvm/include/llvm-c/Core.h
index 9953d52edd62..fdff77bc5e51 100644
--- a/contrib/llvm/include/llvm-c/Core.h
+++ b/contrib/llvm/include/llvm-c/Core.h
@@ -15,7 +15,7 @@
#ifndef LLVM_C_CORE_H
#define LLVM_C_CORE_H
-#include "llvm/Support/DataTypes.h"
+#include "llvm-c/Support.h"
#ifdef __cplusplus
extern "C" {
@@ -62,8 +62,6 @@ extern "C" {
* @{
*/
-typedef int LLVMBool;
-
/* Opaque types. */
/**
@@ -114,13 +112,6 @@ typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
*/
typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
-/**
- * Used to provide a module to JIT or interpreter.
- *
- * @see llvm::MemoryBuffer
- */
-typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
-
/** @see llvm::PassManagerBase */
typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
@@ -133,6 +124,12 @@ typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
* @see llvm::Use */
typedef struct LLVMOpaqueUse *LLVMUseRef;
+
+/**
+ * @see llvm::DiagnosticInfo
+ */
+typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
+
typedef enum {
LLVMZExtAttribute = 1<<0,
LLVMSExtAttribute = 1<<1,
@@ -167,7 +164,11 @@ typedef enum {
LLVMAddressSafety = 1ULL << 32,
LLVMStackProtectStrongAttribute = 1ULL<<33,
LLVMCold = 1ULL << 34,
- LLVMOptimizeNone = 1ULL << 35
+ LLVMOptimizeNone = 1ULL << 35,
+ LLVMInAllocaAttribute = 1ULL << 36,
+ LLVMNonNullAttribute = 1ULL << 37,
+ LLVMJumpTableAttribute = 1ULL << 38,
+ LLVMDereferenceableAttribute = 1ULL << 39,
*/
} LLVMAttribute;
@@ -283,8 +284,8 @@ typedef enum {
LLVMInternalLinkage, /**< Rename collisions when linking (static
functions) */
LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */
- LLVMDLLImportLinkage, /**< Function to be imported from DLL */
- LLVMDLLExportLinkage, /**< Function to be accessible from DLL */
+ LLVMDLLImportLinkage, /**< Obsolete */
+ LLVMDLLExportLinkage, /**< Obsolete */
LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
LLVMGhostLinkage, /**< Obsolete */
LLVMCommonLinkage, /**< Tentative definitions */
@@ -299,6 +300,12 @@ typedef enum {
} LLVMVisibility;
typedef enum {
+ LLVMDefaultStorageClass = 0,
+ LLVMDLLImportStorageClass = 1, /**< Function to be imported from DLL. */
+ LLVMDLLExportStorageClass = 2 /**< Function to be accessible from DLL. */
+} LLVMDLLStorageClass;
+
+typedef enum {
LLVMCCallConv = 0,
LLVMFastCallConv = 8,
LLVMColdCallConv = 9,
@@ -402,6 +409,13 @@ typedef enum {
the old one */
} LLVMAtomicRMWBinOp;
+typedef enum {
+ LLVMDSError,
+ LLVMDSWarning,
+ LLVMDSRemark,
+ LLVMDSNote
+} LLVMDiagnosticSeverity;
+
/**
* @}
*/
@@ -455,6 +469,9 @@ void LLVMEnablePrettyStackTrace(void);
* @{
*/
+typedef void (*LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *);
+typedef void (*LLVMYieldCallback)(LLVMContextRef, void *);
+
/**
* Create a new context.
*
@@ -469,6 +486,21 @@ LLVMContextRef LLVMContextCreate(void);
LLVMContextRef LLVMGetGlobalContext(void);
/**
+ * Set the diagnostic handler for this context.
+ */
+void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
+ LLVMDiagnosticHandler Handler,
+ void *DiagnosticContext);
+
+/**
+ * Set the yield callback function for this context.
+ *
+ * @see LLVMContext::setYieldCallback()
+ */
+void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
+ void *OpaqueHandle);
+
+/**
* Destroy a context instance.
*
* This should be called for every call to LLVMContextCreate() or memory
@@ -476,6 +508,21 @@ LLVMContextRef LLVMGetGlobalContext(void);
*/
void LLVMContextDispose(LLVMContextRef C);
+/**
+ * Return a string representation of the DiagnosticInfo. Use
+ * LLVMDisposeMessage to free the string.
+ *
+ * @see DiagnosticInfo::print()
+ */
+char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI);
+
+/**
+ * Return an enum LLVMDiagnosticSeverity.
+ *
+ * @see DiagnosticInfo::getSeverity()
+ */
+LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI);
+
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char* Name,
unsigned SLen);
unsigned LLVMGetMDKindID(const char* Name, unsigned SLen);
@@ -1123,9 +1170,10 @@ LLVMTypeRef LLVMX86MMXType(void);
macro(ConstantStruct) \
macro(ConstantVector) \
macro(GlobalValue) \
- macro(Function) \
macro(GlobalAlias) \
- macro(GlobalVariable) \
+ macro(GlobalObject) \
+ macro(Function) \
+ macro(GlobalVariable) \
macro(UndefValue) \
macro(Instruction) \
macro(BinaryOperator) \
@@ -1688,6 +1736,10 @@ const char *LLVMGetSection(LLVMValueRef Global);
void LLVMSetSection(LLVMValueRef Global, const char *Section);
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
+LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
+void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class);
+LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global);
+void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
/**
* @defgroup LLVMCCoreValueWithAlignment Values with alignment
@@ -1698,6 +1750,7 @@ void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
/**
* Obtain the preferred alignment of the value.
+ * @see llvm::AllocaInst::getAlignment()
* @see llvm::LoadInst::getAlignment()
* @see llvm::StoreInst::getAlignment()
* @see llvm::GlobalValue::getAlignment()
@@ -1706,6 +1759,7 @@ unsigned LLVMGetAlignment(LLVMValueRef V);
/**
* Set the preferred alignment of the value.
+ * @see llvm::AllocaInst::setAlignment()
* @see llvm::LoadInst::setAlignment()
* @see llvm::StoreInst::setAlignment()
* @see llvm::GlobalValue::setAlignment()
@@ -2663,7 +2717,9 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val,
const char *Name);
LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS,
LLVMValueRef RHS, const char *Name);
-LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,
+LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering,
+ LLVMBool singleThread, const char *Name);
+LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op,
LLVMValueRef PTR, LLVMValueRef Val,
LLVMAtomicOrdering ordering,
LLVMBool singleThread);
@@ -2793,16 +2849,13 @@ void LLVMDisposePassManager(LLVMPassManagerRef PM);
* @{
*/
-/** Allocate and initialize structures needed to make LLVM safe for
- multithreading. The return value indicates whether multithreaded
- initialization succeeded. Must be executed in isolation from all
- other LLVM api calls.
- @see llvm::llvm_start_multithreaded */
+/** Deprecated: Multi-threading can only be enabled/disabled with the compile
+ time define LLVM_ENABLE_THREADS. This function always returns
+ LLVMIsMultithreaded(). */
LLVMBool LLVMStartMultithreaded(void);
-/** Deallocate structures necessary to make LLVM safe for multithreading.
- Must be executed in isolation from all other LLVM api calls.
- @see llvm::llvm_stop_multithreaded */
+/** Deprecated: Multi-threading can only be enabled/disabled with the compile
+ time define LLVM_ENABLE_THREADS. */
void LLVMStopMultithreaded(void);
/** Check whether LLVM is executing in thread-safe mode or not.