diff options
Diffstat (limited to 'include/llvm-c')
-rw-r--r-- | include/llvm-c/Core.h | 54 | ||||
-rw-r--r-- | include/llvm-c/Object.h | 1 | ||||
-rw-r--r-- | include/llvm-c/Transforms/PassManagerBuilder.h | 1 | ||||
-rw-r--r-- | include/llvm-c/lto.h | 22 | ||||
-rw-r--r-- | include/llvm-c/module.modulemap | 5 |
5 files changed, 72 insertions, 11 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 50c5e3a..f37e3f8 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -124,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, @@ -159,7 +165,8 @@ typedef enum { LLVMStackProtectStrongAttribute = 1ULL<<33, LLVMCold = 1ULL << 34, LLVMOptimizeNone = 1ULL << 35, - LLVMInAllocaAttribute = 1ULL << 36 + LLVMInAllocaAttribute = 1ULL << 36, + LLVMNonNullAttribute = 1ULL << 37 */ } LLVMAttribute; @@ -400,6 +407,13 @@ typedef enum { the old one */ } LLVMAtomicRMWBinOp; +typedef enum { + LLVMDSError, + LLVMDSWarning, + LLVMDSRemark, + LLVMDSNote +} LLVMDiagnosticSeverity; + /** * @} */ @@ -453,6 +467,9 @@ void LLVMEnablePrettyStackTrace(void); * @{ */ +typedef void (*LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *); +typedef void (*LLVMYieldCallback)(LLVMContextRef, void *); + /** * Create a new context. * @@ -467,6 +484,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 @@ -474,6 +506,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); @@ -1121,9 +1168,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) \ diff --git a/include/llvm-c/Object.h b/include/llvm-c/Object.h index c271552..447fcea 100644 --- a/include/llvm-c/Object.h +++ b/include/llvm-c/Object.h @@ -78,7 +78,6 @@ void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI); // SymbolRef accessors const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI); uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI); -uint64_t LLVMGetSymbolFileOffset(LLVMSymbolIteratorRef SI); uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI); // RelocationRef accessors diff --git a/include/llvm-c/Transforms/PassManagerBuilder.h b/include/llvm-c/Transforms/PassManagerBuilder.h index 545f8aa..3d7a9d6 100644 --- a/include/llvm-c/Transforms/PassManagerBuilder.h +++ b/include/llvm-c/Transforms/PassManagerBuilder.h @@ -19,7 +19,6 @@ typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef; #ifdef __cplusplus -#include "llvm/Transforms/IPO/PassManagerBuilder.h" extern "C" { #endif diff --git a/include/llvm-c/lto.h b/include/llvm-c/lto.h index 049c4d7..51079896 100644 --- a/include/llvm-c/lto.h +++ b/include/llvm-c/lto.h @@ -40,7 +40,7 @@ typedef bool lto_bool_t; * @{ */ -#define LTO_API_VERSION 10 +#define LTO_API_VERSION 11 /** * \since prior to LTO_API_VERSION=3 @@ -79,14 +79,15 @@ typedef enum { typedef enum { LTO_CODEGEN_PIC_MODEL_STATIC = 0, LTO_CODEGEN_PIC_MODEL_DYNAMIC = 1, - LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2 + LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2, + LTO_CODEGEN_PIC_MODEL_DEFAULT = 3 } lto_codegen_model; /** opaque reference to a loaded object module */ -typedef struct LTOModule* lto_module_t; +typedef struct LLVMOpaqueLTOModule *lto_module_t; /** opaque reference to a code generator */ -typedef struct LTOCodeGenerator* lto_code_gen_t; +typedef struct LLVMOpaqueLTOCodeGenerator *lto_code_gen_t; #ifdef __cplusplus extern "C" { @@ -374,6 +375,14 @@ lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model); extern void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu); +/** + * Sets attributes for the cpu to generate code for. + * + * \since LTO_API_VERSION=11 + */ +extern void +lto_codegen_set_attr(lto_code_gen_t cg, const char *attr); + /** * Sets the location of the assembler tool to run. If not set, libLTO @@ -394,8 +403,9 @@ lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, int nargs); /** - * Tells LTO optimization passes that this symbol must be preserved - * because it is referenced by native code or a command line option. + * Adds to a list of all global symbols that must exist in the final generated + * code. If a function is not listed there, it might be inlined into every usage + * and optimized away. * * \since prior to LTO_API_VERSION=3 */ diff --git a/include/llvm-c/module.modulemap b/include/llvm-c/module.modulemap new file mode 100644 index 0000000..2bcdbc1 --- /dev/null +++ b/include/llvm-c/module.modulemap @@ -0,0 +1,5 @@ +module LLVM_C { + requires cplusplus + umbrella "." + module * { export * } +} |