diff options
Diffstat (limited to 'contrib/llvm/include/llvm-c')
-rw-r--r-- | contrib/llvm/include/llvm-c/Core.h | 8 | ||||
-rw-r--r-- | contrib/llvm/include/llvm-c/Linker.h | 16 | ||||
-rw-r--r-- | contrib/llvm/include/llvm-c/Support.h | 18 | ||||
-rw-r--r-- | contrib/llvm/include/llvm-c/Transforms/Scalar.h | 3 | ||||
-rw-r--r-- | contrib/llvm/include/llvm-c/lto.h | 72 |
5 files changed, 108 insertions, 9 deletions
diff --git a/contrib/llvm/include/llvm-c/Core.h b/contrib/llvm/include/llvm-c/Core.h index 8873fdb..73bff0b 100644 --- a/contrib/llvm/include/llvm-c/Core.h +++ b/contrib/llvm/include/llvm-c/Core.h @@ -169,6 +169,7 @@ typedef enum { LLVMNonNullAttribute = 1ULL << 37, LLVMJumpTableAttribute = 1ULL << 38, LLVMDereferenceableAttribute = 1ULL << 39, + LLVMDereferenceableOrNullAttribute = 1ULL << 40, */ } LLVMAttribute; @@ -997,6 +998,13 @@ unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); /** + * Get the type of the element at a given index in the structure. + * + * @see llvm::StructType::getTypeAtIndex() + */ +LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i); + +/** * Determine whether a structure is packed. * * @see llvm::StructType::isPacked() diff --git a/contrib/llvm/include/llvm-c/Linker.h b/contrib/llvm/include/llvm-c/Linker.h index a932c6d..9f98a33 100644 --- a/contrib/llvm/include/llvm-c/Linker.h +++ b/contrib/llvm/include/llvm-c/Linker.h @@ -20,21 +20,23 @@ extern "C" { #endif - -/* Note: LLVMLinkerPreserveSource has no effect. */ +/* This enum is provided for backwards-compatibility only. It has no effect. */ typedef enum { - LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */ - LLVMLinkerPreserveSource = 1 /* Preserve the source module. */ + LLVMLinkerDestroySource = 0, /* This is the default behavior. */ + LLVMLinkerPreserveSource_Removed = 1 /* This option has been deprecated and + should not be used. */ } LLVMLinkerMode; - /* Links the source module into the destination module, taking ownership * of the source module away from the caller. Optionally returns a * human-readable description of any errors that occurred in linking. * OutMessage must be disposed with LLVMDisposeMessage. The return value - * is true if an error occurred, false otherwise. */ + * is true if an error occurred, false otherwise. + * + * Note that the linker mode parameter \p Unused is no longer used, and has + * no effect. */ LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src, - LLVMLinkerMode Mode, char **OutMessage); + LLVMLinkerMode Unused, char **OutMessage); #ifdef __cplusplus } diff --git a/contrib/llvm/include/llvm-c/Support.h b/contrib/llvm/include/llvm-c/Support.h index a9216d0..eca3b7a 100644 --- a/contrib/llvm/include/llvm-c/Support.h +++ b/contrib/llvm/include/llvm-c/Support.h @@ -58,6 +58,24 @@ LLVMBool LLVMLoadLibraryPermanently(const char* Filename); void LLVMParseCommandLineOptions(int argc, const char *const *argv, const char *Overview); +/** + * This function will search through all previously loaded dynamic + * libraries for the symbol \p symbolName. If it is found, the address of + * that symbol is returned. If not, null is returned. + * + * @see sys::DynamicLibrary::SearchForAddressOfSymbol() + */ +void *LLVMSearchForAddressOfSymbol(const char *symbolName); + +/** + * This functions permanently adds the symbol \p symbolName with the + * value \p symbolValue. These symbols are searched before any + * libraries. + * + * @see sys::DynamicLibrary::AddSymbol() + */ +void LLVMAddSymbol(const char *symbolName, void *symbolValue); + #ifdef __cplusplus } #endif diff --git a/contrib/llvm/include/llvm-c/Transforms/Scalar.h b/contrib/llvm/include/llvm-c/Transforms/Scalar.h index 7ad1ad1..48c19a6 100644 --- a/contrib/llvm/include/llvm-c/Transforms/Scalar.h +++ b/contrib/llvm/include/llvm-c/Transforms/Scalar.h @@ -35,6 +35,9 @@ extern "C" { /** See llvm::createAggressiveDCEPass function. */ void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM); +/** See llvm::createBitTrackingDCEPass function. */ +void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM); + /** See llvm::createAlignmentFromAssumptionsPass function. */ void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM); diff --git a/contrib/llvm/include/llvm-c/lto.h b/contrib/llvm/include/llvm-c/lto.h index 3f30d6d..1db0778 100644 --- a/contrib/llvm/include/llvm-c/lto.h +++ b/contrib/llvm/include/llvm-c/lto.h @@ -40,7 +40,7 @@ typedef bool lto_bool_t; * @{ */ -#define LTO_API_VERSION 11 +#define LTO_API_VERSION 15 /** * \since prior to LTO_API_VERSION=3 @@ -171,7 +171,7 @@ lto_module_create_from_memory(const void* mem, size_t length); * Loads an object file from memory with an extra path argument. * Returns NULL on error (check lto_get_error_message() for details). * - * \since prior to LTO_API_VERSION=9 + * \since LTO_API_VERSION=9 */ extern lto_module_t lto_module_create_from_memory_with_path(const void* mem, size_t length, @@ -396,6 +396,17 @@ extern lto_bool_t lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod); /** + * Sets the object module for code generation. This will transfer the ownship of + * the module to code generator. + * + * \c cg and \c mod must both be in the same context. + * + * \since LTO_API_VERSION=13 + */ +extern void +lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod); + +/** * Sets if debug info should be generated. * Returns true on error (check lto_get_error_message() for details). * @@ -464,6 +475,8 @@ lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path); /** * Generates code for all added modules into one native object file. + * This calls lto_codegen_optimize then lto_codegen_compile_optimized. + * * On success returns a pointer to a generated mach-o/ELF buffer and * length set to the buffer size. The buffer is owned by the * lto_code_gen_t and will be freed when lto_codegen_dispose() @@ -477,6 +490,9 @@ lto_codegen_compile(lto_code_gen_t cg, size_t* length); /** * Generates code for all added modules into one native object file. + * This calls lto_codegen_optimize then lto_codegen_compile_optimized (instead + * of returning a generated mach-o/ELF buffer, it writes to a file). + * * The name of the file is written to name. Returns true on error. * * \since LTO_API_VERSION=5 @@ -484,6 +500,36 @@ lto_codegen_compile(lto_code_gen_t cg, size_t* length); extern lto_bool_t lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name); +/** + * Runs optimization for the merged module. Returns true on error. + * + * \since LTO_API_VERSION=12 + */ +extern lto_bool_t +lto_codegen_optimize(lto_code_gen_t cg); + +/** + * Generates code for the optimized merged module into one native object file. + * It will not run any IR optimizations on the merged module. + * + * On success returns a pointer to a generated mach-o/ELF buffer and length set + * to the buffer size. The buffer is owned by the lto_code_gen_t and will be + * freed when lto_codegen_dispose() is called, or + * lto_codegen_compile_optimized() is called again. On failure, returns NULL + * (check lto_get_error_message() for details). + * + * \since LTO_API_VERSION=12 + */ +extern const void* +lto_codegen_compile_optimized(lto_code_gen_t cg, size_t* length); + +/** + * Returns the runtime API version. + * + * \since LTO_API_VERSION=12 + */ +extern unsigned int +lto_api_version(void); /** * Sets options to help debug codegen bugs. @@ -502,6 +548,28 @@ lto_codegen_debug_options(lto_code_gen_t cg, const char *); extern void lto_initialize_disassembler(void); +/** + * Sets if we should run internalize pass during optimization and code + * generation. + * + * \since LTO_API_VERSION=14 + */ +extern void +lto_codegen_set_should_internalize(lto_code_gen_t cg, + lto_bool_t ShouldInternalize); + +/** + * \brief Set whether to embed uselists in bitcode. + * + * Sets whether \a lto_codegen_write_merged_modules() should embed uselists in + * output bitcode. This should be turned on for all -save-temps output. + * + * \since LTO_API_VERSION=15 + */ +extern void +lto_codegen_set_should_embed_uselists(lto_code_gen_t cg, + lto_bool_t ShouldEmbedUselists); + #ifdef __cplusplus } #endif |