diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml index 996cfe41f047f..cd49f0473fa92 100644 --- a/.github/workflows/llvm-project-tests.yml +++ b/.github/workflows/llvm-project-tests.yml @@ -36,13 +36,13 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + #- ubuntu-latest # Use windows-2019 due to: # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317 - windows-2019 # We're using a specific version of macOS due to: # https://github.com/actions/virtual-environments/issues/5900 - - macOS-11 + #- macOS-11 steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') @@ -85,7 +85,7 @@ jobs: # This should be a no-op for non-mac OSes PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12 with: - cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache' + cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DLLVM_TARGETS_TO_BUILD=X86' build_target: '${{ inputs.build_target }}' - name: Build and Test libclc diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml index cc9855ce182b2..6d09e74044bb5 100644 --- a/.github/workflows/llvm-tests.yml +++ b/.github/workflows/llvm-tests.yml @@ -6,19 +6,6 @@ permissions: on: workflow_dispatch: push: - branches: - - 'release/**' - paths: - - 'llvm/**' - - '.github/workflows/llvm-tests.yml' - - '.github/workflows/llvm-project-tests.yml' - pull_request: - branches: - - 'release/**' - paths: - - 'llvm/**' - - '.github/workflows/llvm-tests.yml' - - '.github/workflows/llvm-project-tests.yml' concurrency: # Skip intermediate builds: always. @@ -28,7 +15,6 @@ concurrency: jobs: check_all: - if: github.repository_owner == 'llvm' name: Test llvm,clang,libclc uses: ./.github/workflows/llvm-project-tests.yml with: diff --git a/libunwind/include/mach-o/compact_unwind_encoding.h b/libunwind/include/mach-o/compact_unwind_encoding.h index 4c48e33c3c177..51ca943062c1f 100644 --- a/libunwind/include/mach-o/compact_unwind_encoding.h +++ b/libunwind/include/mach-o/compact_unwind_encoding.h @@ -406,7 +406,7 @@ enum { // #define UNWIND_SECTION_VERSION 1 -struct unwind_info_section_header +struct LLVM_CLASS_ABI unwind_info_section_header { uint32_t version; // UNWIND_SECTION_VERSION uint32_t commonEncodingsArraySectionOffset; @@ -421,14 +421,14 @@ struct unwind_info_section_header // unwind_info_section_header_lsda_index_entry[] }; -struct unwind_info_section_header_index_entry +struct LLVM_CLASS_ABI unwind_info_section_header_index_entry { uint32_t functionOffset; uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range }; -struct unwind_info_section_header_lsda_index_entry +struct LLVM_CLASS_ABI unwind_info_section_header_lsda_index_entry { uint32_t functionOffset; uint32_t lsdaOffset; @@ -441,14 +441,14 @@ struct unwind_info_section_header_lsda_index_entry // 511 entries. // -struct unwind_info_regular_second_level_entry +struct LLVM_CLASS_ABI unwind_info_regular_second_level_entry { uint32_t functionOffset; compact_unwind_encoding_t encoding; }; #define UNWIND_SECOND_LEVEL_REGULAR 2 -struct unwind_info_regular_second_level_page_header +struct LLVM_CLASS_ABI unwind_info_regular_second_level_page_header { uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR uint16_t entryPageOffset; @@ -457,7 +457,7 @@ struct unwind_info_regular_second_level_page_header }; #define UNWIND_SECOND_LEVEL_COMPRESSED 3 -struct unwind_info_compressed_second_level_page_header +struct LLVM_CLASS_ABI unwind_info_compressed_second_level_page_header { uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED uint16_t entryPageOffset; diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 05e4d6c823c0d..5c86bdcd80d17 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -592,6 +592,21 @@ function(llvm_add_library name) if(ARG_COMPONENT_LIB) set_target_properties(${name} PROPERTIES LLVM_COMPONENT TRUE) + #target_compile_definitions(${name} PRIVATE LLVM_ABI_EXPORTS) + target_compile_options(${name} PRIVATE -DLLVM_ABI_EXPORTS) + + # When building shared objects for each target there are some internal APIs + # that are used across shared objects which we can't hide. + if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND + (NOT (WIN32 OR CYGWIN) OR (MINGW AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND + NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX") AND + NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET) + + set_target_properties(${name} PROPERTIES + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN YES) + endif() set_property(GLOBAL APPEND PROPERTY LLVM_COMPONENT_LIBS ${name}) endif() @@ -1038,6 +1053,10 @@ macro(add_llvm_executable name) endif() llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH}) + + if (LLVM_LINK_LLVM_DYLIB AND NOT DISABLE_LLVM_LINK_LLVM_DYLIB) + target_compile_options(${name} PRIVATE -DLLVM_DLL_IMPORT) + endif() endmacro(add_llvm_executable name) # add_llvm_pass_plugin(name [NO_MODULE] ...) diff --git a/llvm/include/llvm-c/Analysis.h b/llvm/include/llvm-c/Analysis.h index 270b145a4d27e..26538ce7cd6d6 100644 --- a/llvm/include/llvm-c/Analysis.h +++ b/llvm/include/llvm-c/Analysis.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_ANALYSIS_H #define LLVM_C_ANALYSIS_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -41,17 +42,17 @@ 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, +LLVM_FUNC_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_FUNC_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_FUNC_ABI void LLVMViewFunctionCFG(LLVMValueRef Fn); +LLVM_FUNC_ABI void LLVMViewFunctionCFGOnly(LLVMValueRef Fn); /** * @} diff --git a/llvm/include/llvm-c/BitReader.h b/llvm/include/llvm-c/BitReader.h index 088107468d4fb..fbfa4a5186fd5 100644 --- a/llvm/include/llvm-c/BitReader.h +++ b/llvm/include/llvm-c/BitReader.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_BITREADER_H #define LLVM_C_BITREADER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -36,20 +37,20 @@ 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, +LLVM_FUNC_ABI LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage); /* 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, +LLVM_FUNC_ABI LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule); /* This is deprecated. Use LLVMParseBitcodeInContext2. */ -LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, +LLVM_FUNC_ABI LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage); -LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, +LLVM_FUNC_ABI LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule); @@ -57,7 +58,7 @@ LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, 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, +LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage); @@ -68,15 +69,15 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, * * Takes ownership of \p MemBuf if (and only if) the module was read * successfully. */ -LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, +LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM); /* This is deprecated. Use LLVMGetBitcodeModule2. */ -LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, +LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage); -LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM); +LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM); /** * @} diff --git a/llvm/include/llvm-c/BitWriter.h b/llvm/include/llvm-c/BitWriter.h index ea84b6593d126..c7c9c065cfc26 100644 --- a/llvm/include/llvm-c/BitWriter.h +++ b/llvm/include/llvm-c/BitWriter.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_BITWRITER_H #define LLVM_C_BITWRITER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -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_FUNC_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, +LLVM_FUNC_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_FUNC_ABI int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); /** Writes a module to a new memory buffer and returns it. */ -LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M); /** * @} diff --git a/llvm/include/llvm-c/Comdat.h b/llvm/include/llvm-c/Comdat.h index 8002bc0581af7..c391f50a1f123 100644 --- a/llvm/include/llvm-c/Comdat.h +++ b/llvm/include/llvm-c/Comdat.h @@ -16,6 +16,7 @@ #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" +#include "llvm/Support/Compiler.h" LLVM_C_EXTERN_C_BEGIN @@ -43,35 +44,35 @@ typedef enum { * * @see llvm::Module::getOrInsertComdat() */ -LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name); +LLVM_FUNC_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_FUNC_ABI LLVMComdatRef LLVMGetComdat(LLVMValueRef V); /** * Assign the Comdat to the given global object. * * @see llvm::GlobalObject::setComdat() */ -void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C); +LLVM_FUNC_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_FUNC_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_FUNC_ABI void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind); /** * @} diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index ceeb74bd4e6fa..3f443eae93b70 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -15,6 +15,7 @@ #ifndef LLVM_C_CORE_H #define LLVM_C_CORE_H +#include "llvm/Support/Compiler.h" #include "llvm-c/Deprecated.h" #include "llvm-c/ErrorHandling.h" #include "llvm-c/ExternC.h" @@ -491,7 +492,7 @@ typedef unsigned LLVMAttributeIndex; /** Deallocate and destroy all ManagedStatic variables. @see llvm::llvm_shutdown @see ManagedStatic */ -void LLVMShutdown(void); +LLVM_FUNC_ABI void LLVMShutdown(void); /*===-- Version query -----------------------------------------------------===*/ @@ -501,12 +502,12 @@ void LLVMShutdown(void); * The version components are returned via the function's three output * parameters or skipped if a NULL pointer was supplied. */ -void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch); +LLVM_FUNC_ABI void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch); /*===-- Error handling ----------------------------------------------------===*/ -char *LLVMCreateMessage(const char *Message); -void LLVMDisposeMessage(char *Message); +LLVM_FUNC_ABI char *LLVMCreateMessage(const char *Message); +LLVM_FUNC_ABI void LLVMDisposeMessage(char *Message); /** * @defgroup LLVMCCoreContext Contexts @@ -529,36 +530,36 @@ typedef void (*LLVMYieldCallback)(LLVMContextRef, void *); * Every call to this function should be paired with a call to * LLVMContextDispose() or the context will leak memory. */ -LLVMContextRef LLVMContextCreate(void); +LLVM_FUNC_ABI LLVMContextRef LLVMContextCreate(void); /** * Obtain the global context instance. */ -LLVMContextRef LLVMGetGlobalContext(void); +LLVM_FUNC_ABI LLVMContextRef LLVMGetGlobalContext(void); /** * Set the diagnostic handler for this context. */ -void LLVMContextSetDiagnosticHandler(LLVMContextRef C, +LLVM_FUNC_ABI void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext); /** * Get the diagnostic handler of this context. */ -LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C); +LLVM_FUNC_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C); /** * Get the diagnostic context of this context. */ -void *LLVMContextGetDiagnosticContext(LLVMContextRef C); +LLVM_FUNC_ABI void *LLVMContextGetDiagnosticContext(LLVMContextRef C); /** * Set the yield callback function for this context. * * @see LLVMContext::setYieldCallback() */ -void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, +LLVM_FUNC_ABI void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle); /** @@ -566,7 +567,7 @@ void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, * * @see LLVMContext::shouldDiscardValueNames() */ -LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C); +LLVM_FUNC_ABI LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C); /** * Set whether the given context discards all value names. @@ -576,7 +577,7 @@ LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C); * * @see LLVMContext::setDiscardValueNames() */ -void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard); +LLVM_FUNC_ABI void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard); /** * Destroy a context instance. @@ -584,7 +585,7 @@ void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard); * This should be called for every call to LLVMContextCreate() or memory * will be leaked. */ -void LLVMContextDispose(LLVMContextRef C); +LLVM_FUNC_ABI void LLVMContextDispose(LLVMContextRef C); /** * Return a string representation of the DiagnosticInfo. Use @@ -592,18 +593,18 @@ void LLVMContextDispose(LLVMContextRef C); * * @see DiagnosticInfo::print() */ -char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI); +LLVM_FUNC_ABI char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI); /** * Return an enum LLVMDiagnosticSeverity. * * @see DiagnosticInfo::getSeverity() */ -LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI); +LLVM_FUNC_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI); -unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, +LLVM_FUNC_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen); -unsigned LLVMGetMDKindID(const char *Name, unsigned SLen); +LLVM_FUNC_ABI unsigned LLVMGetMDKindID(const char *Name, unsigned SLen); /** * Return an unique id given the name of a enum attribute, @@ -616,65 +617,65 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen); * NB: Attribute names and/or id are subject to change without * going through the C API deprecation cycle. */ -unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen); -unsigned LLVMGetLastEnumAttributeKind(void); +LLVM_FUNC_ABI unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen); +LLVM_FUNC_ABI unsigned LLVMGetLastEnumAttributeKind(void); /** * Create an enum attribute. */ -LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, +LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val); /** * Get the unique id corresponding to the enum attribute * passed as argument. */ -unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A); +LLVM_FUNC_ABI unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A); /** * Get the enum attribute's value. 0 is returned if none exists. */ -uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A); +LLVM_FUNC_ABI uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A); /** * Create a type attribute */ -LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, +LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref); /** * Get the type attribute's value. */ -LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A); /** * Create a string attribute. */ -LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, +LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength); /** * Get the string attribute's kind. */ -const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length); +LLVM_FUNC_ABI const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length); /** * Get the string attribute's value. */ -const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length); +LLVM_FUNC_ABI const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length); /** * Check for the different types of attributes. */ -LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A); -LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A); -LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A); +LLVM_FUNC_ABI LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A); +LLVM_FUNC_ABI LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A); +LLVM_FUNC_ABI LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A); /** * Obtain a Type from a context by its registered name. */ -LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name); /** * @} @@ -699,7 +700,7 @@ LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name); * Every invocation should be paired with LLVMDisposeModule() or memory * will be leaked. */ -LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); +LLVM_FUNC_ABI LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); /** * Create a new, empty module in a specific context. @@ -707,12 +708,12 @@ LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); * Every invocation should be paired with LLVMDisposeModule() or memory * will be leaked. */ -LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, +LLVM_FUNC_ABI LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C); /** * Return an exact copy of the specified module. */ -LLVMModuleRef LLVMCloneModule(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMModuleRef LLVMCloneModule(LLVMModuleRef M); /** * Destroy a module instance. @@ -720,7 +721,7 @@ LLVMModuleRef LLVMCloneModule(LLVMModuleRef M); * This must be called for every created module or memory will be * leaked. */ -void LLVMDisposeModule(LLVMModuleRef M); +LLVM_FUNC_ABI void LLVMDisposeModule(LLVMModuleRef M); /** * Obtain the identifier of a module. @@ -730,7 +731,7 @@ void LLVMDisposeModule(LLVMModuleRef M); * @return The identifier of M. * @see Module::getModuleIdentifier() */ -const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len); +LLVM_FUNC_ABI const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len); /** * Set the identifier of a module to a string Ident with length Len. @@ -740,7 +741,7 @@ const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len); * @param Len Length of Ident * @see Module::setModuleIdentifier() */ -void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len); +LLVM_FUNC_ABI void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len); /** * Obtain the module's original source file name. @@ -750,7 +751,7 @@ void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len); * @return The original source file name of M * @see Module::getSourceFileName() */ -const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len); +LLVM_FUNC_ABI const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len); /** * Set the original source file name of a module to a string Name with length @@ -761,7 +762,7 @@ const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len); * @param Len Length of Name * @see Module::setSourceFileName() */ -void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len); +LLVM_FUNC_ABI void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len); /** * Obtain the data layout for a module. @@ -772,29 +773,29 @@ void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len); * but match the name of another method on the module. Prefer the use * of LLVMGetDataLayoutStr, which is not ambiguous. */ -const char *LLVMGetDataLayoutStr(LLVMModuleRef M); -const char *LLVMGetDataLayout(LLVMModuleRef M); +LLVM_FUNC_ABI const char *LLVMGetDataLayoutStr(LLVMModuleRef M); +LLVM_FUNC_ABI const char *LLVMGetDataLayout(LLVMModuleRef M); /** * Set the data layout for a module. * * @see Module::setDataLayout() */ -void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr); +LLVM_FUNC_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr); /** * Obtain the target triple for a module. * * @see Module::getTargetTriple() */ -const char *LLVMGetTarget(LLVMModuleRef M); +LLVM_FUNC_ABI const char *LLVMGetTarget(LLVMModuleRef M); /** * Set the target triple for a module. * * @see Module::setTargetTriple() */ -void LLVMSetTarget(LLVMModuleRef M, const char *Triple); +LLVM_FUNC_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple); /** * Returns the module flags as an array of flag-key-value triples. The caller @@ -803,19 +804,19 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple); * * @see Module::getModuleFlagsMetadata() */ -LLVMModuleFlagEntry *LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len); +LLVM_FUNC_ABI LLVMModuleFlagEntry *LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len); /** * Destroys module flags metadata entries. */ -void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries); +LLVM_FUNC_ABI void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries); /** * Returns the flag behavior for a module flag entry at a specific index. * * @see Module::ModuleFlagEntry::Behavior */ -LLVMModuleFlagBehavior +LLVM_FUNC_ABI LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index); @@ -824,7 +825,7 @@ LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, * * @see Module::ModuleFlagEntry::Key */ -const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, +LLVM_FUNC_ABI const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len); /** @@ -832,7 +833,7 @@ const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, * * @see Module::ModuleFlagEntry::Val */ -LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, +LLVM_FUNC_ABI LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index); /** @@ -841,7 +842,7 @@ LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, * * @see Module::getModuleFlag() */ -LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, const char *Key, size_t KeyLen); /** @@ -850,7 +851,7 @@ LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, * * @see Module::addModuleFlag() */ -void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, +LLVM_FUNC_ABI void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, const char *Key, size_t KeyLen, LLVMMetadataRef Val); @@ -859,7 +860,7 @@ void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, * * @see Module::dump() */ -void LLVMDumpModule(LLVMModuleRef M); +LLVM_FUNC_ABI void LLVMDumpModule(LLVMModuleRef M); /** * Print a representation of a module to a file. The ErrorMessage needs to be @@ -867,7 +868,7 @@ void LLVMDumpModule(LLVMModuleRef M); * * @see Module::print() */ -LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, +LLVM_FUNC_ABI LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage); /** @@ -876,35 +877,35 @@ LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, * * @see Module::print() */ -char *LLVMPrintModuleToString(LLVMModuleRef M); +LLVM_FUNC_ABI char *LLVMPrintModuleToString(LLVMModuleRef M); /** * Get inline assembly for a module. * * @see Module::getModuleInlineAsm() */ -const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len); +LLVM_FUNC_ABI const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len); /** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() */ -void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len); +LLVM_FUNC_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len); /** * Append inline assembly to a module. * * @see Module::appendModuleInlineAsm() */ -void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len); +LLVM_FUNC_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len); /** * Create the specified uniqued inline asm string. * * @see InlineAsm::get() */ -LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString, +LLVM_FUNC_ABI LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize, const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, @@ -914,20 +915,20 @@ LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString, * Get the template string used for an inline assembly snippet * */ -const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len); +LLVM_FUNC_ABI const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len); /** * Get the raw constraint string for an inline assembly snippet * */ -const char *LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, +LLVM_FUNC_ABI const char *LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len); /** * Get the dialect used by the inline asm snippet * */ -LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal); +LLVM_FUNC_ABI LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal); /** * Get the function type of the inline assembly snippet. The same type that @@ -936,49 +937,49 @@ LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal); * @see LLVMGetInlineAsm * */ -LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal); /** * Get if the inline asm snippet has side effects * */ -LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal); +LLVM_FUNC_ABI LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal); /** * Get if the inline asm snippet needs an aligned stack * */ -LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal); +LLVM_FUNC_ABI LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal); /** * Get if the inline asm snippet may unwind the stack * */ -LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal); +LLVM_FUNC_ABI LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal); /** * Obtain the context to which this module is associated. * * @see Module::getContext() */ -LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M); /** Deprecated: Use LLVMGetTypeByName2 instead. */ -LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); /** * Obtain an iterator to the first NamedMDNode in a Module. * * @see llvm::Module::named_metadata_begin() */ -LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M); /** * Obtain an iterator to the last NamedMDNode in a Module. * * @see llvm::Module::named_metadata_end() */ -LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M); /** * Advance a NamedMDNode iterator to the next NamedMDNode. @@ -986,7 +987,7 @@ LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M); * Returns NULL if the iterator was already at the end and there are no more * named metadata nodes. */ -LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); /** * Decrement a NamedMDNode iterator to the previous NamedMDNode. @@ -994,7 +995,7 @@ LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); * Returns NULL if the iterator was already at the beginning and there are * no previous named metadata nodes. */ -LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); /** * Retrieve a NamedMDNode with the given name, returning NULL if no such @@ -1002,7 +1003,7 @@ LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode); * * @see llvm::Module::getNamedMetadata() */ -LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen); /** @@ -1011,7 +1012,7 @@ LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, * * @see llvm::Module::getOrInsertNamedMetadata() */ -LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen); @@ -1020,7 +1021,7 @@ LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M, * * @see llvm::NamedMDNode::getName() */ -const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, +LLVM_FUNC_ABI const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen); /** @@ -1028,7 +1029,7 @@ const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, * * @see llvm::Module::getNamedMetadata() */ -unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name); +LLVM_FUNC_ABI unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name); /** * Obtain the named metadata operands for a module. @@ -1041,7 +1042,7 @@ unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name); * @see llvm::Module::getNamedMetadata() * @see llvm::MDNode::getOperand() */ -void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, +LLVM_FUNC_ABI void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest); /** @@ -1050,7 +1051,7 @@ void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, * @see llvm::Module::getNamedMetadata() * @see llvm::MDNode::addOperand() */ -void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, +LLVM_FUNC_ABI void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val); /** @@ -1061,7 +1062,7 @@ void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, * @see llvm::GlobalVariable::getDebugInfo() * @see llvm::Function::getSubprogram() */ -const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length); +LLVM_FUNC_ABI const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length); /** * Return the filename of the debug location for this value, which must be @@ -1071,7 +1072,7 @@ const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length); * @see llvm::GlobalVariable::getDebugInfo() * @see llvm::Function::getSubprogram() */ -const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length); +LLVM_FUNC_ABI const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length); /** * Return the line number of the debug location for this value, which must be @@ -1081,7 +1082,7 @@ const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length); * @see llvm::GlobalVariable::getDebugInfo() * @see llvm::Function::getSubprogram() */ -unsigned LLVMGetDebugLocLine(LLVMValueRef Val); +LLVM_FUNC_ABI unsigned LLVMGetDebugLocLine(LLVMValueRef Val); /** * Return the column number of the debug location for this value, which must be @@ -1089,14 +1090,14 @@ unsigned LLVMGetDebugLocLine(LLVMValueRef Val); * * @see llvm::Instruction::getDebugLoc() */ -unsigned LLVMGetDebugLocColumn(LLVMValueRef Val); +LLVM_FUNC_ABI unsigned LLVMGetDebugLocColumn(LLVMValueRef Val); /** * Add a function to a module under a specified name. * * @see llvm::Function::Create() */ -LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, +LLVM_FUNC_ABI LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy); /** @@ -1106,21 +1107,21 @@ LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, * * @see llvm::Module::getFunction() */ -LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name); /** * Obtain an iterator to the first Function in a Module. * * @see llvm::Module::begin() */ -LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M); /** * Obtain an iterator to the last Function in a Module. * * @see llvm::Module::end() */ -LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M); /** * Advance a Function iterator to the next Function. @@ -1128,7 +1129,7 @@ LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M); * Returns NULL if the iterator was already at the end and there are no more * functions. */ -LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn); /** * Decrement a Function iterator to the previous Function. @@ -1136,10 +1137,10 @@ LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn); * Returns NULL if the iterator was already at the beginning and there are * no previous functions. */ -LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn); /** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */ -void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm); +LLVM_FUNC_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm); /** * @} @@ -1179,7 +1180,7 @@ void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm); * * @see llvm::Type:getTypeID() */ -LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); /** * Whether the type has a known size. @@ -1188,21 +1189,21 @@ LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); * * @see llvm::Type::isSized() */ -LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty); /** * Obtain the context to which this type instance is associated. * * @see llvm::Type::getContext() */ -LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty); /** * Dump a representation of a type to stderr. * * @see llvm::Type::dump() */ -void LLVMDumpType(LLVMTypeRef Val); +LLVM_FUNC_ABI void LLVMDumpType(LLVMTypeRef Val); /** * Return a string representation of the type. Use @@ -1210,7 +1211,7 @@ void LLVMDumpType(LLVMTypeRef Val); * * @see llvm::Type::print() */ -char *LLVMPrintTypeToString(LLVMTypeRef Val); +LLVM_FUNC_ABI char *LLVMPrintTypeToString(LLVMTypeRef Val); /** * @defgroup LLVMCCoreTypeInt Integer Types @@ -1223,26 +1224,26 @@ char *LLVMPrintTypeToString(LLVMTypeRef Val); /** * Obtain an integer type from a context with specified bit width. */ -LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits); /** * Obtain an integer type from the global context with a specified bit * width. */ -LLVMTypeRef LLVMInt1Type(void); -LLVMTypeRef LLVMInt8Type(void); -LLVMTypeRef LLVMInt16Type(void); -LLVMTypeRef LLVMInt32Type(void); -LLVMTypeRef LLVMInt64Type(void); -LLVMTypeRef LLVMInt128Type(void); -LLVMTypeRef LLVMIntType(unsigned NumBits); -unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt1Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt8Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt16Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt32Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt64Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMInt128Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMIntType(unsigned NumBits); +LLVM_FUNC_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); /** * @} @@ -1257,51 +1258,51 @@ unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); /** * Obtain a 16-bit floating point type from a context. */ -LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C); /** * Obtain a 16-bit brain floating point type from a context. */ -LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C); /** * Obtain a 32-bit floating point type from a context. */ -LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C); /** * Obtain a 64-bit floating point type from a context. */ -LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C); /** * Obtain a 80-bit floating point type (X87) from a context. */ -LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C); /** * Obtain a 128-bit floating point type (112-bit mantissa) from a * context. */ -LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C); /** * Obtain a 128-bit floating point type (two 64-bits) from a context. */ -LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C); /** * Obtain a floating point type from the global context. * * These map to the functions in this group of the same name. */ -LLVMTypeRef LLVMHalfType(void); -LLVMTypeRef LLVMBFloatType(void); -LLVMTypeRef LLVMFloatType(void); -LLVMTypeRef LLVMDoubleType(void); -LLVMTypeRef LLVMX86FP80Type(void); -LLVMTypeRef LLVMFP128Type(void); -LLVMTypeRef LLVMPPCFP128Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMHalfType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMBFloatType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMFloatType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMDoubleType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86FP80Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMFP128Type(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMPPCFP128Type(void); /** * @} @@ -1319,24 +1320,24 @@ LLVMTypeRef LLVMPPCFP128Type(void); * The function is defined as a tuple of a return Type, a list of * parameter types, and whether the function is variadic. */ -LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, +LLVM_FUNC_ABI LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg); /** * Returns whether a function type is variadic. */ -LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); +LLVM_FUNC_ABI LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); /** * Obtain the Type this function Type returns. */ -LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy); /** * Obtain the number of parameters this function accepts. */ -unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); +LLVM_FUNC_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); /** * Obtain the types of a function's parameters. @@ -1349,7 +1350,7 @@ unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); * @param FunctionTy The function type to operate on. * @param Dest Memory address of an array to be filled with result. */ -void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); +LLVM_FUNC_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); /** * @} @@ -1373,7 +1374,7 @@ void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); * * @see llvm::StructType::create() */ -LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, +LLVM_FUNC_ABI LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed); /** @@ -1381,7 +1382,7 @@ LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, * * @see llvm::StructType::create() */ -LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, +LLVM_FUNC_ABI LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed); /** @@ -1389,21 +1390,21 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, * * @see llvm::StructType::create() */ -LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name); +LLVM_FUNC_ABI LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name); /** * Obtain the name of a structure. * * @see llvm::StructType::getName() */ -const char *LLVMGetStructName(LLVMTypeRef Ty); +LLVM_FUNC_ABI const char *LLVMGetStructName(LLVMTypeRef Ty); /** * Set the contents of a structure type. * * @see llvm::StructType::setBody() */ -void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, +LLVM_FUNC_ABI void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed); /** @@ -1411,7 +1412,7 @@ void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, * * @see llvm::StructType::getNumElements() */ -unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); +LLVM_FUNC_ABI unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); /** * Get the elements within a structure. @@ -1423,35 +1424,35 @@ unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); * of the structure type itself, which is the lifetime of the context it * is contained in. */ -void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); +LLVM_FUNC_ABI 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); +LLVM_FUNC_ABI LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i); /** * Determine whether a structure is packed. * * @see llvm::StructType::isPacked() */ -LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy); +LLVM_FUNC_ABI LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy); /** * Determine whether a structure is opaque. * * @see llvm::StructType::isOpaque() */ -LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy); +LLVM_FUNC_ABI LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy); /** * Determine whether a structure is literal. * * @see llvm::StructType::isLiteral() */ -LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy); +LLVM_FUNC_ABI LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy); /** * @} @@ -1471,21 +1472,21 @@ LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy); * * @see llvm::SequentialType::getElementType() */ -LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty); /** * Returns type's subtypes * * @see llvm::Type::subtypes() */ -void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr); +LLVM_FUNC_ABI void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr); /** * Return the number of types in the derived type. * * @see llvm::Type::getNumContainedTypes() */ -unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp); +LLVM_FUNC_ABI unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp); /** * Create a fixed size array type that refers to a specific type. @@ -1497,7 +1498,7 @@ unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp); * LLVMArrayType2 * @see llvm::ArrayType::get() */ -LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); +LLVM_FUNC_ABI LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); /** * Create a fixed size array type that refers to a specific type. @@ -1507,7 +1508,7 @@ LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); * * @see llvm::ArrayType::get() */ -LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount); +LLVM_FUNC_ABI LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount); /** * Obtain the length of an array type. @@ -1518,7 +1519,7 @@ LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount); * LLVMGetArrayLength2 * @see llvm::ArrayType::getNumElements() */ -unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); +LLVM_FUNC_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); /** * Obtain the length of an array type. @@ -1527,7 +1528,7 @@ unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); * * @see llvm::ArrayType::getNumElements() */ -uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy); +LLVM_FUNC_ABI uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy); /** * Create a pointer type that points to a defined type. @@ -1537,7 +1538,7 @@ uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy); * * @see llvm::PointerType::get() */ -LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace); +LLVM_FUNC_ABI LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace); /** * Determine whether a pointer is opaque. @@ -1546,14 +1547,14 @@ LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace); * * @see llvm::Type::isOpaquePointerTy() */ -LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty); /** * Create an opaque pointer type in a context. * * @see llvm::PointerType::get() */ -LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace); +LLVM_FUNC_ABI LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace); /** * Obtain the address space of a pointer type. @@ -1562,7 +1563,7 @@ LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace); * * @see llvm::PointerType::getAddressSpace() */ -unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy); +LLVM_FUNC_ABI unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy); /** * Create a vector type that contains a defined type and has a specific @@ -1573,7 +1574,7 @@ unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy); * * @see llvm::VectorType::get() */ -LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount); +LLVM_FUNC_ABI LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount); /** * Create a vector type that contains a defined type and has a scalable @@ -1584,7 +1585,7 @@ LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount); * * @see llvm::ScalableVectorType::get() */ -LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, +LLVM_FUNC_ABI LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, unsigned ElementCount); /** @@ -1594,7 +1595,7 @@ LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, * * @see llvm::VectorType::getNumElements() */ -unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); +LLVM_FUNC_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); /** * @} @@ -1609,46 +1610,46 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); /** * Create a void type in a context. */ -LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C); /** * Create a label type in a context. */ -LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C); /** * Create a X86 MMX type in a context. */ -LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C); /** * Create a X86 AMX type in a context. */ -LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C); /** * Create a token type in a context. */ -LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C); /** * Create a metadata type in a context. */ -LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C); /** * These are similar to the above functions except they operate on the * global context. */ -LLVMTypeRef LLVMVoidType(void); -LLVMTypeRef LLVMLabelType(void); -LLVMTypeRef LLVMX86MMXType(void); -LLVMTypeRef LLVMX86AMXType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMVoidType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMLabelType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86MMXType(void); +LLVM_FUNC_ABI LLVMTypeRef LLVMX86AMXType(void); /** * Create a target extension type in LLVM context. */ -LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, +LLVM_FUNC_ABI LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams, unsigned TypeParamCount, unsigned *IntParams, @@ -1788,35 +1789,35 @@ LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, * * @see llvm::Value::getType() */ -LLVMTypeRef LLVMTypeOf(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMTypeRef LLVMTypeOf(LLVMValueRef Val); /** * Obtain the enumerated type of a Value instance. * * @see llvm::Value::getValueID() */ -LLVMValueKind LLVMGetValueKind(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMValueKind LLVMGetValueKind(LLVMValueRef Val); /** * Obtain the string name of a value. * * @see llvm::Value::getName() */ -const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length); +LLVM_FUNC_ABI const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length); /** * Set the string name of a value. * * @see llvm::Value::setName() */ -void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen); +LLVM_FUNC_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen); /** * Dump a representation of a value to stderr. * * @see llvm::Value::dump() */ -void LLVMDumpValue(LLVMValueRef Val); +LLVM_FUNC_ABI void LLVMDumpValue(LLVMValueRef Val); /** * Return a string representation of the value. Use @@ -1824,29 +1825,29 @@ void LLVMDumpValue(LLVMValueRef Val); * * @see llvm::Value::print() */ -char *LLVMPrintValueToString(LLVMValueRef Val); +LLVM_FUNC_ABI char *LLVMPrintValueToString(LLVMValueRef Val); /** * Replace all uses of a value with another one. * * @see llvm::Value::replaceAllUsesWith() */ -void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal); +LLVM_FUNC_ABI void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal); /** * Determine whether the specified value instance is constant. */ -LLVMBool LLVMIsConstant(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBool LLVMIsConstant(LLVMValueRef Val); /** * Determine whether a value instance is undefined. */ -LLVMBool LLVMIsUndef(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBool LLVMIsUndef(LLVMValueRef Val); /** * Determine whether a value instance is poisonous. */ -LLVMBool LLVMIsPoison(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val); /** * Convert value instances between types. @@ -1860,17 +1861,17 @@ LLVMBool LLVMIsPoison(LLVMValueRef Val); * @see llvm::dyn_cast_or_null<> */ #define LLVM_DECLARE_VALUE_CAST(name) \ - LLVMValueRef LLVMIsA##name(LLVMValueRef Val); -LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST) + LLVM_FUNC_ABI LLVMValueRef LLVMIsA##name(LLVMValueRef Val); +LLVM_FUNC_ABI LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST) -LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val); -LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val); -LLVMValueRef LLVMIsAMDString(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMValueRef LLVMIsAMDString(LLVMValueRef Val); /** Deprecated: Use LLVMGetValueName2 instead. */ -const char *LLVMGetValueName(LLVMValueRef Val); +LLVM_FUNC_ABI const char *LLVMGetValueName(LLVMValueRef Val); /** Deprecated: Use LLVMSetValueName2 instead. */ -void LLVMSetValueName(LLVMValueRef Val, const char *Name); +LLVM_FUNC_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name); /** * @} @@ -1899,7 +1900,7 @@ void LLVMSetValueName(LLVMValueRef Val, const char *Name); * * @see llvm::Value::use_begin() */ -LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val); /** * Obtain the next use of a value. @@ -1907,7 +1908,7 @@ LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val); * This effectively advances the iterator. It returns NULL if you are on * the final use and no more are available. */ -LLVMUseRef LLVMGetNextUse(LLVMUseRef U); +LLVM_FUNC_ABI LLVMUseRef LLVMGetNextUse(LLVMUseRef U); /** * Obtain the user value for a user. @@ -1916,14 +1917,14 @@ LLVMUseRef LLVMGetNextUse(LLVMUseRef U); * * @see llvm::Use::getUser() */ -LLVMValueRef LLVMGetUser(LLVMUseRef U); +LLVM_FUNC_ABI LLVMValueRef LLVMGetUser(LLVMUseRef U); /** * Obtain the value this use corresponds to. * * @see llvm::Use::get(). */ -LLVMValueRef LLVMGetUsedValue(LLVMUseRef U); +LLVM_FUNC_ABI LLVMValueRef LLVMGetUsedValue(LLVMUseRef U); /** * @} @@ -1944,28 +1945,28 @@ LLVMValueRef LLVMGetUsedValue(LLVMUseRef U); * * @see llvm::User::getOperand() */ -LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index); +LLVM_FUNC_ABI LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index); /** * Obtain the use of an operand at a specific index in a llvm::User value. * * @see llvm::User::getOperandUse() */ -LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index); +LLVM_FUNC_ABI LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index); /** * Set an operand at a specific index in a llvm::User value. * * @see llvm::User::setOperand() */ -void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val); +LLVM_FUNC_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val); /** * Obtain the number of operands in a llvm::User value. * * @see llvm::User::getNumOperands() */ -int LLVMGetNumOperands(LLVMValueRef Val); +LLVM_FUNC_ABI int LLVMGetNumOperands(LLVMValueRef Val); /** * @} @@ -1988,7 +1989,7 @@ int LLVMGetNumOperands(LLVMValueRef Val); * * @see llvm::Constant::getNullValue() */ -LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */ +LLVM_FUNC_ABI LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */ /** * Obtain a constant value referring to the instance of a type @@ -1998,34 +1999,34 @@ LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */ * * @see llvm::Constant::getAllOnesValue() */ -LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); /** * Obtain a constant value referring to an undefined value of a type. * * @see llvm::UndefValue::get() */ -LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty); /** * Obtain a constant value referring to a poison value of a type. * * @see llvm::PoisonValue::get() */ -LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty); /** * Determine whether a value instance is null. * * @see llvm::Constant::isNullValue() */ -LLVMBool LLVMIsNull(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBool LLVMIsNull(LLVMValueRef Val); /** * Obtain a constant that is a constant pointer pointing to NULL for a * specified type. */ -LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty); /** * @defgroup LLVMCCoreValueConstantScalar Scalar constants @@ -2054,7 +2055,7 @@ LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty); * @param N The value the returned instance should refer to. * @param SignExtend Whether to sign extend the produced value. */ -LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, +LLVM_FUNC_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend); /** @@ -2062,7 +2063,7 @@ LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, * * @see llvm::ConstantInt::get() */ -LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, +LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[]); @@ -2075,7 +2076,7 @@ LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, * * @see llvm::ConstantInt::get() */ -LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, +LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, uint8_t Radix); /** @@ -2084,13 +2085,13 @@ LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, * * @see llvm::ConstantInt::get() */ -LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text, +LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text, unsigned SLen, uint8_t Radix); /** * Obtain a constant value referring to a double floating point value. */ -LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N); +LLVM_FUNC_ABI LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N); /** * Obtain a constant for a floating point value parsed from a string. @@ -2098,12 +2099,12 @@ LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N); * A similar API, LLVMConstRealOfStringAndSize is also available. It * should be used if the input string's length is known. */ -LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text); +LLVM_FUNC_ABI LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text); /** * Obtain a constant for a floating point value parsed from a string. */ -LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, +LLVM_FUNC_ABI LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, unsigned SLen); /** @@ -2111,14 +2112,14 @@ LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, * * @see llvm::ConstantInt::getZExtValue() */ -unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal); /** * Obtain the sign extended value for an integer constant value. * * @see llvm::ConstantInt::getSExtValue() */ -long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal); /** * Obtain the double value for an floating point constant value. @@ -2126,7 +2127,7 @@ long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal); * * @see llvm::ConstantFP::getDoubleValue */ -double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo); +LLVM_FUNC_ABI double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo); /** * @} @@ -2145,7 +2146,7 @@ double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo); * * @see llvm::ConstantDataArray::getString() */ -LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, +LLVM_FUNC_ABI LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate); /** @@ -2157,7 +2158,7 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, * @see LLVMConstStringInContext() * @see llvm::ConstantDataArray::getString() */ -LLVMValueRef LLVMConstString(const char *Str, unsigned Length, +LLVM_FUNC_ABI LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate); /** @@ -2165,21 +2166,21 @@ LLVMValueRef LLVMConstString(const char *Str, unsigned Length, * * @see ConstantDataSequential::getAsString() */ -LLVMBool LLVMIsConstantString(LLVMValueRef c); +LLVM_FUNC_ABI LLVMBool LLVMIsConstantString(LLVMValueRef c); /** * Get the given constant data sequential as a string. * * @see ConstantDataSequential::getAsString() */ -const char *LLVMGetAsString(LLVMValueRef c, size_t *Length); +LLVM_FUNC_ABI const char *LLVMGetAsString(LLVMValueRef c, size_t *Length); /** * Create an anonymous ConstantStruct with the specified values. * * @see llvm::ConstantStruct::getAnon() */ -LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, +LLVM_FUNC_ABI LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed); @@ -2191,7 +2192,7 @@ LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, * * @see LLVMConstStructInContext() */ -LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, +LLVM_FUNC_ABI LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed); /** @@ -2201,7 +2202,7 @@ LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, * LLVMConstArray2 * @see llvm::ConstantArray::get() */ -LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, +LLVM_FUNC_ABI LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length); /** @@ -2209,7 +2210,7 @@ LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, * * @see llvm::ConstantArray::get() */ -LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, +LLVM_FUNC_ABI LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length); /** @@ -2217,7 +2218,7 @@ LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, * * @see llvm::ConstantStruct::get() */ -LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, +LLVM_FUNC_ABI LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count); @@ -2229,14 +2230,14 @@ LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, * * @see llvm::Constant::getAggregateElement() */ -LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx); +LLVM_FUNC_ABI LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx); /** * Get an element at specified index as a constant. * * @see ConstantDataSequential::getElementAsConstant() */ -LLVM_ATTRIBUTE_C_DEPRECATED( +LLVM_FUNC_ABI LLVM_ATTRIBUTE_C_DEPRECATED( LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx), "Use LLVMGetAggregateElement instead"); @@ -2245,7 +2246,7 @@ LLVM_ATTRIBUTE_C_DEPRECATED( * * @see llvm::ConstantVector::get() */ -LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size); +LLVM_FUNC_ABI LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size); /** * @} @@ -2260,56 +2261,56 @@ LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size); * * @{ */ -LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal); -LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty); -LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty); -LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal); -LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal); -LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal); -LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal); -LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, +LLVM_FUNC_ABI LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, +LLVM_FUNC_ABI LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); -LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, +LLVM_FUNC_ABI LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVM_FUNC_ABI LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices); -LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, +LLVM_FUNC_ABI LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices); -LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, +LLVM_FUNC_ABI LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVM_FUNC_ABI LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVM_FUNC_ABI LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVM_FUNC_ABI LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVM_FUNC_ABI LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVM_FUNC_ABI LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, +LLVM_FUNC_ABI LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); -LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, +LLVM_FUNC_ABI LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant); -LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, +LLVM_FUNC_ABI LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant); -LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, +LLVM_FUNC_ABI LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant); -LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB); /** Deprecated: Use LLVMGetInlineAsm instead. */ -LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack); @@ -2328,18 +2329,18 @@ LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, * @{ */ -LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); -LLVMBool LLVMIsDeclaration(LLVMValueRef Global); -LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); -void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage); -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); -LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global); -void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr); +LLVM_FUNC_ABI LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); +LLVM_FUNC_ABI LLVMBool LLVMIsDeclaration(LLVMValueRef Global); +LLVM_FUNC_ABI LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage); +LLVM_FUNC_ABI const char *LLVMGetSection(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section); +LLVM_FUNC_ABI LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); +LLVM_FUNC_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class); +LLVM_FUNC_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr); /** * Returns the "value type" of a global value. This differs from the formal @@ -2347,12 +2348,12 @@ void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr); * * @see llvm::GlobalValue::getValueType() */ -LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global); +LLVM_FUNC_ABI LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global); /** Deprecated: Use LLVMGetUnnamedAddress instead. */ -LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global); +LLVM_FUNC_ABI LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global); /** Deprecated: Use LLVMSetUnnamedAddress instead. */ -void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr); +LLVM_FUNC_ABI void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr); /** * @defgroup LLVMCCoreValueWithAlignment Values with alignment @@ -2370,7 +2371,7 @@ void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr); * @see llvm::AtomicCmpXchgInst::setAlignment() * @see llvm::GlobalValue::getAlignment() */ -unsigned LLVMGetAlignment(LLVMValueRef V); +LLVM_FUNC_ABI unsigned LLVMGetAlignment(LLVMValueRef V); /** * Set the preferred alignment of the value. @@ -2381,7 +2382,7 @@ unsigned LLVMGetAlignment(LLVMValueRef V); * @see llvm::AtomicCmpXchgInst::setAlignment() * @see llvm::GlobalValue::setAlignment() */ -void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes); +LLVM_FUNC_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes); /** * Sets a metadata attachment, erasing the existing metadata attachment if @@ -2389,7 +2390,7 @@ void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes); * * @see llvm::GlobalObject::setMetadata() */ -void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, +LLVM_FUNC_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD); /** @@ -2397,14 +2398,14 @@ void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, * * @see llvm::GlobalObject::eraseMetadata() */ -void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind); +LLVM_FUNC_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind); /** * Removes all metadata attachments from this value. * * @see llvm::GlobalObject::clearMetadata() */ -void LLVMGlobalClearMetadata(LLVMValueRef Global); +LLVM_FUNC_ABI void LLVMGlobalClearMetadata(LLVMValueRef Global); /** * Retrieves an array of metadata entries representing the metadata attached to @@ -2413,25 +2414,25 @@ void LLVMGlobalClearMetadata(LLVMValueRef Global); * * @see llvm::GlobalObject::getAllMetadata() */ -LLVMValueMetadataEntry *LLVMGlobalCopyAllMetadata(LLVMValueRef Value, +LLVM_FUNC_ABI LLVMValueMetadataEntry *LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries); /** * Destroys value metadata entries. */ -void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries); +LLVM_FUNC_ABI void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries); /** * Returns the kind of a value metadata entry at a specific index. */ -unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, +LLVM_FUNC_ABI unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index); /** * Returns the underlying metadata node of a value metadata entry at a * specific index. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index); @@ -2448,26 +2449,26 @@ LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, * * @{ */ -LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name); -LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace); -LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name); -LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M); -LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M); -LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar); -LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar); -void LLVMDeleteGlobal(LLVMValueRef GlobalVar); -LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); -void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); -LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar); -void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal); -LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); -void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant); -LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar); -void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode); -LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); -void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMDeleteGlobal(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); +LLVM_FUNC_ABI LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal); +LLVM_FUNC_ABI LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant); +LLVM_FUNC_ABI LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode); +LLVM_FUNC_ABI LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); +LLVM_FUNC_ABI void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); /** * @} @@ -2488,7 +2489,7 @@ void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); * * @see llvm::GlobalAlias::create() */ -LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy, +LLVM_FUNC_ABI LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy, unsigned AddrSpace, LLVMValueRef Aliasee, const char *Name); @@ -2499,7 +2500,7 @@ LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy, * * @see llvm::Module::getNamedAlias() */ -LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen); /** @@ -2507,14 +2508,14 @@ LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, * * @see llvm::Module::alias_begin() */ -LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M); /** * Obtain an iterator to the last GlobalAlias in a Module. * * @see llvm::Module::alias_end() */ -LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M); /** * Advance a GlobalAlias iterator to the next GlobalAlias. @@ -2522,7 +2523,7 @@ LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M); * Returns NULL if the iterator was already at the end and there are no more * global aliases. */ -LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA); /** * Decrement a GlobalAlias iterator to the previous GlobalAlias. @@ -2530,17 +2531,17 @@ LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA); * Returns NULL if the iterator was already at the beginning and there are * no previous global aliases. */ -LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA); /** * Retrieve the target value of an alias. */ -LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias); +LLVM_FUNC_ABI LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias); /** * Set the target value of an alias. */ -void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee); +LLVM_FUNC_ABI void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee); /** * @} @@ -2562,42 +2563,42 @@ void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee); * * @see llvm::Function::eraseFromParent() */ -void LLVMDeleteFunction(LLVMValueRef Fn); +LLVM_FUNC_ABI void LLVMDeleteFunction(LLVMValueRef Fn); /** * Check whether the given function has a personality function. * * @see llvm::Function::hasPersonalityFn() */ -LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn); /** * Obtain the personality function attached to the function. * * @see llvm::Function::getPersonalityFn() */ -LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn); /** * Set the personality function attached to the function. * * @see llvm::Function::setPersonalityFn() */ -void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn); +LLVM_FUNC_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn); /** * Obtain the intrinsic ID number which matches the given function name. * * @see llvm::Function::lookupIntrinsicID() */ -unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen); +LLVM_FUNC_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen); /** * Obtain the ID number from a function instance. * * @see llvm::Function::getIntrinsicID() */ -unsigned LLVMGetIntrinsicID(LLVMValueRef Fn); +LLVM_FUNC_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn); /** * Create or insert the declaration of an intrinsic. For overloaded intrinsics, @@ -2605,7 +2606,7 @@ unsigned LLVMGetIntrinsicID(LLVMValueRef Fn); * * @see llvm::Intrinsic::getDeclaration() */ -LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, +LLVM_FUNC_ABI LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount); @@ -2616,7 +2617,7 @@ LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, * * @see llvm::Intrinsic::getType() */ -LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, +LLVM_FUNC_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount); /** @@ -2624,10 +2625,10 @@ LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, * * @see llvm::Intrinsic::getName() */ -const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength); +LLVM_FUNC_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength); /** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */ -const char *LLVMIntrinsicCopyOverloadedName(unsigned ID, +LLVM_FUNC_ABI const char *LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength); @@ -2643,7 +2644,7 @@ const char *LLVMIntrinsicCopyOverloadedName(unsigned ID, * * @see llvm::Intrinsic::getName() */ -const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID, +LLVM_FUNC_ABI const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength); @@ -2653,7 +2654,7 @@ const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID, * * @see llvm::Intrinsic::isOverloaded() */ -LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID); +LLVM_FUNC_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID); /** * Obtain the calling function of a function. @@ -2662,7 +2663,7 @@ LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID); * * @see llvm::Function::getCallingConv() */ -unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn); +LLVM_FUNC_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn); /** * Set the calling convention of a function. @@ -2672,7 +2673,7 @@ unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn); * @param Fn Function to operate on * @param CC LLVMCallConv to set calling convention to */ -void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC); +LLVM_FUNC_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC); /** * Obtain the name of the garbage collector to use during code @@ -2680,41 +2681,41 @@ void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC); * * @see llvm::Function::getGC() */ -const char *LLVMGetGC(LLVMValueRef Fn); +LLVM_FUNC_ABI const char *LLVMGetGC(LLVMValueRef Fn); /** * Define the garbage collector to use during code generation. * * @see llvm::Function::setGC() */ -void LLVMSetGC(LLVMValueRef Fn, const char *Name); +LLVM_FUNC_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name); /** * Add an attribute to a function. * * @see llvm::Function::addAttribute() */ -void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A); -unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx); -void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx); +LLVM_FUNC_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs); -LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, +LLVM_FUNC_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID); -LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, +LLVM_FUNC_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen); -void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID); -void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen); /** * Add a target-dependent attribute to a function * @see llvm::AttrBuilder::addAttribute() */ -void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, +LLVM_FUNC_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V); /** @@ -2733,7 +2734,7 @@ void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, * * @see llvm::Function::arg_size() */ -unsigned LLVMCountParams(LLVMValueRef Fn); +LLVM_FUNC_ABI unsigned LLVMCountParams(LLVMValueRef Fn); /** * Obtain the parameters in a function. @@ -2746,7 +2747,7 @@ unsigned LLVMCountParams(LLVMValueRef Fn); * * @see llvm::Function::arg_begin() */ -void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); +LLVM_FUNC_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); /** * Obtain the parameter at the specified index. @@ -2755,7 +2756,7 @@ void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); * * @see llvm::Function::arg_begin() */ -LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index); +LLVM_FUNC_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index); /** * Obtain the function to which this argument belongs. @@ -2766,21 +2767,21 @@ LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index); * The returned LLVMValueRef is the llvm::Function to which this * argument belongs. */ -LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst); /** * Obtain the first parameter to a function. * * @see llvm::Function::arg_begin() */ -LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn); /** * Obtain the last parameter to a function. * * @see llvm::Function::arg_end() */ -LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn); /** * Obtain the next parameter to a function. @@ -2789,14 +2790,14 @@ LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn); * actually a wrapped iterator) and obtains the next parameter from the * underlying iterator. */ -LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg); /** * Obtain the previous parameter to a function. * * This is the opposite of LLVMGetNextParam(). */ -LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg); /** * Set the alignment for a function parameter. @@ -2804,7 +2805,7 @@ LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg); * @see llvm::Argument::addAttr() * @see llvm::AttrBuilder::addAlignmentAttr() */ -void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align); +LLVM_FUNC_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align); /** * @} @@ -2826,7 +2827,7 @@ void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align); * * @see llvm::GlobalIFunc::create() */ -LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty, unsigned AddrSpace, LLVMValueRef Resolver); @@ -2838,7 +2839,7 @@ LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M, * * @see llvm::Module::getNamedIFunc() */ -LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, +LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen); /** @@ -2846,14 +2847,14 @@ LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, * * @see llvm::Module::ifunc_begin() */ -LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M); /** * Obtain an iterator to the last GlobalIFunc in a Module. * * @see llvm::Module::ifunc_end() */ -LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M); /** * Advance a GlobalIFunc iterator to the next GlobalIFunc. @@ -2861,7 +2862,7 @@ LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M); * Returns NULL if the iterator was already at the end and there are no more * global aliases. */ -LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc); /** * Decrement a GlobalIFunc iterator to the previous GlobalIFunc. @@ -2869,7 +2870,7 @@ LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc); * Returns NULL if the iterator was already at the beginning and there are * no previous global aliases. */ -LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc); /** * Retrieves the resolver function associated with this indirect function, or @@ -2877,21 +2878,21 @@ LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc); * * @see llvm::GlobalIFunc::getResolver() */ -LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc); +LLVM_FUNC_ABI LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc); /** * Sets the resolver function associated with this indirect function. * * @see llvm::GlobalIFunc::setResolver() */ -void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver); +LLVM_FUNC_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver); /** * Remove a global indirect function from its parent module and delete it. * * @see llvm::GlobalIFunc::eraseFromParent() */ -void LLVMEraseGlobalIFunc(LLVMValueRef IFunc); +LLVM_FUNC_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc); /** * Remove a global indirect function from its parent module. @@ -2901,7 +2902,7 @@ void LLVMEraseGlobalIFunc(LLVMValueRef IFunc); * * @see llvm::GlobalIFunc::removeFromParent() */ -void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc); +LLVM_FUNC_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc); /** * @} @@ -2933,7 +2934,7 @@ void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc); * * @see llvm::MDString::get() */ -LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, +LLVM_FUNC_ABI LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen); /** @@ -2941,18 +2942,18 @@ LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, * * @see llvm::MDNode::get() */ -LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, +LLVM_FUNC_ABI LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count); /** * Obtain a Metadata as a Value. */ -LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD); +LLVM_FUNC_ABI LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD); /** * Obtain a Value as a Metadata. */ -LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val); /** * Obtain the underlying string from a MDString value. @@ -2961,7 +2962,7 @@ LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val); * @param Length Memory address which will hold length of returned string. * @return String data in MDString. */ -const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length); +LLVM_FUNC_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length); /** * Obtain the number of operands from an MDNode value. @@ -2969,7 +2970,7 @@ const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length); * @param V MDNode to get number of operands from. * @return Number of operands of the MDNode. */ -unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V); +LLVM_FUNC_ABI unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V); /** * Obtain the given MDNode's operands. @@ -2982,26 +2983,26 @@ unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V); * @param V MDNode to get the operands from. * @param Dest Destination array for operands. */ -void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest); +LLVM_FUNC_ABI void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest); /** * Replace an operand at a specific index in a llvm::MDNode value. * * @see llvm::MDNode::replaceOperandWith() */ -void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, +LLVM_FUNC_ABI void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement); /** Deprecated: Use LLVMMDStringInContext2 instead. */ -LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, +LLVM_FUNC_ABI LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen); /** Deprecated: Use LLVMMDStringInContext2 instead. */ -LLVMValueRef LLVMMDString(const char *Str, unsigned SLen); +LLVM_FUNC_ABI LLVMValueRef LLVMMDString(const char *Str, unsigned SLen); /** Deprecated: Use LLVMMDNodeInContext2 instead. */ -LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, +LLVM_FUNC_ABI LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count); /** Deprecated: Use LLVMMDNodeInContext2 instead. */ -LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count); +LLVM_FUNC_ABI LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count); /** * @} @@ -3027,29 +3028,29 @@ LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count); /** * Convert a basic block instance to a value type. */ -LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); /** * Determine whether an LLVMValueRef is itself a basic block. */ -LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val); /** * Convert an LLVMValueRef to an LLVMBasicBlockRef instance. */ -LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); /** * Obtain the string name of a basic block. */ -const char *LLVMGetBasicBlockName(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI const char *LLVMGetBasicBlockName(LLVMBasicBlockRef BB); /** * Obtain the function to which a basic block belongs. * * @see llvm::BasicBlock::getParent() */ -LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB); /** * Obtain the terminator instruction for a basic block. @@ -3061,14 +3062,14 @@ LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB); * * @see llvm::BasicBlock::getTerminator() */ -LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB); /** * Obtain the number of basic blocks in a function. * * @param Fn Function value to operate on. */ -unsigned LLVMCountBasicBlocks(LLVMValueRef Fn); +LLVM_FUNC_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn); /** * Obtain all of the basic blocks in a function. @@ -3078,7 +3079,7 @@ unsigned LLVMCountBasicBlocks(LLVMValueRef Fn); * LLVMCountBasicBlocks() in length. This array is populated with * LLVMBasicBlockRef instances. */ -void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks); +LLVM_FUNC_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks); /** * Obtain the first basic block in a function. @@ -3088,24 +3089,24 @@ void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks); * * @see llvm::Function::begin() */ -LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn); /** * Obtain the last basic block in a function. * * @see llvm::Function::end() */ -LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn); /** * Advance a basic block iterator. */ -LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB); /** * Go backwards in a basic block iterator. */ -LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB); /** * Obtain the basic block that corresponds to the entry point of a @@ -3113,7 +3114,7 @@ LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB); * * @see llvm::Function::getEntryBlock() */ -LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); /** * Insert the given basic block after the insertion point of the given builder. @@ -3122,7 +3123,7 @@ LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); * * @see llvm::Function::BasicBlockListType::insertAfter() */ -void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, +LLVM_FUNC_ABI void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB); /** @@ -3130,7 +3131,7 @@ void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, * * @see llvm::Function::BasicBlockListType::push_back() */ -void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, +LLVM_FUNC_ABI void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB); /** @@ -3138,7 +3139,7 @@ void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, * * @see llvm::BasicBlock::Create() */ -LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name); /** @@ -3146,7 +3147,7 @@ LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, * * @see llvm::BasicBlock::Create() */ -LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name); @@ -3156,7 +3157,7 @@ LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, * * @see llvm::BasicBlock::Create() */ -LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name); /** * Insert a basic block in a function before another basic block. @@ -3166,7 +3167,7 @@ LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name); * * @see llvm::BasicBlock::Create() */ -LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name); @@ -3175,7 +3176,7 @@ LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, * * @see llvm::BasicBlock::Create() */ -LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name); /** @@ -3186,7 +3187,7 @@ LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, * * @see llvm::BasicBlock::eraseFromParent() */ -void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB); /** * Remove a basic block from a function. @@ -3196,21 +3197,21 @@ void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB); * * @see llvm::BasicBlock::removeFromParent() */ -void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB); /** * Move a basic block to before another one. * * @see llvm::BasicBlock::moveBefore() */ -void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos); +LLVM_FUNC_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos); /** * Move a basic block to after another one. * * @see llvm::BasicBlock::moveAfter() */ -void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos); +LLVM_FUNC_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos); /** * Obtain the first instruction in a basic block. @@ -3218,14 +3219,14 @@ void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos); * The returned LLVMValueRef corresponds to a llvm::Instruction * instance. */ -LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB); /** * Obtain the last instruction in a basic block. * * The returned LLVMValueRef corresponds to an LLVM:Instruction. */ -LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); +LLVM_FUNC_ABI LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); /** * @} @@ -3251,17 +3252,17 @@ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); /** * Determine whether an instruction has any metadata attached. */ -int LLVMHasMetadata(LLVMValueRef Val); +LLVM_FUNC_ABI int LLVMHasMetadata(LLVMValueRef Val); /** * Return metadata associated with an instruction value. */ -LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID); +LLVM_FUNC_ABI LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID); /** * Set metadata associated with an instruction value. */ -void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node); +LLVM_FUNC_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node); /** * Returns the metadata associated with an instruction value, but filters out @@ -3269,7 +3270,7 @@ void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node); * * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc() */ -LLVMValueMetadataEntry * +LLVM_FUNC_ABI LLVMValueMetadataEntry * LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr, size_t *NumEntries); @@ -3278,7 +3279,7 @@ LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr, * * @see llvm::Instruction::getParent() */ -LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst); /** * Obtain the instruction that occurs after the one specified. @@ -3288,7 +3289,7 @@ LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst); * If this is the last instruction in a basic block, NULL will be * returned. */ -LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); /** * Obtain the instruction that occurred before this one. @@ -3296,7 +3297,7 @@ LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); * If the instruction is the first instruction in a basic block, NULL * will be returned. */ -LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst); /** * Remove an instruction. @@ -3306,7 +3307,7 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst); * * @see llvm::Instruction::removeFromParent() */ -void LLVMInstructionRemoveFromParent(LLVMValueRef Inst); +LLVM_FUNC_ABI void LLVMInstructionRemoveFromParent(LLVMValueRef Inst); /** * Remove and delete an instruction. @@ -3316,7 +3317,7 @@ void LLVMInstructionRemoveFromParent(LLVMValueRef Inst); * * @see llvm::Instruction::eraseFromParent() */ -void LLVMInstructionEraseFromParent(LLVMValueRef Inst); +LLVM_FUNC_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst); /** * Delete an instruction. @@ -3326,14 +3327,14 @@ void LLVMInstructionEraseFromParent(LLVMValueRef Inst); * * @see llvm::Value::deleteValue() */ -void LLVMDeleteInstruction(LLVMValueRef Inst); +LLVM_FUNC_ABI void LLVMDeleteInstruction(LLVMValueRef Inst); /** * Obtain the code opcode for an individual instruction. * * @see llvm::Instruction::getOpCode() */ -LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst); /** * Obtain the predicate of an instruction. @@ -3343,7 +3344,7 @@ LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst); * * @see llvm::ICmpInst::getPredicate() */ -LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst); /** * Obtain the float predicate of an instruction. @@ -3353,7 +3354,7 @@ LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst); * * @see llvm::FCmpInst::getPredicate() */ -LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst); /** * Create a copy of 'this' instruction that is identical in all ways @@ -3363,7 +3364,7 @@ LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst); * * @see llvm::Instruction::clone() */ -LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst); /** * Determine whether an instruction is a terminator. This routine is named to @@ -3372,7 +3373,7 @@ LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst); * * @see llvm::Instruction::isTerminator() */ -LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst); /** * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations @@ -3394,7 +3395,7 @@ LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst); * @see llvm::InvokeInst::getNumArgOperands() * @see llvm::FuncletPadInst::getNumArgOperands() */ -unsigned LLVMGetNumArgOperands(LLVMValueRef Instr); +LLVM_FUNC_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr); /** * Set the calling convention for a call instruction. @@ -3405,7 +3406,7 @@ unsigned LLVMGetNumArgOperands(LLVMValueRef Instr); * @see llvm::CallInst::setCallingConv() * @see llvm::InvokeInst::setCallingConv() */ -void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); +LLVM_FUNC_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); /** * Obtain the calling convention for a call instruction. @@ -3415,25 +3416,25 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); * * @see LLVMSetInstructionCallConv() */ -unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr); +LLVM_FUNC_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr); -void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align); -void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A); -unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx); -void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx); +LLVM_FUNC_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs); -LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, +LLVM_FUNC_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID); -LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, +LLVM_FUNC_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen); -void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID); -void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, +LLVM_FUNC_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen); /** @@ -3441,7 +3442,7 @@ void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, * * @see llvm::CallBase::getFunctionType() */ -LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C); /** * Obtain the pointer to the function invoked by this instruction. @@ -3452,7 +3453,7 @@ LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C); * @see llvm::CallInst::getCalledOperand() * @see llvm::InvokeInst::getCalledOperand() */ -LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr); +LLVM_FUNC_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr); /** * Obtain whether a call instruction is a tail call. @@ -3461,7 +3462,7 @@ LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr); * * @see llvm::CallInst::isTailCall() */ -LLVMBool LLVMIsTailCall(LLVMValueRef CallInst); +LLVM_FUNC_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst); /** * Set whether a call instruction is a tail call. @@ -3470,21 +3471,21 @@ LLVMBool LLVMIsTailCall(LLVMValueRef CallInst); * * @see llvm::CallInst::setTailCall() */ -void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall); +LLVM_FUNC_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall); /** * Obtain a tail call kind of the call instruction. * * @see llvm::CallInst::setTailCallKind() */ -LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst); +LLVM_FUNC_ABI LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst); /** * Set the call kind of the call instruction. * * @see llvm::CallInst::getTailCallKind() */ -void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind); +LLVM_FUNC_ABI void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind); /** * Return the normal destination basic block. @@ -3493,7 +3494,7 @@ void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind); * * @see llvm::InvokeInst::getNormalDest() */ -LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst); /** * Return the unwind destination basic block. @@ -3505,7 +3506,7 @@ LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst); * @see llvm::CleanupReturnInst::getUnwindDest() * @see llvm::CatchSwitchInst::getUnwindDest() */ -LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst); /** * Set the normal destination basic block. @@ -3514,7 +3515,7 @@ LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst); * * @see llvm::InvokeInst::setNormalDest() */ -void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); +LLVM_FUNC_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); /** * Set the unwind destination basic block. @@ -3526,7 +3527,7 @@ void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); * @see llvm::CleanupReturnInst::setUnwindDest() * @see llvm::CatchSwitchInst::setUnwindDest() */ -void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); +LLVM_FUNC_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); /** * @} @@ -3546,21 +3547,21 @@ void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B); * * @see llvm::Instruction::getNumSuccessors */ -unsigned LLVMGetNumSuccessors(LLVMValueRef Term); +LLVM_FUNC_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term); /** * Return the specified successor. * * @see llvm::Instruction::getSuccessor */ -LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i); /** * Update the specified successor to point at the provided block. * * @see llvm::Instruction::setSuccessor */ -void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block); +LLVM_FUNC_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block); /** * Return if a branch is conditional. @@ -3569,7 +3570,7 @@ void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block); * * @see llvm::BranchInst::isConditional */ -LLVMBool LLVMIsConditional(LLVMValueRef Branch); +LLVM_FUNC_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch); /** * Return the condition of a branch instruction. @@ -3578,7 +3579,7 @@ LLVMBool LLVMIsConditional(LLVMValueRef Branch); * * @see llvm::BranchInst::getCondition */ -LLVMValueRef LLVMGetCondition(LLVMValueRef Branch); +LLVM_FUNC_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch); /** * Set the condition of a branch instruction. @@ -3587,7 +3588,7 @@ LLVMValueRef LLVMGetCondition(LLVMValueRef Branch); * * @see llvm::BranchInst::setCondition */ -void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond); +LLVM_FUNC_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond); /** * Obtain the default destination basic block of a switch instruction. @@ -3596,7 +3597,7 @@ void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond); * * @see llvm::SwitchInst::getDefaultDest() */ -LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr); /** * @} @@ -3614,7 +3615,7 @@ LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr); /** * Obtain the type that is being allocated by the alloca instruction. */ -LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca); /** * @} @@ -3632,17 +3633,17 @@ LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca); /** * Check whether the given GEP operator is inbounds. */ -LLVMBool LLVMIsInBounds(LLVMValueRef GEP); +LLVM_FUNC_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP); /** * Set the given GEP instruction to be inbounds or not. */ -void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds); +LLVM_FUNC_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds); /** * Get the source element type of the given GEP operator. */ -LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP); +LLVM_FUNC_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP); /** * @} @@ -3660,23 +3661,23 @@ LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP); /** * Add an incoming value to the end of a PHI list. */ -void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, +LLVM_FUNC_ABI void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count); /** * Obtain the number of incoming basic blocks to a PHI node. */ -unsigned LLVMCountIncoming(LLVMValueRef PhiNode); +LLVM_FUNC_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode); /** * Obtain an incoming value to a PHI node as an LLVMValueRef. */ -LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index); +LLVM_FUNC_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index); /** * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef. */ -LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); /** * @} @@ -3696,12 +3697,12 @@ LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); * Obtain the number of indices. * NB: This also works on GEP operators. */ -unsigned LLVMGetNumIndices(LLVMValueRef Inst); +LLVM_FUNC_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst); /** * Obtain the indices as an array. */ -const unsigned *LLVMGetIndices(LLVMValueRef Inst); +LLVM_FUNC_ABI const unsigned *LLVMGetIndices(LLVMValueRef Inst); /** * @} @@ -3724,18 +3725,18 @@ const unsigned *LLVMGetIndices(LLVMValueRef Inst); * @{ */ -LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C); -LLVMBuilderRef LLVMCreateBuilder(void); -void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, +LLVM_FUNC_ABI LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C); +LLVM_FUNC_ABI LLVMBuilderRef LLVMCreateBuilder(void); +LLVM_FUNC_ABI void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr); -void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr); -void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block); -LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder); -void LLVMClearInsertionPosition(LLVMBuilderRef Builder); -void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr); -void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, +LLVM_FUNC_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr); +LLVM_FUNC_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block); +LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder); +LLVM_FUNC_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder); +LLVM_FUNC_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr); +LLVM_FUNC_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name); -void LLVMDisposeBuilder(LLVMBuilderRef Builder); +LLVM_FUNC_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder); /* Metadata */ @@ -3744,7 +3745,7 @@ void LLVMDisposeBuilder(LLVMBuilderRef Builder); * * @see llvm::IRBuilder::getCurrentDebugLocation() */ -LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder); +LLVM_FUNC_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder); /** * Set location information used by debugging information. @@ -3753,7 +3754,7 @@ LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder); * * @see llvm::IRBuilder::SetCurrentDebugLocation() */ -void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc); +LLVM_FUNC_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc); /** * Attempts to set the debug location for the given instruction using the @@ -3765,21 +3766,21 @@ void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc); * * @see llvm::IRBuilder::SetInstDebugLocation() */ -void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst); +LLVM_FUNC_ABI void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst); /** * Adds the metadata registered with the given builder to the given instruction. * * @see llvm::IRBuilder::AddMetadataToInst() */ -void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst); +LLVM_FUNC_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst); /** * Get the dafult floating-point math metadata for a given builder. * * @see llvm::IRBuilder::getDefaultFPMathTag() */ -LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder); +LLVM_FUNC_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder); /** * Set the default floating-point math metadata for the given builder. @@ -3788,84 +3789,84 @@ LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder); * * @see llvm::IRBuilder::setDefaultFPMathTag() */ -void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, +LLVM_FUNC_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag); /** * Deprecated: Passing the NULL location will crash. * Use LLVMGetCurrentDebugLocation2 instead. */ -void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L); +LLVM_FUNC_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L); /** * Deprecated: Returning the NULL location will crash. * Use LLVMGetCurrentDebugLocation2 instead. */ -LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder); +LLVM_FUNC_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder); /* Terminators */ -LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef); -LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V); -LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N); -LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest); -LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else); -LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases); -LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests); -LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name); -LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); /* Exception Handling */ -LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn); -LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name); -LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB); -LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB); -LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name); -LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name); -LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name); /* Add a case to the switch instruction */ -void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, +LLVM_FUNC_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest); /* Add a destination to the indirectbr instruction */ -void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest); +LLVM_FUNC_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest); /* Get the number of clauses on the landingpad instruction */ -unsigned LLVMGetNumClauses(LLVMValueRef LandingPad); +LLVM_FUNC_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad); /* Get the value of the clause at index Idx on the landingpad instruction */ -LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx); +LLVM_FUNC_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx); /* Add a catch or filter clause to the landingpad instruction */ -void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal); +LLVM_FUNC_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal); /* Get the 'cleanup' flag in the landingpad instruction */ -LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad); +LLVM_FUNC_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad); /* Set the 'cleanup' flag in the landingpad instruction */ -void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val); +LLVM_FUNC_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val); /* Add a destination to the catchswitch instruction */ -void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest); +LLVM_FUNC_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest); /* Get the number of handlers on the catchswitch instruction */ -unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch); +LLVM_FUNC_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch); /** * Obtain the basic blocks acting as handlers for a catchswitch instruction. @@ -3878,15 +3879,15 @@ unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch); * @param CatchSwitch The catchswitch instruction to operate on. * @param Handlers Memory address of an array to be filled with basic blocks. */ -void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers); +LLVM_FUNC_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers); /* Funclets */ /* Get the number of funcletpad arguments. */ -LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i); +LLVM_FUNC_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i); /* Set a funcletpad argument at the given index. */ -void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value); +LLVM_FUNC_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value); /** * Get the parent catchswitch instruction of a catchpad instruction. @@ -3895,7 +3896,7 @@ void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value); * * @see llvm::CatchPadInst::getCatchSwitch() */ -LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad); +LLVM_FUNC_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad); /** * Set the parent catchswitch instruction of a catchpad instruction. @@ -3904,82 +3905,82 @@ LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad); * * @see llvm::CatchPadInst::setCatchSwitch() */ -void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch); +LLVM_FUNC_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch); /* Arithmetic */ -LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); -LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name); -LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name); -LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); -LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name); -LLVMBool LLVMGetNUW(LLVMValueRef ArithInst); -void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW); -LLVMBool LLVMGetNSW(LLVMValueRef ArithInst); -void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW); -LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst); -void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact); +LLVM_FUNC_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst); +LLVM_FUNC_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW); +LLVM_FUNC_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst); +LLVM_FUNC_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW); +LLVM_FUNC_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst); +LLVM_FUNC_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact); /* Memory */ -LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); -LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name); /** @@ -3988,7 +3989,7 @@ LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, * * @see llvm::IRRBuilder::CreateMemSet() */ -LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Val, LLVMValueRef Len, unsigned Align); /** @@ -3996,7 +3997,7 @@ LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr, * * @see llvm::IRRBuilder::CreateMemCpy() */ -LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size); @@ -4005,138 +4006,138 @@ LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, * * @see llvm::IRRBuilder::CreateMemMove() */ -LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size); -LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); -LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name); -LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal); -LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name); -LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr); -LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name); -LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name); -LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name); -LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name); -LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name); -LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst); -void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile); -LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst); -void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak); -LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst); -void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering); -LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst); -void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp); +LLVM_FUNC_ABI LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst); +LLVM_FUNC_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile); +LLVM_FUNC_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst); +LLVM_FUNC_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak); +LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst); +LLVM_FUNC_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering); +LLVM_FUNC_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst); +LLVM_FUNC_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp); /* Casts */ -LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); -LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name); -LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); /** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */ -LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, /*Signed cast!*/ +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, /*Signed cast!*/ LLVMTypeRef DestTy, const char *Name); -LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, +LLVM_FUNC_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned); /* Comparisons */ -LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); /* Miscellaneous instructions */ -LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); -LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVM_FUNC_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name); -LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name); -LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name); -LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name); -LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name); -LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name); -LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name); -LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name); -LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name); -LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name); -LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name); -LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name); -LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread); -LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, +LLVM_FUNC_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, @@ -4145,13 +4146,13 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, /** * Get the number of elements in the mask of a ShuffleVector instruction. */ -unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst); +LLVM_FUNC_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst); /** * \returns a constant that specifies that the result of a \c ShuffleVectorInst * is undefined. */ -int LLVMGetUndefMaskElem(void); +LLVM_FUNC_ABI int LLVMGetUndefMaskElem(void); /** * Get the mask value at position Elt in the mask of a ShuffleVector @@ -4160,16 +4161,16 @@ int LLVMGetUndefMaskElem(void); * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is * poison at that position. */ -int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt); +LLVM_FUNC_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt); -LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); -void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread); +LLVM_FUNC_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); +LLVM_FUNC_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread); -LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst); -void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, +LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst); +LLVM_FUNC_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering); -LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst); -void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, +LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst); +LLVM_FUNC_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering); /** @@ -4186,13 +4187,13 @@ void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, * Changes the type of M so it can be passed to FunctionPassManagers and the * JIT. They take ModuleProviders for historical reasons. */ -LLVMModuleProviderRef +LLVM_FUNC_ABI LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M); /** * Destroys the module M. */ -void LLVMDisposeModuleProvider(LLVMModuleProviderRef M); +LLVM_FUNC_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M); /** * @} @@ -4204,21 +4205,21 @@ void LLVMDisposeModuleProvider(LLVMModuleProviderRef M); * @{ */ -LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, +LLVM_FUNC_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage); -LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, +LLVM_FUNC_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage); -LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, +LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator); -LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, +LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName); -const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf); -size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf); -void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); +LLVM_FUNC_ABI const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf); +LLVM_FUNC_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf); +LLVM_FUNC_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); /** * @} @@ -4234,43 +4235,43 @@ void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); /** Constructs a new whole-module pass pipeline. This type of pipeline is suitable for link-time optimization and whole-module transformations. @see llvm::PassManager::PassManager */ -LLVMPassManagerRef LLVMCreatePassManager(void); +LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreatePassManager(void); /** Constructs a new function-by-function pass pipeline over the module provider. It does not take ownership of the module provider. This type of pipeline is suitable for code generation and JIT compilation tasks. @see llvm::FunctionPassManager::FunctionPassManager */ -LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M); /** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */ -LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP); +LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP); /** Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::PassManager::run(Module&) */ -LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M); +LLVM_FUNC_ABI LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M); /** Initializes all of the function passes scheduled in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doInitialization */ -LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM); +LLVM_FUNC_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM); /** Executes all of the function passes scheduled in the function pass manager on the provided function. Returns 1 if any of the passes modified the function, false otherwise. @see llvm::FunctionPassManager::run(Function&) */ -LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F); +LLVM_FUNC_ABI LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F); /** Finalizes all of the function passes scheduled in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doFinalization */ -LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM); +LLVM_FUNC_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM); /** Frees the memory of a pass pipeline. For function pipelines, does not free the module provider. @see llvm::PassManagerBase::~PassManagerBase. */ -void LLVMDisposePassManager(LLVMPassManagerRef PM); +LLVM_FUNC_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM); /** * @} @@ -4287,15 +4288,15 @@ void LLVMDisposePassManager(LLVMPassManagerRef PM); /** Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THREADS. This function always returns LLVMIsMultithreaded(). */ -LLVMBool LLVMStartMultithreaded(void); +LLVM_FUNC_ABI LLVMBool LLVMStartMultithreaded(void); /** Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THREADS. */ -void LLVMStopMultithreaded(void); +LLVM_FUNC_ABI void LLVMStopMultithreaded(void); /** Check whether LLVM is executing in thread-safe mode or not. @see llvm::llvm_is_multithreaded */ -LLVMBool LLVMIsMultithreaded(void); +LLVM_FUNC_ABI LLVMBool LLVMIsMultithreaded(void); /** * @} diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h index 5924294708cc3..870949e9eda82 100644 --- a/llvm/include/llvm-c/DebugInfo.h +++ b/llvm/include/llvm-c/DebugInfo.h @@ -16,6 +16,7 @@ #ifndef LLVM_C_DEBUGINFO_H #define LLVM_C_DEBUGINFO_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -205,12 +206,12 @@ typedef enum { /** * The current debug metadata version number. */ -unsigned LLVMDebugMetadataVersion(void); +LLVM_FUNC_ABI unsigned LLVMDebugMetadataVersion(void); /** * The version of debug metadata that's present in the provided \c Module. */ -unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module); +LLVM_FUNC_ABI unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module); /** * Strip debug info in the module if it exists. @@ -218,37 +219,37 @@ unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module); * metadata for debugging. We also remove debug locations for instructions. * Return true if module is modified. */ -LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module); +LLVM_FUNC_ABI LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module); /** * Construct a builder for a module, and do not allow for unresolved nodes * attached to the module. */ -LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M); /** * Construct a builder for a module and collect unresolved nodes attached * to the module in order to resolve cycles during a call to * \c LLVMDIBuilderFinalize. */ -LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M); /** * Deallocates the \c DIBuilder and everything it owns. * @note You must call \c LLVMDIBuilderFinalize before this */ -void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder); +LLVM_FUNC_ABI void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder); /** * Construct any deferred debug info descriptors. */ -void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder); +LLVM_FUNC_ABI void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder); /** * Finalize a specific subprogram. * No new variables may be added to this subprogram afterwards. */ -void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder, LLVMMetadataRef Subprogram); /** @@ -283,7 +284,7 @@ void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder, * \param SDK The SDK. On Darwin, the last component of the sysroot. * \param SDKLen The length of the C string passed to \c SDK. */ -LLVMMetadataRef LLVMDIBuilderCreateCompileUnit( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateCompileUnit( LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang, LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen, LLVMBool isOptimized, const char *Flags, size_t FlagsLen, @@ -300,7 +301,7 @@ LLVMMetadataRef LLVMDIBuilderCreateCompileUnit( * \param Directory Directory. * \param DirectoryLen The length of the C string passed to \c Directory. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen, const char *Directory, size_t DirectoryLen); @@ -319,7 +320,7 @@ LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename, * \param APINotesFile The path to an API notes file for the module. * \param APINotesFileLen The length of the C string passed to \c APINotestFile. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen, @@ -335,7 +336,7 @@ LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, * \param ExportSymbols Whether or not the namespace exports symbols, e.g. * this is true of C++ inline namespaces. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, @@ -359,7 +360,7 @@ LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder, * used to emit dwarf attributes. * \param IsOptimized True if optimization is ON. */ -LLVMMetadataRef LLVMDIBuilderCreateFunction( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateFunction( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *LinkageName, size_t LinkageNameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, @@ -374,7 +375,7 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction( * \param Line The line in the source file. * \param Column The column in the source file. */ -LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned Column); @@ -385,7 +386,7 @@ LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock( * \param File Source file. * \param Discriminator DWARF path discriminator value. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, @@ -399,7 +400,7 @@ LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, * \param File File where the declaration is located. * \param Line Line number of the declaration. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, @@ -417,7 +418,7 @@ LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, * \param Elements Renamed elements. * \param NumElements Number of renamed elements. */ -LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements); @@ -432,7 +433,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias( * \param Elements Renamed elements. * \param NumElements Number of renamed elements. */ -LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements); @@ -452,7 +453,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule( * \param Elements Renamed elements. * \param NumElements Number of renamed elements. */ -LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl, LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen, LLVMMetadataRef *Elements, unsigned NumElements); @@ -467,7 +468,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration( * \note If the item to which this location is attached cannot be * attributed to a source line, pass 0 for the line and column. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt); @@ -478,7 +479,7 @@ LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, * * @see DILocation::getLine() */ -unsigned LLVMDILocationGetLine(LLVMMetadataRef Location); +LLVM_FUNC_ABI unsigned LLVMDILocationGetLine(LLVMMetadataRef Location); /** * Get the column number of this debug location. @@ -486,7 +487,7 @@ unsigned LLVMDILocationGetLine(LLVMMetadataRef Location); * * @see DILocation::getColumn() */ -unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location); +LLVM_FUNC_ABI unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location); /** * Get the local scope associated with this debug location. @@ -494,7 +495,7 @@ unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location); * * @see DILocation::getScope() */ -LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location); /** * Get the "inline at" location associated with this debug location. @@ -502,7 +503,7 @@ LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location); * * @see DILocation::getInlinedAt() */ -LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location); /** * Get the metadata of the file associated with a given scope. @@ -510,7 +511,7 @@ LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location); * * @see DIScope::getFile() */ -LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope); /** * Get the directory of a given file. @@ -519,7 +520,7 @@ LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope); * * @see DIFile::getDirectory() */ -const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len); +LLVM_FUNC_ABI const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len); /** * Get the name of a given file. @@ -528,7 +529,7 @@ const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len); * * @see DIFile::getFilename() */ -const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len); +LLVM_FUNC_ABI const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len); /** * Get the source of a given file. @@ -537,7 +538,7 @@ const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len); * * @see DIFile::getSource() */ -const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len); +LLVM_FUNC_ABI const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len); /** * Create a type array. @@ -545,7 +546,7 @@ const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len); * \param Data The type elements. * \param NumElements Number of type elements. */ -LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements); @@ -559,7 +560,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, * \param Flags E.g.: \c LLVMDIFlagLValueReference. * These flags are used to emit dwarf attributes. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, @@ -577,7 +578,7 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, * @param Value Macro value. * @param ValueLen Macro value length. */ -LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMDWARFMacinfoRecordType RecordType, @@ -593,7 +594,7 @@ LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder, * @param Line Source line number where the macro file is included. * @param File File descriptor containing the name of the macro file. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMMetadataRef File); @@ -606,7 +607,7 @@ LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder, * @param Value Enumerator value. * @param IsUnsigned True if the value is unsigned. */ -LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value, LLVMBool IsUnsigned); @@ -625,7 +626,7 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder, * \param NumElements Number of enumeration elements. * \param ClassTy Underlying type of a C++11/ObjC fixed enum. */ -LLVMMetadataRef LLVMDIBuilderCreateEnumerationType( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumerationType( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements, @@ -648,7 +649,7 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerationType( * \param UniqueId A unique identifier for the union. * \param UniqueIdLen Length of unique identifier. */ -LLVMMetadataRef LLVMDIBuilderCreateUnionType( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateUnionType( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, @@ -665,7 +666,7 @@ LLVMMetadataRef LLVMDIBuilderCreateUnionType( * \param Subscripts Subscripts. * \param NumSubscripts Number of subscripts. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, @@ -680,7 +681,7 @@ LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size, * \param Subscripts Subscripts. * \param NumSubscripts Number of subscripts. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, @@ -692,7 +693,7 @@ LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, * \param Name The unspecified type's name. * \param NameLen Length of type name. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen); @@ -706,7 +707,7 @@ LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float. * \param Flags Flags to encode optional attribute like endianity */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, @@ -722,7 +723,7 @@ LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, * \param Name Pointer type name. (optional) * \param NameLen Length of pointer type name. (optional) */ -LLVMMetadataRef LLVMDIBuilderCreatePointerType( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreatePointerType( LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace, const char *Name, size_t NameLen); @@ -745,7 +746,7 @@ LLVMMetadataRef LLVMDIBuilderCreatePointerType( * \param UniqueId A unique identifier for the struct. * \param UniqueIdLen Length of the unique identifier for the struct. */ -LLVMMetadataRef LLVMDIBuilderCreateStructType( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateStructType( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, @@ -767,7 +768,7 @@ LLVMMetadataRef LLVMDIBuilderCreateStructType( * \param Flags Flags to encode member attribute, e.g. private * \param Ty Parent type. */ -LLVMMetadataRef LLVMDIBuilderCreateMemberType( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateMemberType( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, @@ -787,7 +788,7 @@ LLVMMetadataRef LLVMDIBuilderCreateMemberType( * \param ConstantVal Const initializer of the member. * \param AlignInBits Member alignment. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateStaticMemberType( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, @@ -803,7 +804,7 @@ LLVMDIBuilderCreateStaticMemberType( * \param AlignInBits Alignment. * \param Flags Flags. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType, LLVMMetadataRef ClassType, @@ -824,7 +825,7 @@ LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder, * \param Ty Parent type. * \param PropertyNode Property associated with this ivar. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, @@ -846,7 +847,7 @@ LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder, * \param PropertyAttributes Objective C property attributes. * \param Ty Type. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, @@ -860,7 +861,7 @@ LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder, * \param Builder The DIBuilder. * \param Type The underlying type to which this pointer points. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type); @@ -872,7 +873,7 @@ LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, * e.g. LLVMDWARFTypeQualifier_volatile_type * \param Type Base Type. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type); @@ -883,7 +884,7 @@ LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, * \param Tag Tag identifying type, * \param Type Base Type. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type); @@ -891,7 +892,7 @@ LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag, * Create C++11 nullptr type. * \param Builder The DIBuilder. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder); /** @@ -903,7 +904,7 @@ LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder); * \param LineNo Line number. * \param Scope The surrounding context for the typedef. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, @@ -919,7 +920,7 @@ LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, * \param VBPtrOffset Virtual base pointer offset. * \param Flags Flags to describe inheritance attribute, e.g. private */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, @@ -941,7 +942,7 @@ LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder, * \param UniqueIdentifier A unique identifier for the type. * \param UniqueIdentifierLen Length of the unique identifier. */ -LLVMMetadataRef LLVMDIBuilderCreateForwardDecl( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateForwardDecl( LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, @@ -964,7 +965,7 @@ LLVMMetadataRef LLVMDIBuilderCreateForwardDecl( * \param UniqueIdentifier A unique identifier for the type. * \param UniqueIdentifierLen Length of the unique identifier. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType( LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, @@ -986,7 +987,7 @@ LLVMDIBuilderCreateReplaceableCompositeType( * \param Flags Flags to encode member attribute. * \param Type Parent type. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, @@ -1018,7 +1019,7 @@ LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder, * \param UniqueIdentifier A unique identifier for the type. * \param UniqueIdentifierLen Length of the unique identifier. */ -LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, @@ -1032,7 +1033,7 @@ LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder, * \param Builder The DIBuilder. * \param Type The underlying type. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type); @@ -1043,7 +1044,7 @@ LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, * * @see DIType::getName() */ -const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length); +LLVM_FUNC_ABI const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length); /** * Get the size of this DIType in bits. @@ -1051,7 +1052,7 @@ const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length); * * @see DIType::getSizeInBits() */ -uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType); +LLVM_FUNC_ABI uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType); /** * Get the offset of this DIType in bits. @@ -1059,7 +1060,7 @@ uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType); * * @see DIType::getOffsetInBits() */ -uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType); +LLVM_FUNC_ABI uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType); /** * Get the alignment of this DIType in bits. @@ -1067,7 +1068,7 @@ uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType); * * @see DIType::getAlignInBits() */ -uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType); +LLVM_FUNC_ABI uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType); /** * Get the source line where this DIType is declared. @@ -1075,7 +1076,7 @@ uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType); * * @see DIType::getLine() */ -unsigned LLVMDITypeGetLine(LLVMMetadataRef DType); +LLVM_FUNC_ABI unsigned LLVMDITypeGetLine(LLVMMetadataRef DType); /** * Get the flags associated with this DIType. @@ -1083,7 +1084,7 @@ unsigned LLVMDITypeGetLine(LLVMMetadataRef DType); * * @see DIType::getFlags() */ -LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType); +LLVM_FUNC_ABI LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType); /** * Create a descriptor for a value range. @@ -1091,7 +1092,7 @@ LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType); * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran. * \param Count Count of elements in the subrange. */ -LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count); @@ -1101,7 +1102,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, * \param Data The DI Node elements. * \param NumElements Number of DI Node elements. */ -LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements); @@ -1112,7 +1113,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, * \param Addr An array of complex address operations. * \param Length Length of the address operation array. */ -LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, uint64_t *Addr, size_t Length); /** @@ -1121,7 +1122,7 @@ LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, * \param Builder The DIBuilder. * \param Value The constant value. */ -LLVMMetadataRef +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, uint64_t Value); @@ -1144,7 +1145,7 @@ LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, * \param AlignInBits Variable alignment(or 0 if no alignment attr was * specified) */ -LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, @@ -1154,7 +1155,7 @@ LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression( /** * Get the dwarf::Tag of a DINode */ -uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD); +LLVM_FUNC_ABI uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD); /** * Retrieves the \c DIVariable associated with this global variable expression. @@ -1162,7 +1163,7 @@ uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD); * * @see llvm::DIGlobalVariableExpression::getVariable() */ -LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE); /** * Retrieves the \c DIExpression associated with this global variable expression. @@ -1170,7 +1171,7 @@ LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE); * * @see llvm::DIGlobalVariableExpression::getExpression() */ -LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression( LLVMMetadataRef GVE); /** @@ -1179,7 +1180,7 @@ LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression( * * @see DIVariable::getFile() */ -LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var); /** * Get the metadata of the scope associated with a given variable. @@ -1187,7 +1188,7 @@ LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var); * * @see DIVariable::getScope() */ -LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var); +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var); /** * Get the source line where this \c DIVariable is declared. @@ -1195,7 +1196,7 @@ LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var); * * @see DIVariable::getLine() */ -unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var); +LLVM_FUNC_ABI unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var); /** * Create a new temporary \c MDNode. Suitable for use in constructing cyclic @@ -1205,7 +1206,7 @@ unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var); * \param Data The metadata elements. * \param NumElements Number of metadata elements. */ -LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, +LLVM_FUNC_ABI LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t NumElements); /** @@ -1215,14 +1216,14 @@ LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, * references will be reset. * \param TempNode The temporary metadata node. */ -void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode); +LLVM_FUNC_ABI void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode); /** * Replace all uses of temporary metadata. * \param TempTargetMetadata The temporary metadata node. * \param Replacement The replacement metadata node. */ -void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, +LLVM_FUNC_ABI void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, LLVMMetadataRef Replacement); /** @@ -1242,7 +1243,7 @@ void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, * \param AlignInBits Variable alignment(or 0 if no alignment attr was * specified) */ -LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, @@ -1257,7 +1258,7 @@ LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl( * \param DebugLoc Debug info location. * \param Instr Instruction acting as a location for the new intrinsic. */ -LLVMValueRef LLVMDIBuilderInsertDeclareBefore( +LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDeclareBefore( LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); @@ -1272,7 +1273,7 @@ LLVMValueRef LLVMDIBuilderInsertDeclareBefore( * \param DebugLoc Debug info location. * \param Block Basic block acting as a location for the new intrinsic. */ -LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd( +LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd( LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); @@ -1285,7 +1286,7 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd( * \param DebugLoc Debug info location. * \param Instr Instruction acting as a location for the new intrinsic. */ -LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, @@ -1303,7 +1304,7 @@ LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, * \param DebugLoc Debug info location. * \param Block Basic block acting as a location for the new intrinsic. */ -LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, +LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, @@ -1323,7 +1324,7 @@ LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, * \param Flags Flags. * \param AlignInBits Variable alignment. */ -LLVMMetadataRef LLVMDIBuilderCreateAutoVariable( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateAutoVariable( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits); @@ -1341,7 +1342,7 @@ LLVMMetadataRef LLVMDIBuilderCreateAutoVariable( * \param AlwaysPreserve If true, this descriptor will survive optimizations. * \param Flags Flags. */ -LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( +LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags); @@ -1351,14 +1352,14 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( * * @see llvm::Function::getSubprogram() */ -LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func); +LLVM_FUNC_ABI LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func); /** * Set the subprogram attached to a function. * * @see llvm::Function::setSubprogram() */ -void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP); +LLVM_FUNC_ABI void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP); /** * Get the line associated with a given subprogram. @@ -1366,14 +1367,14 @@ void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP); * * @see DISubprogram::getLine() */ -unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram); +LLVM_FUNC_ABI unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram); /** * Get the debug location for the given instruction. * * @see llvm::Instruction::getDebugLoc() */ -LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst); +LLVM_FUNC_ABI LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst); /** * Set the debug location for the given instruction. @@ -1382,14 +1383,14 @@ LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst); * * @see llvm::Instruction::setDebugLoc() */ -void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc); +LLVM_FUNC_ABI void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc); /** * Obtain the enumerated type of a Metadata instance. * * @see llvm::Metadata::getMetadataID() */ -LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata); +LLVM_FUNC_ABI LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata); /** * @} diff --git a/llvm/include/llvm-c/Disassembler.h b/llvm/include/llvm-c/Disassembler.h index b1cb35da6687a..b65c23306c03f 100644 --- a/llvm/include/llvm-c/Disassembler.h +++ b/llvm/include/llvm-c/Disassembler.h @@ -15,6 +15,7 @@ #ifndef LLVM_C_DISASSEMBLER_H #define LLVM_C_DISASSEMBLER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/DisassemblerTypes.h" #include "llvm-c/ExternC.h" @@ -35,7 +36,7 @@ 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, +LLVM_FUNC_ABI LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp); @@ -47,7 +48,7 @@ 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, +LLVM_FUNC_ABI LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp); @@ -59,7 +60,7 @@ 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 +LLVM_FUNC_ABI LLVMDisasmContextRef LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU, const char *Features, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, @@ -69,7 +70,7 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU, * Set the disassembler's options. Returns 1 if it can set the Options and 0 * otherwise. */ -int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options); +LLVM_FUNC_ABI int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options); /* The option to produce marked up assembly. */ #define LLVMDisassembler_Option_UseMarkup 1 @@ -85,7 +86,7 @@ int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options); /** * Dispose of a disassembler context. */ -void LLVMDisasmDispose(LLVMDisasmContextRef DC); +LLVM_FUNC_ABI void LLVMDisasmDispose(LLVMDisasmContextRef DC); /** * Disassemble a single instruction using the disassembler context specified in @@ -97,7 +98,7 @@ 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, +LLVM_FUNC_ABI size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes, uint64_t BytesSize, uint64_t PC, char *OutString, size_t OutStringSize); diff --git a/llvm/include/llvm-c/DisassemblerTypes.h b/llvm/include/llvm-c/DisassemblerTypes.h index 6999a350ec918..9eb7ef542d16b 100644 --- a/llvm/include/llvm-c/DisassemblerTypes.h +++ b/llvm/include/llvm-c/DisassemblerTypes.h @@ -10,6 +10,7 @@ #ifndef LLVM_C_DISASSEMBLERTYPES_H #define LLVM_C_DISASSEMBLERTYPES_H +#include "llvm/Support/Compiler.h" #include "llvm-c/DataTypes.h" #ifdef __cplusplus #include @@ -69,13 +70,13 @@ typedef int (*LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset, * type is one of the Target specific #defines below and is used to print * operands like "_foo@GOT", ":lower16:_foo", etc. */ -struct LLVMOpInfoSymbol1 { +struct LLVM_CLASS_ABI LLVMOpInfoSymbol1 { uint64_t Present; /* 1 if this symbol is present */ const char *Name; /* symbol name if not NULL */ uint64_t Value; /* symbol value if name is NULL */ }; -struct LLVMOpInfo1 { +struct LLVM_CLASS_ABI LLVMOpInfo1 { struct LLVMOpInfoSymbol1 AddSymbol; struct LLVMOpInfoSymbol1 SubtractSymbol; uint64_t Value; diff --git a/llvm/include/llvm-c/Error.h b/llvm/include/llvm-c/Error.h index c3baaf65186aa..526b76b2ee29a 100644 --- a/llvm/include/llvm-c/Error.h +++ b/llvm/include/llvm-c/Error.h @@ -15,6 +15,7 @@ #define LLVM_C_ERROR_H #include "llvm-c/ExternC.h" +#include "llvm/Support/Compiler.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_FUNC_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_FUNC_ABI void LLVMConsumeError(LLVMErrorRef Err); /** * Returns the given string's error message. This operation consumes the error, @@ -57,22 +58,22 @@ void LLVMConsumeError(LLVMErrorRef Err); * The caller is responsible for disposing of the string by calling * LLVMDisposeErrorMessage. */ -char *LLVMGetErrorMessage(LLVMErrorRef Err); +LLVM_FUNC_ABI char *LLVMGetErrorMessage(LLVMErrorRef Err); /** * Dispose of the given error message. */ -void LLVMDisposeErrorMessage(char *ErrMsg); +LLVM_FUNC_ABI void LLVMDisposeErrorMessage(char *ErrMsg); /** * Returns the type id for llvm StringError. */ -LLVMErrorTypeId LLVMGetStringErrorTypeId(void); +LLVM_FUNC_ABI LLVMErrorTypeId LLVMGetStringErrorTypeId(void); /** * Create a StringError. */ -LLVMErrorRef LLVMCreateStringError(const char *ErrMsg); +LLVM_FUNC_ABI LLVMErrorRef LLVMCreateStringError(const char *ErrMsg); /** * @} diff --git a/llvm/include/llvm-c/ErrorHandling.h b/llvm/include/llvm-c/ErrorHandling.h index d9b9f22752b8f..79527feee71ce 100644 --- a/llvm/include/llvm-c/ErrorHandling.h +++ b/llvm/include/llvm-c/ErrorHandling.h @@ -33,20 +33,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_FUNC_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_FUNC_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_FUNC_ABI void LLVMEnablePrettyStackTrace(void); /** * @} diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h index c5fc9bdb4d07f..76185ab47e839 100644 --- a/llvm/include/llvm-c/ExecutionEngine.h +++ b/llvm/include/llvm-c/ExecutionEngine.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_EXECUTIONENGINE_H #define LLVM_C_EXECUTIONENGINE_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Target.h" #include "llvm-c/TargetMachine.h" @@ -33,14 +34,14 @@ LLVM_C_EXTERN_C_BEGIN * @{ */ -void LLVMLinkInMCJIT(void); -void LLVMLinkInInterpreter(void); +LLVM_FUNC_ABI void LLVMLinkInMCJIT(void); +LLVM_FUNC_ABI void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; typedef struct LLVMOpaqueMCJITMemoryManager *LLVMMCJITMemoryManagerRef; -struct LLVMMCJITCompilerOptions { +struct LLVM_CLASS_ABI LLVMMCJITCompilerOptions { unsigned OptLevel; LLVMCodeModel CodeModel; LLVMBool NoFramePointerElim; @@ -50,41 +51,41 @@ struct LLVMMCJITCompilerOptions { /*===-- Operations on generic values --------------------------------------===*/ -LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, +LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, unsigned long long N, LLVMBool IsSigned); -LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P); +LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P); -LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N); +LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N); -unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef); +LLVM_FUNC_ABI unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef); -unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal, +LLVM_FUNC_ABI unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal, LLVMBool IsSigned); -void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal); +LLVM_FUNC_ABI void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal); -double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal); +LLVM_FUNC_ABI double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal); -void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal); +LLVM_FUNC_ABI void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal); /*===-- Operations on execution engines -----------------------------------===*/ -LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE, +LLVM_FUNC_ABI LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE, LLVMModuleRef M, char **OutError); -LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp, +LLVM_FUNC_ABI LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp, LLVMModuleRef M, char **OutError); -LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, +LLVM_FUNC_ABI LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, unsigned OptLevel, char **OutError); -void LLVMInitializeMCJITCompilerOptions( +LLVM_FUNC_ABI void LLVMInitializeMCJITCompilerOptions( struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions); /** @@ -104,54 +105,54 @@ void LLVMInitializeMCJITCompilerOptions( * * LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error); */ -LLVMBool LLVMCreateMCJITCompilerForModule( +LLVM_FUNC_ABI LLVMBool LLVMCreateMCJITCompilerForModule( LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions, char **OutError); -void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE); +LLVM_FUNC_ABI void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE); -void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE); +LLVM_FUNC_ABI void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE); -void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE); +LLVM_FUNC_ABI void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE); -int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, +LLVM_FUNC_ABI int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned ArgC, const char * const *ArgV, const char * const *EnvP); -LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, +LLVM_FUNC_ABI LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned NumArgs, LLVMGenericValueRef *Args); -void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F); +LLVM_FUNC_ABI void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F); -void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M); +LLVM_FUNC_ABI void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M); -LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M, +LLVM_FUNC_ABI LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M, LLVMModuleRef *OutMod, char **OutError); -LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, +LLVM_FUNC_ABI LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, LLVMValueRef *OutFn); -void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, +LLVM_FUNC_ABI void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, LLVMValueRef Fn); -LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE); -LLVMTargetMachineRef +LLVM_FUNC_ABI LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE); +LLVM_FUNC_ABI LLVMTargetMachineRef LLVMGetExecutionEngineTargetMachine(LLVMExecutionEngineRef EE); -void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, +LLVM_FUNC_ABI void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, void* Addr); -void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global); +LLVM_FUNC_ABI void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global); -uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name); +LLVM_FUNC_ABI uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name); -uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE, const char *Name); +LLVM_FUNC_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, +LLVM_FUNC_ABI LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE, char **OutError); /*===-- Operations on memory managers -------------------------------------===*/ @@ -177,21 +178,21 @@ typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque); * @param FinalizeMemory Set page permissions and flush cache. Return 0 on * success, 1 on error. */ -LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager( +LLVM_FUNC_ABI LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager( void *Opaque, LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, LLVMMemoryManagerDestroyCallback Destroy); -void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM); +LLVM_FUNC_ABI void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM); /*===-- JIT Event Listener functions -------------------------------------===*/ -LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void); -LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void); -LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void); -LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void); +LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void); +LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void); +LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void); +LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void); /** * @} diff --git a/llvm/include/llvm-c/IRReader.h b/llvm/include/llvm-c/IRReader.h index 905b84fa5a869..c809c7976abbd 100644 --- a/llvm/include/llvm-c/IRReader.h +++ b/llvm/include/llvm-c/IRReader.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_IRREADER_H #define LLVM_C_IRREADER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -35,7 +36,7 @@ LLVM_C_EXTERN_C_BEGIN * * @see llvm::ParseIR() */ -LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, +LLVM_FUNC_ABI LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage); diff --git a/llvm/include/llvm-c/LLJIT.h b/llvm/include/llvm-c/LLJIT.h index a06133aac4fb0..a8dfd20228047 100644 --- a/llvm/include/llvm-c/LLJIT.h +++ b/llvm/include/llvm-c/LLJIT.h @@ -24,6 +24,7 @@ #ifndef LLVM_C_LLJIT_H #define LLVM_C_LLJIT_H +#include "llvm/Support/Compiler.h" #include "llvm-c/Error.h" #include "llvm-c/Orc.h" #include "llvm-c/TargetMachine.h" @@ -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_FUNC_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_FUNC_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_FUNC_ABI void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder( LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB); /** * Set an ObjectLinkingLayer creator function for this LLJIT instance. */ -void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator( +LLVM_FUNC_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, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result, LLVMOrcLLJITBuilderRef Builder); /** * Dispose of an LLJIT instance. */ -LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J); +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J); /** * Get a reference to the ExecutionSession for this LLJIT instance. @@ -127,7 +128,7 @@ 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_FUNC_ABI LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J); /** * Return a reference to the Main JITDylib. @@ -135,18 +136,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_FUNC_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_FUNC_ABI const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J); /** * Returns the global prefix character according to the LLJIT's DataLayout. */ -char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J); +LLVM_FUNC_ABI char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J); /** * Mangles the given string according to the LLJIT instance's DataLayout, then @@ -155,7 +156,7 @@ char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J); * decrement the ref-count on the pool entry once they are finished with this * value. */ -LLVMOrcSymbolStringPoolEntryRef +LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName); /** @@ -167,7 +168,7 @@ 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, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer); /** @@ -179,7 +180,7 @@ LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, * Resources associated with the given object will be tracked by ResourceTracker * RT. */ -LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer); @@ -192,7 +193,7 @@ 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, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM); @@ -205,7 +206,7 @@ LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J, * Resources associated with the given Module will be tracked by ResourceTracker * RT. */ -LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef JD, LLVMOrcThreadSafeModuleRef TSM); @@ -214,25 +215,25 @@ LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, * * This operation does not take ownership of the Name argument. */ -LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J, +LLVM_FUNC_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_FUNC_ABI LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J); /** * Returns a non-owning reference to the LLJIT instance's object linking layer. */ -LLVMOrcObjectTransformLayerRef +LLVM_FUNC_ABI LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J); /** * Returns a non-owning reference to the LLJIT instance's IR transform layer. */ -LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J); +LLVM_FUNC_ABI LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J); /** * Get the LLJIT instance's default data layout string. @@ -240,7 +241,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_FUNC_ABI const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J); /** * @} diff --git a/llvm/include/llvm-c/Linker.h b/llvm/include/llvm-c/Linker.h index acff5d5e22253..4b103bf83a5d3 100644 --- a/llvm/include/llvm-c/Linker.h +++ b/llvm/include/llvm-c/Linker.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_LINKER_H #define LLVM_C_LINKER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -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_FUNC_ABI LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src); LLVM_C_EXTERN_C_END diff --git a/llvm/include/llvm-c/Object.h b/llvm/include/llvm-c/Object.h index f422c1ad224d2..55f6d2e40f149 100644 --- a/llvm/include/llvm-c/Object.h +++ b/llvm/include/llvm-c/Object.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_OBJECT_H #define LLVM_C_OBJECT_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" #include "llvm/Config/llvm-config.h" @@ -73,7 +74,7 @@ typedef enum { * * @see llvm::object::createBinary */ -LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, +LLVM_FUNC_ABI LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, LLVMContextRef Context, char **ErrorMessage); @@ -83,7 +84,7 @@ LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, * The binary file does not own its backing buffer. It is the responsibilty * of the caller to free it with \c LLVMDisposeMemoryBuffer. */ -void LLVMDisposeBinary(LLVMBinaryRef BR); +LLVM_FUNC_ABI void LLVMDisposeBinary(LLVMBinaryRef BR); /** * Retrieves a copy of the memory buffer associated with this object file. @@ -94,14 +95,14 @@ void LLVMDisposeBinary(LLVMBinaryRef BR); * * @see llvm::object::getMemoryBufferRef */ -LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR); +LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR); /** * Retrieve the specific type of a binary. * * @see llvm::object::Binary::getType */ -LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR); +LLVM_FUNC_ABI LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR); /* * For a Mach-O universal binary file, retrieves the object file corresponding @@ -114,7 +115,7 @@ 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, +LLVM_FUNC_ABI LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR, const char *Arch, size_t ArchLen, char **ErrorMessage); @@ -130,14 +131,14 @@ LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR, * * @see llvm::object::sections() */ -LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR); +LLVM_FUNC_ABI LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR); /** * Returns whether the given section iterator is at the end. * * @see llvm::object::section_end */ -LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, +LLVM_FUNC_ABI LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, LLVMSectionIteratorRef SI); /** @@ -151,77 +152,77 @@ LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, * * @see llvm::object::symbols() */ -LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR); +LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR); /** * Returns whether the given symbol iterator is at the end. * * @see llvm::object::symbol_end */ -LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR, +LLVM_FUNC_ABI LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR, LLVMSymbolIteratorRef SI); -void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI); -void LLVMMoveToNextSection(LLVMSectionIteratorRef SI); -void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect, +LLVM_FUNC_ABI void LLVMMoveToNextSection(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect, LLVMSymbolIteratorRef Sym); // ObjectFile Symbol iterators -void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI); -void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI); +LLVM_FUNC_ABI void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI); +LLVM_FUNC_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, +LLVM_FUNC_ABI const char *LLVMGetSectionName(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI); +LLVM_FUNC_ABI LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym); // Section Relocation iterators -LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section); -void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI); -LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, +LLVM_FUNC_ABI LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section); +LLVM_FUNC_ABI void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI); +LLVM_FUNC_ABI LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, LLVMRelocationIteratorRef RI); -void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI); +LLVM_FUNC_ABI void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI); // SymbolRef accessors -const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI); -uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI); -uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI); +LLVM_FUNC_ABI const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI); +LLVM_FUNC_ABI uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI); +LLVM_FUNC_ABI uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI); // RelocationRef accessors -uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI); -LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI); -uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI); +LLVM_FUNC_ABI uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI); +LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI); +LLVM_FUNC_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_FUNC_ABI const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI); +LLVM_FUNC_ABI const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI); /** Deprecated: Use LLVMBinaryRef instead. */ typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef; /** Deprecated: Use LLVMCreateBinary instead. */ -LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf); +LLVM_FUNC_ABI LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf); /** Deprecated: Use LLVMDisposeBinary instead. */ -void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile); +LLVM_FUNC_ABI void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile); /** Deprecated: Use LLVMObjectFileCopySectionIterator instead. */ -LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile); +LLVM_FUNC_ABI LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile); /** Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead. */ -LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile, +LLVM_FUNC_ABI LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile, LLVMSectionIteratorRef SI); /** Deprecated: Use LLVMObjectFileCopySymbolIterator instead. */ -LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile); +LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile); /** Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead. */ -LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile, +LLVM_FUNC_ABI LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile, LLVMSymbolIteratorRef SI); /** * @} diff --git a/llvm/include/llvm-c/Orc.h b/llvm/include/llvm-c/Orc.h index a40b17b712fb3..70670484ea46d 100644 --- a/llvm/include/llvm-c/Orc.h +++ b/llvm/include/llvm-c/Orc.h @@ -27,6 +27,7 @@ #ifndef LLVM_C_ORC_H #define LLVM_C_ORC_H +#include "llvm/Support/Compiler.h" #include "llvm-c/Error.h" #include "llvm-c/TargetMachine.h" #include "llvm-c/Types.h" @@ -69,7 +70,7 @@ typedef uint8_t LLVMJITSymbolTargetFlags; /** * Represents the linkage flags for a symbol definition. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { uint8_t GenericFlags; uint8_t TargetFlags; } LLVMJITSymbolFlags; @@ -77,7 +78,7 @@ typedef struct { /** * Represents an evaluated symbol address and flags. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcExecutorAddress Address; LLVMJITSymbolFlags Flags; } LLVMJITEvaluatedSymbol; @@ -106,7 +107,7 @@ typedef struct LLVMOrcOpaqueSymbolStringPoolEntry /** * Represents a pair of a symbol name and LLVMJITSymbolFlags. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef Name; LLVMJITSymbolFlags Flags; } LLVMOrcCSymbolFlagsMapPair; @@ -120,7 +121,7 @@ typedef LLVMOrcCSymbolFlagsMapPair *LLVMOrcCSymbolFlagsMapPairs; /** * Represents a pair of a symbol name and an evaluated symbol. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef Name; LLVMJITEvaluatedSymbol Sym; } LLVMOrcCSymbolMapPair; @@ -134,7 +135,7 @@ typedef LLVMOrcCSymbolMapPair *LLVMOrcCSymbolMapPairs; /** * Represents a SymbolAliasMapEntry */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef Name; LLVMJITSymbolFlags Flags; } LLVMOrcCSymbolAliasMapEntry; @@ -142,7 +143,7 @@ typedef struct { /** * Represents a pair of a symbol name and SymbolAliasMapEntry. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef Name; LLVMOrcCSymbolAliasMapEntry Entry; } LLVMOrcCSymbolAliasMapPair; @@ -162,7 +163,7 @@ typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef; * Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated * length. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef *Symbols; size_t Length; } LLVMOrcCSymbolsList; @@ -170,7 +171,7 @@ typedef struct { /** * Represents a pair of a JITDylib and LLVMOrcCSymbolsList. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcJITDylibRef JD; LLVMOrcCSymbolsList Names; } LLVMOrcCDependenceMapPair; @@ -206,7 +207,7 @@ typedef enum { /** * An element type for a JITDylib search order. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcJITDylibRef JD; LLVMOrcJITDylibLookupFlags JDLookupFlags; } LLVMOrcCJITDylibSearchOrderElement; @@ -231,7 +232,7 @@ typedef enum { /** * An element type for a symbol lookup set. */ -typedef struct { +typedef struct LLVM_CLASS_ABI { LLVMOrcSymbolStringPoolEntryRef Name; LLVMOrcSymbolLookupFlags LookupFlags; } LLVMOrcCLookupSetElement; @@ -479,7 +480,7 @@ typedef struct LLVMOrcOpaqueDumpObjects *LLVMOrcDumpObjectsRef; * requesting definitions from the JIT will typically be delivered a * FailureToMaterialize error instead). */ -void LLVMOrcExecutionSessionSetErrorReporter( +LLVM_FUNC_ABI void LLVMOrcExecutionSessionSetErrorReporter( LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx); @@ -489,7 +490,7 @@ void LLVMOrcExecutionSessionSetErrorReporter( * Ownership of the pool remains with the ExecutionSession: The caller is * not required to free the pool. */ -LLVMOrcSymbolStringPoolRef +LLVM_FUNC_ABI LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES); /** @@ -502,7 +503,7 @@ LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES); * entries will have become unreferenced, e.g. after removing a module or * closing a JITDylib. */ -void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP); +LLVM_FUNC_ABI void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP); /** * Intern a string in the ExecutionSession's SymbolStringPool and return a @@ -516,7 +517,7 @@ void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP); * * Note that this function does not perform linker-mangling on the string. */ -LLVMOrcSymbolStringPoolEntryRef +LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name); /** @@ -565,7 +566,7 @@ typedef void (*LLVMOrcExecutionSessionLookupHandleResultFunction)( * * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE! */ -void LLVMOrcExecutionSessionLookup( +LLVM_FUNC_ABI void LLVMOrcExecutionSessionLookup( LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K, LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize, LLVMOrcCLookupSet Symbols, size_t SymbolsSize, @@ -574,49 +575,49 @@ void LLVMOrcExecutionSessionLookup( /** * Increments the ref-count for a SymbolStringPool entry. */ -void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S); +LLVM_FUNC_ABI void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S); /** * Reduces the ref-count for of a SymbolStringPool entry. */ -void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S); +LLVM_FUNC_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_FUNC_ABI const char *LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S); /** * Reduces the ref-count of a ResourceTracker. */ -void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT); +LLVM_FUNC_ABI void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT); /** * Transfers tracking of all resources associated with resource tracker SrcRT * to resource tracker DstRT. */ -void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, +LLVM_FUNC_ABI void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT); /** * Remove all resources associated with the given tracker. See * ResourceTracker::remove(). */ -LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT); +LLVM_FUNC_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_FUNC_ABI void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG); /** * Dispose of a MaterializationUnit. */ -void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU); +LLVM_FUNC_ABI void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU); /** * Create a custom MaterializationUnit. @@ -651,7 +652,7 @@ void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU); * either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing * of it by calling LLVMOrcDisposeMaterializationUnit. */ -LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit( +LLVM_FUNC_ABI LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit( const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, @@ -679,7 +680,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_FUNC_ABI LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs); /** @@ -703,7 +704,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_FUNC_ABI LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports( LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceRef, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs); @@ -718,19 +719,19 @@ LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports( * LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via * LLVMOrcMaterializationResponsibilityFailMaterialization). */ -void LLVMOrcDisposeMaterializationResponsibility( +LLVM_FUNC_ABI void LLVMOrcDisposeMaterializationResponsibility( LLVMOrcMaterializationResponsibilityRef MR); /** * Returns the target JITDylib that these symbols are being materialized into. */ -LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib( +LLVM_FUNC_ABI LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib( LLVMOrcMaterializationResponsibilityRef MR); /** * Returns the ExecutionSession for this MaterializationResponsibility. */ -LLVMOrcExecutionSessionRef +LLVM_FUNC_ABI LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession( LLVMOrcMaterializationResponsibilityRef MR); @@ -744,7 +745,7 @@ LLVMOrcMaterializationResponsibilityGetExecutionSession( * MaterializationResponsibility requires the caller to retain the symbols * explicitly. */ -LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols( +LLVM_FUNC_ABI LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols( LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs); /** @@ -752,7 +753,7 @@ LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols( * * Does not release the entries themselves. */ -void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs); +LLVM_FUNC_ABI void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs); /** * Returns the initialization pseudo-symbol, if any. This symbol will also @@ -762,7 +763,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_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol( LLVMOrcMaterializationResponsibilityRef MR); @@ -772,7 +773,7 @@ LLVMOrcMaterializationResponsibilityGetInitializerSymbol( * information can be used to return responsibility for unrequested symbols * back to the JITDylib via the delegate method. */ -LLVMOrcSymbolStringPoolEntryRef * +LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef * LLVMOrcMaterializationResponsibilityGetRequestedSymbols( LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols); @@ -781,7 +782,7 @@ LLVMOrcMaterializationResponsibilityGetRequestedSymbols( * * Does not release the symbols themselves. */ -void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols); +LLVM_FUNC_ABI void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols); /** * Notifies the target JITDylib that the given symbols have been resolved. @@ -799,7 +800,7 @@ void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols); * MaterializationResponsibility then this method is guaranteed to return * LLVMErrorSuccess. */ -LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumPairs); @@ -816,7 +817,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved( * MaterializationResponsibility then this method is guaranteed to return * LLVMErrorSuccess. */ -LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted( LLVMOrcMaterializationResponsibilityRef MR); /** @@ -832,7 +833,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted( * additional symbols at materialization time (e.g. stubs, compile * callbacks, metadata) */ -LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs); @@ -843,7 +844,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing( * from the target JITDylib, and send an error to any queries waiting on * these symbols. */ -void LLVMOrcMaterializationResponsibilityFailMaterialization( +LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityFailMaterialization( LLVMOrcMaterializationResponsibilityRef MR); /** @@ -853,7 +854,7 @@ void LLVMOrcMaterializationResponsibilityFailMaterialization( * by introspecting which symbols have actually been looked up and * materializing only those). */ -LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU); @@ -865,7 +866,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace( * The caller retains responsibility of the the passed * MaterializationResponsibility. */ -LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result); @@ -888,7 +889,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate( * The client is still responsible for deleting the Dependencies.Names array * itself. */ -void LLVMOrcMaterializationResponsibilityAddDependencies( +LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityAddDependencies( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef Name, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs); @@ -898,7 +899,7 @@ void LLVMOrcMaterializationResponsibilityAddDependencies( * responsible for. See LLVMOrcMaterializationResponsibilityAddDependencies for * notes about memory responsibility. */ -void LLVMOrcMaterializationResponsibilityAddDependenciesForAll( +LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityAddDependenciesForAll( LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs); @@ -911,7 +912,7 @@ void LLVMOrcMaterializationResponsibilityAddDependenciesForAll( * This call does not install any library code or symbols into the newly * created JITDylib. The client is responsible for all configuration. */ -LLVMOrcJITDylibRef +LLVM_FUNC_ABI LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name); @@ -927,7 +928,7 @@ LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, * call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will * always return success. */ -LLVMErrorRef +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name); @@ -936,7 +937,7 @@ LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, * Returns the JITDylib with the given name, or NULL if no such JITDylib * exists. */ -LLVMOrcJITDylibRef +LLVM_FUNC_ABI LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, const char *Name); @@ -945,7 +946,7 @@ LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, * The tracker is returned with an initial ref-count of 1, and must be released * with LLVMOrcReleaseResourceTracker when no longer needed. */ -LLVMOrcResourceTrackerRef +LLVM_FUNC_ABI LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD); /** @@ -953,7 +954,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_FUNC_ABI LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD); /** @@ -963,14 +964,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, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU); /** * Calls remove on all trackers associated with this JITDylib, see * JITDylib::clear(). */ -LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD); +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD); /** * Add a DefinitionGenerator to the given JITDylib. @@ -978,7 +979,7 @@ 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, +LLVM_FUNC_ABI void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG); /** @@ -994,7 +995,7 @@ 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_FUNC_ABI LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator( LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx, LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose); @@ -1002,7 +1003,7 @@ LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator( * Continue a lookup that was suspended in a generator (see * LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction). */ -void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S, +LLVM_FUNC_ABI void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S, LLVMErrorRef Err); /** @@ -1023,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_FUNC_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess( LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx, LLVMOrcSymbolPredicate Filter, void *FilterCtx); @@ -1048,7 +1049,7 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess( * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE! * */ -LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath( LLVMOrcDefinitionGeneratorRef *Result, const char *FileName, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx); @@ -1066,7 +1067,7 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath( * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE! * */ -LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath( LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer, const char *FileName, const char *TargetTriple); @@ -1078,18 +1079,18 @@ LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath( * need to refer to it directly. Other references (e.g. from ThreadSafeModules) * will keep the data alive as long as it is needed. */ -LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void); +LLVM_FUNC_ABI LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void); /** * Get a reference to the wrapped LLVMContext. */ -LLVMContextRef +LLVM_FUNC_ABI LLVMContextRef LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx); /** * Dispose of a ThreadSafeContext. */ -void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx); +LLVM_FUNC_ABI void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx); /** * Create a ThreadSafeModule wrapper around the given LLVM module. This takes @@ -1101,7 +1102,7 @@ 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 +LLVM_FUNC_ABI LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx); @@ -1110,12 +1111,12 @@ LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, * not been passed to LLJIT (e.g. because some error prevented the client from * adding this to the JIT). */ -void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM); +LLVM_FUNC_ABI void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM); /** * Apply the given function to the module contained in this ThreadSafeModule. */ -LLVMErrorRef +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx); @@ -1128,7 +1129,7 @@ LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling * LLVMOrcDisposeJITTargetMachineBuilder. */ -LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost( LLVMOrcJITTargetMachineBuilderRef *Result); /** @@ -1140,13 +1141,13 @@ LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost( * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling * LLVMOrcDisposeJITTargetMachineBuilder. */ -LLVMOrcJITTargetMachineBuilderRef +LLVM_FUNC_ABI LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM); /** * Dispose of a JITTargetMachineBuilder. */ -void LLVMOrcDisposeJITTargetMachineBuilder( +LLVM_FUNC_ABI void LLVMOrcDisposeJITTargetMachineBuilder( LLVMOrcJITTargetMachineBuilderRef JTMB); /** @@ -1155,14 +1156,14 @@ void LLVMOrcDisposeJITTargetMachineBuilder( * The caller owns the resulting string as must dispose of it by calling * LLVMDisposeMessage */ -char *LLVMOrcJITTargetMachineBuilderGetTargetTriple( +LLVM_FUNC_ABI char *LLVMOrcJITTargetMachineBuilderGetTargetTriple( LLVMOrcJITTargetMachineBuilderRef JTMB); /** * Sets the target triple for the given JITTargetMachineBuilder to the given * string. */ -void LLVMOrcJITTargetMachineBuilderSetTargetTriple( +LLVM_FUNC_ABI void LLVMOrcJITTargetMachineBuilderSetTargetTriple( LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple); /** @@ -1176,7 +1177,7 @@ void LLVMOrcJITTargetMachineBuilderSetTargetTriple( * Resources associated with the given object will be tracked by the given * JITDylib's default ResourceTracker. */ -LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer); @@ -1191,7 +1192,7 @@ LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, * Resources associated with the given object will be tracked by * ResourceTracker RT. */ -LLVMErrorRef +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer); @@ -1202,16 +1203,16 @@ 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, +LLVM_FUNC_ABI void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer); /** * Dispose of an ObjectLayer. */ -void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer); +LLVM_FUNC_ABI void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer); -void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer, +LLVM_FUNC_ABI void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM); @@ -1219,14 +1220,14 @@ void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer, * Set the transform function of the provided transform layer, passing through a * pointer to user provided context. */ -void LLVMOrcIRTransformLayerSetTransform( +LLVM_FUNC_ABI void LLVMOrcIRTransformLayerSetTransform( LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx); /** * Set the transform function on an LLVMOrcObjectTransformLayer. */ -void LLVMOrcObjectTransformLayerSetTransform( +LLVM_FUNC_ABI void LLVMOrcObjectTransformLayerSetTransform( LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx); @@ -1236,15 +1237,15 @@ void LLVMOrcObjectTransformLayerSetTransform( * The resulting IndirectStubsManager is owned by the client * and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager. */ -LLVMOrcIndirectStubsManagerRef +LLVM_FUNC_ABI LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple); /** * Dispose of an IndirectStubsManager. */ -void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM); +LLVM_FUNC_ABI void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM); -LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager( +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager( const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *LCTM); @@ -1252,7 +1253,7 @@ LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager( /** * Dispose of an LazyCallThroughManager. */ -void LLVMOrcDisposeLazyCallThroughManager( +LLVM_FUNC_ABI void LLVMOrcDisposeLazyCallThroughManager( LLVMOrcLazyCallThroughManagerRef LCTM); /** @@ -1269,18 +1270,18 @@ void LLVMOrcDisposeLazyCallThroughManager( * .2.o, .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, +LLVM_FUNC_ABI LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride); /** * Dispose of a DumpObjects instance. */ -void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects); +LLVM_FUNC_ABI void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects); /** * Dump the contents of the given MemoryBuffer. */ -LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, +LLVM_FUNC_ABI LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer); /** diff --git a/llvm/include/llvm-c/OrcEE.h b/llvm/include/llvm-c/OrcEE.h index d451187aaef59..1b7a8dbe2bb16 100644 --- a/llvm/include/llvm-c/OrcEE.h +++ b/llvm/include/llvm-c/OrcEE.h @@ -24,6 +24,7 @@ #ifndef LLVM_C_ORCEE_H #define LLVM_C_ORCEE_H +#include "llvm/Support/Compiler.h" #include "llvm-c/Error.h" #include "llvm-c/ExecutionEngine.h" #include "llvm-c/Orc.h" diff --git a/llvm/include/llvm-c/Remarks.h b/llvm/include/llvm-c/Remarks.h index ffe647a6554aa..fb6365ebc8659 100644 --- a/llvm/include/llvm-c/Remarks.h +++ b/llvm/include/llvm-c/Remarks.h @@ -15,6 +15,7 @@ #ifndef LLVM_C_REMARKS_H #define LLVM_C_REMARKS_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" #ifdef __cplusplus @@ -61,14 +62,14 @@ typedef struct LLVMRemarkOpaqueString *LLVMRemarkStringRef; * * \since REMARKS_API_VERSION=0 */ -extern const char *LLVMRemarkStringGetData(LLVMRemarkStringRef String); +LLVM_FUNC_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_FUNC_ABI extern uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String); /** * DebugLoc containing File, Line and Column. @@ -82,7 +83,7 @@ typedef struct LLVMRemarkOpaqueDebugLoc *LLVMRemarkDebugLocRef; * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkStringRef +LLVM_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL); /** @@ -90,14 +91,14 @@ LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL); * * \since REMARKS_API_VERSION=0 */ -extern uint32_t LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL); +LLVM_FUNC_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_FUNC_ABI extern uint32_t LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL); /** * Element of the "Args" list. The key might give more information about what @@ -114,14 +115,14 @@ typedef struct LLVMRemarkOpaqueArg *LLVMRemarkArgRef; * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg); +LLVM_FUNC_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_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg); /** * Returns the debug location that is attached to the value of this argument. @@ -130,7 +131,7 @@ extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg); +LLVM_FUNC_ABI extern LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg); /** * A remark emitted by the compiler. @@ -144,7 +145,7 @@ typedef struct LLVMRemarkOpaqueEntry *LLVMRemarkEntryRef; * * \since REMARKS_API_VERSION=0 */ -extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark); +LLVM_FUNC_ABI extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark); /** * The type of the remark. For example, it can allow users to only keep the @@ -152,14 +153,14 @@ extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern enum LLVMRemarkType LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark); +LLVM_FUNC_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_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark); /** @@ -167,7 +168,7 @@ LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkStringRef +LLVM_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark); /** @@ -175,7 +176,7 @@ LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkStringRef +LLVM_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark); /** @@ -185,7 +186,7 @@ LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkDebugLocRef +LLVM_FUNC_ABI extern LLVMRemarkDebugLocRef LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark); /** @@ -195,14 +196,14 @@ LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark); +LLVM_FUNC_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_FUNC_ABI extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark); /** * Get a new iterator to iterate over a remark's argument. @@ -213,7 +214,7 @@ extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark); +LLVM_FUNC_ABI extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark); /** * Get the next argument in \p Remark from the position of \p It. @@ -224,7 +225,7 @@ extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark); * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It, +LLVM_FUNC_ABI extern LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It, LLVMRemarkEntryRef Remark); typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef; @@ -240,7 +241,7 @@ typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef; * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf, +LLVM_FUNC_ABI extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf, uint64_t Size); /** @@ -254,7 +255,7 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf, * * \since REMARKS_API_VERSION=1 */ -extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf, +LLVM_FUNC_ABI extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf, uint64_t Size); /** @@ -299,14 +300,14 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf, * * \since REMARKS_API_VERSION=0 */ -extern LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser); +LLVM_FUNC_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_FUNC_ABI extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser); /** * Returns a null-terminated string containing an error message. @@ -319,21 +320,21 @@ extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser); * * \since REMARKS_API_VERSION=0 */ -extern const char *LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser); +LLVM_FUNC_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_FUNC_ABI extern void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser); /** * Returns the version of the remarks library. * * \since REMARKS_API_VERSION=0 */ -extern uint32_t LLVMRemarkVersion(void); +LLVM_FUNC_ABI extern uint32_t LLVMRemarkVersion(void); /** * @} // endgoup LLVMCREMARKS diff --git a/llvm/include/llvm-c/Support.h b/llvm/include/llvm-c/Support.h index 17657861b32b9..6b81b61dbb92e 100644 --- a/llvm/include/llvm-c/Support.h +++ b/llvm/include/llvm-c/Support.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_SUPPORT_H #define LLVM_C_SUPPORT_H +#include "llvm/Support/Compiler.h" #include "llvm-c/DataTypes.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" @@ -32,7 +33,7 @@ LLVM_C_EXTERN_C_BEGIN * * @see sys::DynamicLibrary::LoadLibraryPermanently() */ -LLVMBool LLVMLoadLibraryPermanently(const char* Filename); +LLVM_FUNC_ABI LLVMBool LLVMLoadLibraryPermanently(const char* Filename); /** * This function parses the given arguments using the LLVM command line parser. @@ -42,7 +43,7 @@ LLVMBool LLVMLoadLibraryPermanently(const char* Filename); * * @see llvm::cl::ParseCommandLineOptions() */ -void LLVMParseCommandLineOptions(int argc, const char *const *argv, +LLVM_FUNC_ABI void LLVMParseCommandLineOptions(int argc, const char *const *argv, const char *Overview); /** @@ -52,7 +53,7 @@ void LLVMParseCommandLineOptions(int argc, const char *const *argv, * * @see sys::DynamicLibrary::SearchForAddressOfSymbol() */ -void *LLVMSearchForAddressOfSymbol(const char *symbolName); +LLVM_FUNC_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_FUNC_ABI void LLVMAddSymbol(const char *symbolName, void *symbolValue); /** * @} diff --git a/llvm/include/llvm-c/Target.h b/llvm/include/llvm-c/Target.h index 518b46d55bc3c..e9b3fc432b84a 100644 --- a/llvm/include/llvm-c/Target.h +++ b/llvm/include/llvm-c/Target.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_TARGET_H #define LLVM_C_TARGET_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Types.h" #include "llvm/Config/llvm-config.h" @@ -183,104 +184,104 @@ static inline LLVMBool LLVMInitializeNativeDisassembler(void) { * * @see Module::getDataLayout() */ -LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M); +LLVM_FUNC_ABI LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M); /** * Set the data layout for a module. * * @see Module::setDataLayout() */ -void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL); +LLVM_FUNC_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_FUNC_ABI LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep); /** Deallocates a TargetData. See the destructor llvm::DataLayout::~DataLayout. */ -void LLVMDisposeTargetData(LLVMTargetDataRef TD); +LLVM_FUNC_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, +LLVM_FUNC_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_FUNC_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_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI LLVMTypeRef LLVMIntPtrType(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 LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS); +LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrTypeForAS(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 LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD); +LLVM_FUNC_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, +LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, unsigned AS); /** Computes the size of a type in bytes for a target. See the method llvm::DataLayout::getTypeSizeInBits. */ -unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty); +LLVM_FUNC_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_FUNC_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_FUNC_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_FUNC_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_FUNC_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_FUNC_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, +LLVM_FUNC_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, +LLVM_FUNC_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, +LLVM_FUNC_ABI unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned Element); /** diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h index cbe8913803e02..10817c9b6ac29 100644 --- a/llvm/include/llvm-c/TargetMachine.h +++ b/llvm/include/llvm-c/TargetMachine.h @@ -19,6 +19,7 @@ #ifndef LLVM_C_TARGETMACHINE_H #define LLVM_C_TARGETMACHINE_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #include "llvm-c/Target.h" #include "llvm-c/Types.h" @@ -74,35 +75,35 @@ typedef enum { } LLVMGlobalISelAbortMode; /** Returns the first llvm::Target in the registered targets list. */ -LLVMTargetRef LLVMGetFirstTarget(void); +LLVM_FUNC_ABI LLVMTargetRef LLVMGetFirstTarget(void); /** Returns the next llvm::Target given a previous one (or null if there's none) */ -LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T); +LLVM_FUNC_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_FUNC_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, +LLVM_FUNC_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_FUNC_ABI const char *LLVMGetTargetName(LLVMTargetRef T); /** Returns the description of a target. See llvm::Target::getDescription */ -const char *LLVMGetTargetDescription(LLVMTargetRef T); +LLVM_FUNC_ABI const char *LLVMGetTargetDescription(LLVMTargetRef T); /** Returns if the target has a JIT */ -LLVMBool LLVMTargetHasJIT(LLVMTargetRef T); +LLVM_FUNC_ABI LLVMBool LLVMTargetHasJIT(LLVMTargetRef T); /** Returns if the target has a TargetMachine associated */ -LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T); +LLVM_FUNC_ABI LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T); /** Returns if the target as an ASM backend (required for emitting output) */ -LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T); +LLVM_FUNC_ABI LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T); /*===-- Target Machine ----------------------------------------------------===*/ /** @@ -112,14 +113,14 @@ LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T); * LLVMDisposeTargetMachineOptions() after the call to * LLVMCreateTargetMachineWithOptions(). */ -LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void); +LLVM_FUNC_ABI LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void); /** * Dispose of an LLVMTargetMachineOptionsRef instance. */ -void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options); +LLVM_FUNC_ABI void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options); -void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options, +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options, const char *CPU); /** @@ -127,19 +128,19 @@ void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options, * * \param Features a comma-separated list of features. */ -void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options, +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options, const char *Features); -void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options, +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options, const char *ABI); -void LLVMTargetMachineOptionsSetCodeGenOptLevel( +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetCodeGenOptLevel( LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level); -void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options, +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options, LLVMRelocMode Reloc); -void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options, +LLVM_FUNC_ABI void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options, LLVMCodeModel CodeModel); /** @@ -150,90 +151,90 @@ void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options, * \param Options additional configuration (see * LLVMCreateTargetMachineOptions()). */ -LLVMTargetMachineRef +LLVM_FUNC_ABI LLVMTargetMachineRef LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char *Triple, LLVMTargetMachineOptionsRef Options); /** Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine */ -LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T, +LLVM_FUNC_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_FUNC_ABI void LLVMDisposeTargetMachine(LLVMTargetMachineRef T); /** Returns the Target used in a TargetMachine */ -LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T); +LLVM_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T); /** Create a DataLayout based on the targetMachine. */ -LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T); +LLVM_FUNC_ABI LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T); /** Set the target machine's ASM verbosity. */ -void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T, +LLVM_FUNC_ABI void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T, LLVMBool VerboseAsm); /** Enable fast-path instruction selection. */ -void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable); +LLVM_FUNC_ABI void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable); /** Enable global instruction selection. */ -void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable); +LLVM_FUNC_ABI void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable); /** Set abort behaviour when global instruction selection fails to lower/select * an instruction. */ -void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T, +LLVM_FUNC_ABI void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T, LLVMGlobalISelAbortMode Mode); /** Enable the MachineOutliner pass. */ -void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T, +LLVM_FUNC_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, +LLVM_FUNC_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, +LLVM_FUNC_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_FUNC_ABI char* LLVMGetDefaultTargetTriple(void); /** Normalize a target triple. The result needs to be disposed with LLVMDisposeMessage. */ -char* LLVMNormalizeTargetTriple(const char* triple); +LLVM_FUNC_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_FUNC_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_FUNC_ABI char* LLVMGetHostCPUFeatures(void); /** Adds the target-specific analysis passes to the pass manager. */ -void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM); +LLVM_FUNC_ABI void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM); /** * @} diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h index d0466dd7fc0a1..407ea743521d9 100644 --- a/llvm/include/llvm-c/Transforms/PassBuilder.h +++ b/llvm/include/llvm-c/Transforms/PassBuilder.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H #define LLVM_C_TRANSFORMS_PASSBUILDER_H +#include "llvm/Support/Compiler.h" #include "llvm-c/Error.h" #include "llvm-c/TargetMachine.h" #include "llvm-c/Types.h" @@ -46,7 +47,7 @@ typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef; * pipelines may also be invoked using `default` and friends. See opt for * full reference of the Passes format. */ -LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, +LLVM_FUNC_ABI LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options); @@ -57,55 +58,55 @@ LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, * responsible for it. The client should call LLVMDisposePassBuilderOptions * to free the pass builder options. */ -LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void); +LLVM_FUNC_ABI LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void); /** * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions * inside the module is valid. */ -void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, LLVMBool VerifyEach); /** * Toggle debug logging when running the PassBuilder */ -void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging); -void LLVMPassBuilderOptionsSetLoopInterleaving( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopInterleaving( LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving); -void LLVMPassBuilderOptionsSetLoopVectorization( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopVectorization( LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization); -void LLVMPassBuilderOptionsSetSLPVectorization( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetSLPVectorization( LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization); -void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, LLVMBool LoopUnrolling); -void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll( LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll); -void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaOptCap); -void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap( LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap); -void LLVMPassBuilderOptionsSetCallGraphProfile( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetCallGraphProfile( LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile); -void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, LLVMBool MergeFunctions); -void LLVMPassBuilderOptionsSetInlinerThreshold( +LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetInlinerThreshold( LLVMPassBuilderOptionsRef Options, int Threshold); /** * Dispose of a heap-allocated PassBuilderOptions instance */ -void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options); +LLVM_FUNC_ABI void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options); /** * @} diff --git a/llvm/include/llvm-c/blake3.h b/llvm/include/llvm-c/blake3.h index 679477c3aa7f0..f0686e359a0b9 100644 --- a/llvm/include/llvm-c/blake3.h +++ b/llvm/include/llvm-c/blake3.h @@ -17,6 +17,7 @@ #ifndef LLVM_C_BLAKE3_H #define LLVM_C_BLAKE3_H +#include "llvm/Support/Compiler.h" #include #include @@ -33,7 +34,7 @@ extern "C" { // This struct is a private implementation detail. It has to be here because // it's part of llvm_blake3_hasher below. -typedef struct { +typedef struct LLVM_CLASS_ABI { uint32_t cv[8]; uint64_t chunk_counter; uint8_t buf[LLVM_BLAKE3_BLOCK_LEN]; @@ -42,7 +43,7 @@ typedef struct { uint8_t flags; } llvm_blake3_chunk_state; -typedef struct { +typedef struct LLVM_CLASS_ABI { uint32_t key[8]; llvm_blake3_chunk_state chunk; uint8_t cv_stack_len; @@ -54,23 +55,23 @@ 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, +LLVM_FUNC_ABI const char *llvm_blake3_version(void); +LLVM_FUNC_ABI void llvm_blake3_hasher_init(llvm_blake3_hasher *self); +LLVM_FUNC_ABI 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, +LLVM_FUNC_ABI 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, +LLVM_FUNC_ABI 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, +LLVM_FUNC_ABI 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, +LLVM_FUNC_ABI 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, +LLVM_FUNC_ABI 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_FUNC_ABI void llvm_blake3_hasher_reset(llvm_blake3_hasher *self); #ifdef __cplusplus } diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h index 5ceb02224d2bb..8cdf25aec7eeb 100644 --- a/llvm/include/llvm-c/lto.h +++ b/llvm/include/llvm-c/lto.h @@ -16,6 +16,7 @@ #ifndef LLVM_C_LTO_H #define LLVM_C_LTO_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" #ifdef __cplusplus @@ -107,7 +108,7 @@ LLVM_C_EXTERN_C_BEGIN * * \since prior to LTO_API_VERSION=3 */ -extern const char* +LLVM_FUNC_ABI extern const char* lto_get_version(void); /** @@ -115,7 +116,7 @@ lto_get_version(void); * * \since prior to LTO_API_VERSION=3 */ -extern const char* +LLVM_FUNC_ABI extern const char* lto_get_error_message(void); /** @@ -123,7 +124,7 @@ lto_get_error_message(void); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_module_is_object_file(const char* path); /** @@ -131,7 +132,7 @@ lto_module_is_object_file(const char* path); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_module_is_object_file_for_target(const char* path, const char* target_triple_prefix); @@ -141,7 +142,7 @@ lto_module_is_object_file_for_target(const char* path, * * \since LTO_API_VERSION=20 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_module_has_objc_category(const void *mem, size_t length); /** @@ -149,7 +150,7 @@ lto_module_has_objc_category(const void *mem, size_t length); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem, +LLVM_FUNC_ABI extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem, size_t length); /** @@ -157,7 +158,7 @@ extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem, * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length, const char* target_triple_prefix); @@ -167,7 +168,7 @@ lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length, * * \since prior to LTO_API_VERSION=3 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create(const char* path); /** @@ -176,7 +177,7 @@ lto_module_create(const char* path); * * \since prior to LTO_API_VERSION=3 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_from_memory(const void* mem, size_t length); /** @@ -185,7 +186,7 @@ lto_module_create_from_memory(const void* mem, size_t length); * * \since LTO_API_VERSION=9 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_from_memory_with_path(const void* mem, size_t length, const char *path); @@ -200,7 +201,7 @@ lto_module_create_from_memory_with_path(const void* mem, size_t length, * * \since LTO_API_VERSION=11 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_in_local_context(const void *mem, size_t length, const char *path); @@ -214,7 +215,7 @@ lto_module_create_in_local_context(const void *mem, size_t length, * * \since LTO_API_VERSION=11 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_in_codegen_context(const void *mem, size_t length, const char *path, lto_code_gen_t cg); @@ -224,7 +225,7 @@ lto_module_create_in_codegen_context(const void *mem, size_t length, * * \since LTO_API_VERSION=5 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_from_fd(int fd, const char *path, size_t file_size); /** @@ -233,7 +234,7 @@ lto_module_create_from_fd(int fd, const char *path, size_t file_size); * * \since LTO_API_VERSION=5 */ -extern lto_module_t +LLVM_FUNC_ABI extern lto_module_t lto_module_create_from_fd_at_offset(int fd, const char *path, size_t file_size, size_t map_size, off_t offset); @@ -243,7 +244,7 @@ lto_module_create_from_fd_at_offset(int fd, const char *path, size_t file_size, * * \since prior to LTO_API_VERSION=3 */ -extern void +LLVM_FUNC_ABI extern void lto_module_dispose(lto_module_t mod); /** @@ -251,7 +252,7 @@ lto_module_dispose(lto_module_t mod); * * \since prior to LTO_API_VERSION=3 */ -extern const char* +LLVM_FUNC_ABI extern const char* lto_module_get_target_triple(lto_module_t mod); /** @@ -259,7 +260,7 @@ lto_module_get_target_triple(lto_module_t mod); * * \since LTO_API_VERSION=4 */ -extern void +LLVM_FUNC_ABI extern void lto_module_set_target_triple(lto_module_t mod, const char *triple); /** @@ -267,7 +268,7 @@ lto_module_set_target_triple(lto_module_t mod, const char *triple); * * \since prior to LTO_API_VERSION=3 */ -extern unsigned int +LLVM_FUNC_ABI extern unsigned int lto_module_get_num_symbols(lto_module_t mod); /** @@ -275,7 +276,7 @@ lto_module_get_num_symbols(lto_module_t mod); * * \since prior to LTO_API_VERSION=3 */ -extern const char* +LLVM_FUNC_ABI extern const char* lto_module_get_symbol_name(lto_module_t mod, unsigned int index); /** @@ -283,7 +284,7 @@ lto_module_get_symbol_name(lto_module_t mod, unsigned int index); * * \since prior to LTO_API_VERSION=3 */ -extern lto_symbol_attributes +LLVM_FUNC_ABI extern lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index); /** @@ -294,7 +295,7 @@ lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index); * * \since LTO_API_VERSION=16 */ -extern const char* +LLVM_FUNC_ABI extern const char* lto_module_get_linkeropts(lto_module_t mod); /** @@ -308,7 +309,7 @@ lto_module_get_linkeropts(lto_module_t mod); * * \since LTO_API_VERSION=27 */ -extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod, +LLVM_FUNC_ABI extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod, unsigned int *out_cputype, unsigned int *out_cpusubtype); @@ -321,7 +322,7 @@ extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod, * * \since LTO_API_VERSION=29 */ -extern lto_bool_t lto_module_has_ctor_dtor(lto_module_t mod); +LLVM_FUNC_ABI extern lto_bool_t lto_module_has_ctor_dtor(lto_module_t mod); /** * Diagnostic severity. * @@ -353,7 +354,7 @@ typedef void (*lto_diagnostic_handler_t)( * * \since LTO_API_VERSION=7 */ -extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t, +LLVM_FUNC_ABI extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t, lto_diagnostic_handler_t, void *); @@ -366,7 +367,7 @@ extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t, * * \since prior to LTO_API_VERSION=3 */ -extern lto_code_gen_t +LLVM_FUNC_ABI extern lto_code_gen_t lto_codegen_create(void); /** @@ -378,7 +379,7 @@ lto_codegen_create(void); * * \since LTO_API_VERSION=11 */ -extern lto_code_gen_t +LLVM_FUNC_ABI extern lto_code_gen_t lto_codegen_create_in_local_context(void); /** @@ -387,7 +388,7 @@ lto_codegen_create_in_local_context(void); * * \since prior to LTO_API_VERSION=3 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_dispose(lto_code_gen_t); /** @@ -400,7 +401,7 @@ lto_codegen_dispose(lto_code_gen_t); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod); /** @@ -411,7 +412,7 @@ lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod); * * \since LTO_API_VERSION=13 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod); /** @@ -420,7 +421,7 @@ lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model); /** @@ -429,7 +430,7 @@ lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model); * * \since prior to LTO_API_VERSION=3 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model); /** @@ -437,7 +438,7 @@ lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model); * * \since LTO_API_VERSION=4 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu); /** @@ -446,7 +447,7 @@ lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu); * * \since LTO_API_VERSION=3 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path); /** @@ -454,7 +455,7 @@ lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path); * * \since LTO_API_VERSION=4 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, int nargs); @@ -465,7 +466,7 @@ lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, * * \since prior to LTO_API_VERSION=3 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol); /** @@ -475,7 +476,7 @@ lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol); * * \since LTO_API_VERSION=5 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path); /** @@ -490,7 +491,7 @@ lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path); * * \since prior to LTO_API_VERSION=3 */ -extern const void* +LLVM_FUNC_ABI extern const void* lto_codegen_compile(lto_code_gen_t cg, size_t* length); /** @@ -502,7 +503,7 @@ lto_codegen_compile(lto_code_gen_t cg, size_t* length); * * \since LTO_API_VERSION=5 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name); /** @@ -510,7 +511,7 @@ lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name); * * \since LTO_API_VERSION=12 */ -extern lto_bool_t +LLVM_FUNC_ABI extern lto_bool_t lto_codegen_optimize(lto_code_gen_t cg); /** @@ -525,7 +526,7 @@ lto_codegen_optimize(lto_code_gen_t cg); * * \since LTO_API_VERSION=12 */ -extern const void* +LLVM_FUNC_ABI extern const void* lto_codegen_compile_optimized(lto_code_gen_t cg, size_t* length); /** @@ -533,7 +534,7 @@ lto_codegen_compile_optimized(lto_code_gen_t cg, size_t* length); * * \since LTO_API_VERSION=12 */ -extern unsigned int +LLVM_FUNC_ABI extern unsigned int lto_api_version(void); /** @@ -548,7 +549,7 @@ lto_api_version(void); * * \since LTO_API_VERSION=28 */ -extern void lto_set_debug_options(const char *const *options, int number); +LLVM_FUNC_ABI extern void lto_set_debug_options(const char *const *options, int number); /** * Sets options to help debug codegen bugs. Since parsing shud only happen once, @@ -561,7 +562,7 @@ extern void lto_set_debug_options(const char *const *options, int number); * * \since prior to LTO_API_VERSION=3 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_debug_options(lto_code_gen_t cg, const char *); /** @@ -570,7 +571,7 @@ lto_codegen_debug_options(lto_code_gen_t cg, const char *); * * \since prior to LTO_API_VERSION=26 */ -extern void lto_codegen_debug_options_array(lto_code_gen_t cg, +LLVM_FUNC_ABI extern void lto_codegen_debug_options_array(lto_code_gen_t cg, const char *const *, int number); /** @@ -579,7 +580,7 @@ extern void lto_codegen_debug_options_array(lto_code_gen_t cg, * * \since LTO_API_VERSION=5 */ -extern void +LLVM_FUNC_ABI extern void lto_initialize_disassembler(void); /** @@ -588,7 +589,7 @@ lto_initialize_disassembler(void); * * \since LTO_API_VERSION=14 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_should_internalize(lto_code_gen_t cg, lto_bool_t ShouldInternalize); @@ -600,7 +601,7 @@ lto_codegen_set_should_internalize(lto_code_gen_t cg, * * \since LTO_API_VERSION=15 */ -extern void +LLVM_FUNC_ABI extern void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg, lto_bool_t ShouldEmbedUselists); @@ -615,7 +616,7 @@ typedef struct LLVMOpaqueLTOInput *lto_input_t; * * \since LTO_API_VERSION=24 */ -extern lto_input_t lto_input_create(const void *buffer, +LLVM_FUNC_ABI extern lto_input_t lto_input_create(const void *buffer, size_t buffer_size, const char *path); @@ -625,7 +626,7 @@ extern lto_input_t lto_input_create(const void *buffer, * * \since LTO_API_VERSION=24 */ -extern void lto_input_dispose(lto_input_t input); +LLVM_FUNC_ABI extern void lto_input_dispose(lto_input_t input); /** * Returns the number of dependent library specifiers @@ -633,7 +634,7 @@ extern void lto_input_dispose(lto_input_t input); * * \since LTO_API_VERSION=24 */ -extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input); +LLVM_FUNC_ABI extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input); /** * Returns the ith dependent library specifier @@ -642,7 +643,7 @@ extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input); * * \since LTO_API_VERSION=24 */ -extern const char * lto_input_get_dependent_library(lto_input_t input, +LLVM_FUNC_ABI extern const char * lto_input_get_dependent_library(lto_input_t input, size_t index, size_t *size); @@ -652,7 +653,7 @@ extern const char * lto_input_get_dependent_library(lto_input_t input, * * \since prior to LTO_API_VERSION=25 */ -extern const char *const *lto_runtime_lib_symbols_list(size_t *size); +LLVM_FUNC_ABI extern const char *const *lto_runtime_lib_symbols_list(size_t *size); /** * @} // endgoup LLVMCLTO @@ -667,7 +668,7 @@ extern const char *const *lto_runtime_lib_symbols_list(size_t *size); * * \since LTO_API_VERSION=18 */ -typedef struct { +typedef struct LLVM_CLASS_ABI { const char *Buffer; size_t Size; } LTOObjectBuffer; @@ -684,7 +685,7 @@ typedef struct { * * \since LTO_API_VERSION=18 */ -extern thinlto_code_gen_t thinlto_create_codegen(void); +LLVM_FUNC_ABI extern thinlto_code_gen_t thinlto_create_codegen(void); /** * Frees the generator and all memory it internally allocated. @@ -692,7 +693,7 @@ extern thinlto_code_gen_t thinlto_create_codegen(void); * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_dispose(thinlto_code_gen_t cg); +LLVM_FUNC_ABI extern void thinlto_codegen_dispose(thinlto_code_gen_t cg); /** * Add a module to a ThinLTO code generator. Identifier has to be unique among @@ -705,7 +706,7 @@ extern void thinlto_codegen_dispose(thinlto_code_gen_t cg); * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_add_module(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_add_module(thinlto_code_gen_t cg, const char *identifier, const char *data, int length); @@ -715,7 +716,7 @@ extern void thinlto_codegen_add_module(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_process(thinlto_code_gen_t cg); +LLVM_FUNC_ABI extern void thinlto_codegen_process(thinlto_code_gen_t cg); /** * Returns the number of object files produced by the ThinLTO CodeGenerator. @@ -726,7 +727,7 @@ extern void thinlto_codegen_process(thinlto_code_gen_t cg); * * \since LTO_API_VERSION=18 */ -extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg); +LLVM_FUNC_ABI extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg); /** * Returns a reference to the ith object file produced by the ThinLTO @@ -737,7 +738,7 @@ extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg); * * \since LTO_API_VERSION=18 */ -extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, unsigned int index); /** @@ -749,7 +750,7 @@ extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=21 */ -unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg); +LLVM_FUNC_ABI unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg); /** * Returns the path to the ith object file produced by the ThinLTO @@ -760,7 +761,7 @@ unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg); * * \since LTO_API_VERSION=21 */ -const char *thinlto_module_get_object_file(thinlto_code_gen_t cg, +LLVM_FUNC_ABI const char *thinlto_module_get_object_file(thinlto_code_gen_t cg, unsigned int index); /** @@ -769,7 +770,7 @@ const char *thinlto_module_get_object_file(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, lto_codegen_model); /** @@ -779,7 +780,7 @@ extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, const char *save_temps_dir); /** @@ -790,7 +791,7 @@ extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=21 */ -void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, +LLVM_FUNC_ABI void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, const char *save_temps_dir); /** @@ -798,7 +799,7 @@ void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu); +LLVM_FUNC_ABI extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu); /** * Disable CodeGen, only run the stages till codegen and stop. The output will @@ -806,7 +807,7 @@ extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu); * * \since LTO_API_VERSION=19 */ -extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, lto_bool_t disable); /** @@ -814,7 +815,7 @@ extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=19 */ -extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, lto_bool_t codegen_only); /** @@ -822,14 +823,14 @@ extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_debug_options(const char *const *options, int number); +LLVM_FUNC_ABI extern void thinlto_debug_options(const char *const *options, int number); /** * Test if a module has support for ThinLTO linking. * * \since LTO_API_VERSION=18 */ -extern lto_bool_t lto_module_is_thinlto(lto_module_t mod); +LLVM_FUNC_ABI extern lto_bool_t lto_module_is_thinlto(lto_module_t mod); /** * Adds a symbol to the list of global symbols that must exist in the final @@ -839,7 +840,7 @@ extern lto_bool_t lto_module_is_thinlto(lto_module_t mod); * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, const char *name, int length); @@ -851,7 +852,7 @@ extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, const char *name, int length); @@ -882,7 +883,7 @@ extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, const char *cache_dir); /** @@ -892,7 +893,7 @@ extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, int interval); /** @@ -908,7 +909,7 @@ extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_final_cache_size_relative_to_available_space( +LLVM_FUNC_ABI extern void thinlto_codegen_set_final_cache_size_relative_to_available_space( thinlto_code_gen_t cg, unsigned percentage); /** @@ -917,7 +918,7 @@ extern void thinlto_codegen_set_final_cache_size_relative_to_available_space( * * \since LTO_API_VERSION=18 */ -extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, unsigned expiration); /** @@ -928,7 +929,7 @@ extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=22 */ -extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg, unsigned max_size_bytes); /** @@ -937,7 +938,7 @@ extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=23 */ -extern void +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg, unsigned max_size_megabytes); @@ -947,7 +948,7 @@ thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg, * * \since LTO_API_VERSION=22 */ -extern void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg, +LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg, unsigned max_size_files); /** diff --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h index 5442968d20e4a..eb9c51e4b88b5 100644 --- a/llvm/include/llvm/ADT/APFixedPoint.h +++ b/llvm/include/llvm/ADT/APFixedPoint.h @@ -20,6 +20,7 @@ #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallString.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" namespace llvm { @@ -32,7 +33,7 @@ struct fltSemantics; /// if any). The scale represents the number of fractional bits in this type. /// When HasUnsignedPadding is true and this type is unsigned, the first bit /// in the value this represents is treated as padding. -class FixedPointSemantics { +class LLVM_CLASS_ABI FixedPointSemantics { public: static constexpr unsigned WidthBitWidth = 16; static constexpr unsigned LsbWeightBitWidth = 13; @@ -129,7 +130,7 @@ inline hash_code hash_value(const FixedPointSemantics &Val) { return hash_value(bit_cast(Val)); } -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline FixedPointSemantics getEmptyKey() { return FixedPointSemantics(0, 0, false, false, false); } @@ -151,7 +152,7 @@ template <> struct DenseMapInfo { /// JTC1 SC22 WG14 N1169. The class carries the value and semantics of /// a fixed point, and provides different operations that would normally be /// performed on fixed point types. -class APFixedPoint { +class LLVM_CLASS_ABI APFixedPoint { public: APFixedPoint(const APInt &Val, const FixedPointSemantics &Sema) : Val(Val, !Sema.isSigned()), Sema(Sema) { @@ -298,7 +299,7 @@ inline hash_code hash_value(const APFixedPoint &Val) { return hash_combine(Val.getSemantics(), Val.getValue()); } -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline APFixedPoint getEmptyKey() { return APFixedPoint(DenseMapInfo::getEmptyKey()); } diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h index 8c247bbcec90a..cbd73a5bafbdf 100644 --- a/llvm/include/llvm/ADT/APFloat.h +++ b/llvm/include/llvm/ADT/APFloat.h @@ -18,6 +18,7 @@ #include "llvm/ADT/APInt.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/FloatingPointMode.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include @@ -139,7 +140,7 @@ enum lostFraction { // Example of truncated bits: // This is the common type definitions shared by APFloat and its internal // implementation classes. This struct should not define any non-static data // members. -struct APFloatBase { +struct LLVM_CLASS_ABI APFloatBase { typedef APInt::WordType integerPart; static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD; @@ -290,7 +291,7 @@ struct APFloatBase { namespace detail { -class IEEEFloat final : public APFloatBase { +class LLVM_CLASS_ABI IEEEFloat final : public APFloatBase { public: /// \name Constructors /// @{ @@ -454,7 +455,7 @@ class IEEEFloat final : public APFloatBase { /// emphasizes producing different codes for different inputs in order to /// be used in canonicalization and memoization. As such, equality is /// bitwiseIsEqual, and 0 != -0. - friend hash_code hash_value(const IEEEFloat &Arg); + friend LLVM_FUNC_ABI hash_code hash_value(const IEEEFloat &Arg); /// Converts this value into a decimal string. /// @@ -510,12 +511,12 @@ class IEEEFloat final : public APFloatBase { /// 0 -> \c IEK_Zero /// Inf -> \c IEK_Inf /// - friend int ilogb(const IEEEFloat &Arg); + friend LLVM_FUNC_ABI int ilogb(const IEEEFloat &Arg); /// Returns: X * 2^Exp for integral exponents. - friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode); + friend LLVM_FUNC_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode); - friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode); + friend LLVM_FUNC_ABI IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode); /// \name Special value setters. /// @{ @@ -668,16 +669,16 @@ class IEEEFloat final : public APFloatBase { unsigned int sign : 1; }; -hash_code hash_value(const IEEEFloat &Arg); -int ilogb(const IEEEFloat &Arg); -IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode); -IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM); +LLVM_FUNC_ABI hash_code hash_value(const IEEEFloat &Arg); +LLVM_FUNC_ABI int ilogb(const IEEEFloat &Arg); +LLVM_FUNC_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode); +LLVM_FUNC_ABI IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM); // This mode implements more precise float in terms of two APFloats. // The interface and layout is designed for arbitrary underlying semantics, // though currently only PPCDoubleDouble semantics are supported, whose // corresponding underlying semantics are IEEEdouble. -class DoubleAPFloat final : public APFloatBase { +class LLVM_CLASS_ABI DoubleAPFloat final : public APFloatBase { // Note: this must be the first data member. const fltSemantics *Semantics; std::unique_ptr Floats; @@ -764,20 +765,20 @@ class DoubleAPFloat final : public APFloatBase { LLVM_READONLY int getExactLog2Abs() const; - friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode); - friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode); - friend hash_code hash_value(const DoubleAPFloat &Arg); + friend LLVM_FUNC_ABI DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode); + friend LLVM_FUNC_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode); + friend LLVM_FUNC_ABI hash_code hash_value(const DoubleAPFloat &Arg); }; -hash_code hash_value(const DoubleAPFloat &Arg); -DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, IEEEFloat::roundingMode RM); -DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, IEEEFloat::roundingMode); +LLVM_FUNC_ABI hash_code hash_value(const DoubleAPFloat &Arg); +LLVM_FUNC_ABI DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, IEEEFloat::roundingMode RM); +LLVM_FUNC_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, IEEEFloat::roundingMode); } // End detail namespace // This is a interface class that is currently forwarding functionalities from // detail::IEEEFloat. -class APFloat : public APFloatBase { +class LLVM_CLASS_ABI APFloat : public APFloatBase { typedef detail::IEEEFloat IEEEFloat; typedef detail::DoubleAPFloat DoubleAPFloat; @@ -1345,10 +1346,10 @@ class APFloat : public APFloatBase { APFLOAT_DISPATCH_ON_SEMANTICS(getExactLog2()); } - friend hash_code hash_value(const APFloat &Arg); + friend LLVM_FUNC_ABI hash_code hash_value(const APFloat &Arg); friend int ilogb(const APFloat &Arg) { return ilogb(Arg.getIEEE()); } - friend APFloat scalbn(APFloat X, int Exp, roundingMode RM); - friend APFloat frexp(const APFloat &X, int &Exp, roundingMode RM); + friend LLVM_FUNC_ABI APFloat scalbn(APFloat X, int Exp, roundingMode RM); + friend LLVM_FUNC_ABI APFloat frexp(const APFloat &X, int &Exp, roundingMode RM); friend IEEEFloat; friend DoubleAPFloat; }; @@ -1357,7 +1358,7 @@ class APFloat : public APFloatBase { /// /// These additional declarations are required in order to compile LLVM with IBM /// xlC compiler. -hash_code hash_value(const APFloat &Arg); +LLVM_FUNC_ABI hash_code hash_value(const APFloat &Arg); inline APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM) { if (APFloat::usesLayout(X.getSemantics())) return APFloat(scalbn(X.U.IEEE, Exp, RM), X.getSemantics()); diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index 6f2f25548cc84..c436ce28952c5 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -36,7 +36,7 @@ template struct DenseMapInfo; class APInt; -inline APInt operator-(APInt); +LLVM_FUNC_ABI inline APInt operator-(APInt); //===----------------------------------------------------------------------===// // APInt Class @@ -73,7 +73,7 @@ inline APInt operator-(APInt); /// shifts are defined, but sign extension and ashr is not. Zero bit values /// compare and hash equal to themselves, and countLeadingZeros returns 0. /// -class [[nodiscard]] APInt { +class LLVM_CLASS_ABI [[nodiscard]] APInt { public: typedef uint64_t WordType; @@ -539,7 +539,7 @@ class [[nodiscard]] APInt { } /// Overload to compute a hash_code for an APInt value. - friend hash_code hash_value(const APInt &Arg); + friend LLVM_FUNC_ABI hash_code hash_value(const APInt &Arg); /// This function returns a pointer to the internal storage of the APInt. /// This is useful for writing out the APInt in binary form without any @@ -2193,7 +2193,7 @@ inline const APInt &umax(const APInt &A, const APInt &B) { /// using Stein's algorithm. /// /// \returns the greatest common divisor of A and B. -APInt GreatestCommonDivisor(APInt A, APInt B); +LLVM_FUNC_ABI APInt GreatestCommonDivisor(APInt A, APInt B); /// Converts the given APInt to a double value. /// @@ -2224,7 +2224,7 @@ inline float RoundSignedAPIntToFloat(const APInt &APIVal) { /// Converts the given double value into a APInt. /// /// This function convert a double value to an APInt value. -APInt RoundDoubleToAPInt(double Double, unsigned width); +LLVM_FUNC_ABI APInt RoundDoubleToAPInt(double Double, unsigned width); /// Converts a float value into a APInt. /// @@ -2234,10 +2234,10 @@ inline APInt RoundFloatToAPInt(float Float, unsigned width) { } /// Return A unsign-divided by B, rounded by the given rounding mode. -APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM); +LLVM_FUNC_ABI APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM); /// Return A sign-divided by B, rounded by the given rounding mode. -APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); +LLVM_FUNC_ABI APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); /// Let q(n) = An^2 + Bn + C, and BW = bit width of the value range /// (e.g. 32 for i32). @@ -2272,12 +2272,12 @@ APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); /// /// The returned value may have a different bit width from the input /// coefficients. -std::optional SolveQuadraticEquationWrap(APInt A, APInt B, APInt C, +LLVM_FUNC_ABI std::optional SolveQuadraticEquationWrap(APInt A, APInt B, APInt C, unsigned RangeWidth); /// Compare two values, and if they are different, return the position of the /// most significant bit that is different in the values. -std::optional GetMostSignificantDifferentBit(const APInt &A, +LLVM_FUNC_ABI std::optional GetMostSignificantDifferentBit(const APInt &A, const APInt &B); /// Splat/Merge neighboring bits to widen/narrow the bitmask represented @@ -2291,24 +2291,24 @@ std::optional GetMostSignificantDifferentBit(const APInt &A, /// e.g. ScaleBitMask(0b0101, 8) -> 0b00110011 /// e.g. ScaleBitMask(0b00011011, 4) -> 0b0001 /// A.getBitwidth() or NewBitWidth must be a whole multiples of the other. -APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth, +LLVM_FUNC_ABI APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth, bool MatchAllBits = false); } // namespace APIntOps // See friend declaration above. This additional declaration is required in // order to compile LLVM with IBM xlC compiler. -hash_code hash_value(const APInt &Arg); +LLVM_FUNC_ABI hash_code hash_value(const APInt &Arg); /// StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst /// with the integer held in IntVal. -void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes); +LLVM_FUNC_ABI void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes); /// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting /// from Src into IntVal, which is assumed to be wide enough and to hold zero. -void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes); +LLVM_FUNC_ABI void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes); /// Provide DenseMapInfo for APInt. -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline APInt getEmptyKey() { APInt V(nullptr, 0); V.U.VAL = ~0ULL; diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h index 90b988875a24d..27b21f056b868 100644 --- a/llvm/include/llvm/ADT/APSInt.h +++ b/llvm/include/llvm/ADT/APSInt.h @@ -16,11 +16,12 @@ #define LLVM_ADT_APSINT_H #include "llvm/ADT/APInt.h" +#include "llvm/Support/Compiler.h" namespace llvm { /// An arbitrary precision integer that knows its signedness. -class [[nodiscard]] APSInt : public APInt { +class LLVM_CLASS_ABI [[nodiscard]] APSInt : public APInt { bool IsUnsigned = false; public: @@ -367,7 +368,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const APSInt &I) { } /// Provide DenseMapInfo for APSInt, using the DenseMapInfo for APInt. -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline APSInt getEmptyKey() { return APSInt(DenseMapInfo::getEmptyKey()); } diff --git a/llvm/include/llvm/ADT/AddressRanges.h b/llvm/include/llvm/ADT/AddressRanges.h index 415d30bbb5cf9..6972108e6c5f3 100644 --- a/llvm/include/llvm/ADT/AddressRanges.h +++ b/llvm/include/llvm/ADT/AddressRanges.h @@ -11,6 +11,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -19,7 +20,7 @@ namespace llvm { /// A class that represents an address range. The range is specified using /// a start and an end address: [Start, End). -class AddressRange { +class LLVM_CLASS_ABI AddressRange { public: AddressRange() {} AddressRange(uint64_t S, uint64_t E) : Start(S), End(E) { @@ -55,7 +56,7 @@ class AddressRange { /// The address ranges are always sorted and never contain any invalid, /// empty or intersected address ranges. -template class AddressRangesBase { +template class LLVM_CLASS_ABI AddressRangesBase { protected: using Collection = SmallVector; Collection Ranges; @@ -118,7 +119,7 @@ template class AddressRangesBase { /// insertions and searches efficiently. Intersecting([100,200), [150,300)) /// and adjacent([100,200), [200,300)) address ranges are combined during /// insertion. -class AddressRanges : public AddressRangesBase { +class LLVM_CLASS_ABI AddressRanges : public AddressRangesBase { public: Collection::const_iterator insert(AddressRange Range) { if (Range.empty()) @@ -142,7 +143,7 @@ class AddressRanges : public AddressRangesBase { } }; -class AddressRangeValuePair { +class LLVM_CLASS_ABI AddressRangeValuePair { public: operator AddressRange() const { return Range; } @@ -162,7 +163,7 @@ inline bool operator==(const AddressRangeValuePair &LHS, /// Intersecting([100,200), [150,300)) ranges splitted into non-conflicting /// parts([100,200), [200,300)). Adjacent([100,200), [200,300)) address /// ranges are not combined during insertion. -class AddressRangesMap : public AddressRangesBase { +class LLVM_CLASS_ABI AddressRangesMap : public AddressRangesBase { public: void insert(AddressRange Range, int64_t Value) { if (Range.empty()) diff --git a/llvm/include/llvm/ADT/AllocatorList.h b/llvm/include/llvm/ADT/AllocatorList.h index 04d0afc9d076e..e8ed556f05b22 100644 --- a/llvm/include/llvm/ADT/AllocatorList.h +++ b/llvm/include/llvm/ADT/AllocatorList.h @@ -13,6 +13,7 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/simple_ilist.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -30,7 +31,7 @@ namespace llvm { /// Because this list owns the allocator, calling \a splice() with a different /// list isn't generally safe. As such, \a splice has been left out of the /// interface entirely. -template class AllocatorList : AllocatorT { +template class LLVM_CLASS_ABI AllocatorList : AllocatorT { struct Node : ilist_node { Node(Node &&) = delete; Node(const Node &) = delete; diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h index 713f463f65edf..c125613612c33 100644 --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -38,7 +38,7 @@ namespace llvm { /// This is intended to be trivially copyable, so it should be passed by /// value. template - class LLVM_GSL_POINTER [[nodiscard]] ArrayRef { + class LLVM_CLASS_ABI LLVM_GSL_POINTER [[nodiscard]] ArrayRef { public: using value_type = T; using pointer = value_type *; @@ -304,7 +304,7 @@ namespace llvm { /// This is intended to be trivially copyable, so it should be passed by /// value. template - class [[nodiscard]] MutableArrayRef : public ArrayRef { + class LLVM_CLASS_ABI [[nodiscard]] MutableArrayRef : public ArrayRef { public: using value_type = T; using pointer = value_type *; @@ -446,7 +446,7 @@ namespace llvm { }; /// This is a MutableArrayRef that owns its array. - template class OwningArrayRef : public MutableArrayRef { + template class LLVM_CLASS_ABI OwningArrayRef : public MutableArrayRef { public: OwningArrayRef() = default; OwningArrayRef(size_t Size) : MutableArrayRef(new T[Size], Size) {} @@ -693,7 +693,7 @@ namespace llvm { } // Provide DenseMapInfo for ArrayRefs. - template struct DenseMapInfo, void> { + template struct LLVM_CLASS_ABI DenseMapInfo, void> { static inline ArrayRef getEmptyKey() { return ArrayRef( reinterpret_cast(~static_cast(0)), size_t(0)); diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h index e0de1afcc9418..9813c6679f429 100644 --- a/llvm/include/llvm/ADT/BitVector.h +++ b/llvm/include/llvm/ADT/BitVector.h @@ -17,6 +17,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include #include @@ -31,7 +32,7 @@ namespace llvm { /// ForwardIterator for the bits that are set. /// Iterators get invalidated when resize / reserve is called. -template class const_set_bits_iterator_impl { +template class LLVM_CLASS_ABI const_set_bits_iterator_impl { const BitVectorT &Parent; int Current = 0; @@ -79,7 +80,7 @@ template class const_set_bits_iterator_impl { } }; -class BitVector { +class LLVM_CLASS_ABI BitVector { typedef uintptr_t BitWord; enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT }; @@ -836,7 +837,7 @@ inline BitVector::size_type capacity_in_bytes(const BitVector &X) { return X.getMemorySize(); } -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline BitVector getEmptyKey() { return {}; } static inline BitVector getTombstoneKey() { BitVector V; diff --git a/llvm/include/llvm/ADT/Bitfields.h b/llvm/include/llvm/ADT/Bitfields.h index 4064d716f8a77..3b089276f4b6c 100644 --- a/llvm/include/llvm/ADT/Bitfields.h +++ b/llvm/include/llvm/ADT/Bitfields.h @@ -79,6 +79,7 @@ #ifndef LLVM_ADT_BITFIELDS_H #define LLVM_ADT_BITFIELDS_H +#include "llvm/Support/Compiler.h" #include #include // CHAR_BIT #include // size_t @@ -91,7 +92,7 @@ namespace llvm { namespace bitfields_details { /// A struct defining useful bit patterns for n-bits integer types. -template struct BitPatterns { +template struct LLVM_CLASS_ABI BitPatterns { /// Bit patterns are forged using the equivalent `Unsigned` type because of /// undefined operations over signed types (e.g. Bitwise shift operators). /// Moreover same size casting from unsigned to signed is well defined but not @@ -118,7 +119,7 @@ template struct BitPatterns { /// `Compressor` is specialized on signed-ness so no runtime cost is incurred. /// The `pack` method also checks that the passed in `UserValue` is valid. template ::value> -struct Compressor { +struct LLVM_CLASS_ABI Compressor { static_assert(std::is_unsigned::value, "T must be unsigned"); using BP = BitPatterns; @@ -131,7 +132,7 @@ struct Compressor { static T unpack(T StorageValue) { return StorageValue; } }; -template struct Compressor { +template struct LLVM_CLASS_ABI Compressor { static_assert(std::is_signed::value, "T must be signed"); using BP = BitPatterns; @@ -153,7 +154,7 @@ template struct Compressor { /// Impl is where Bifield description and Storage are put together to interact /// with values. -template struct Impl { +template struct LLVM_CLASS_ABI Impl { static_assert(std::is_unsigned::value, "Storage must be unsigned"); using IntegerType = typename Bitfield::IntegerType; @@ -194,13 +195,13 @@ template struct Impl { /// with their unsigned counterparts. The correct type is restored in the public /// API. template ::value> -struct ResolveUnderlyingType { +struct LLVM_CLASS_ABI ResolveUnderlyingType { using type = std::underlying_type_t; }; -template struct ResolveUnderlyingType { +template struct LLVM_CLASS_ABI ResolveUnderlyingType { using type = T; }; -template <> struct ResolveUnderlyingType { +template <> struct LLVM_CLASS_ABI ResolveUnderlyingType { /// In case sizeof(bool) != 1, replace `void` by an additionnal /// std::conditional. using type = std::conditional_t; @@ -209,7 +210,7 @@ template <> struct ResolveUnderlyingType { } // namespace bitfields_details /// Holds functions to get, set or test bitfields. -struct Bitfield { +struct LLVM_CLASS_ABI Bitfield { /// Describes an element of a Bitfield. This type is then used with the /// Bitfield static member functions. /// \tparam T The type of the field once in unpacked form. diff --git a/llvm/include/llvm/ADT/BitmaskEnum.h b/llvm/include/llvm/ADT/BitmaskEnum.h index 5fe724d80c330..cde262b196e44 100644 --- a/llvm/include/llvm/ADT/BitmaskEnum.h +++ b/llvm/include/llvm/ADT/BitmaskEnum.h @@ -14,6 +14,7 @@ #include #include "llvm/ADT/STLForwardCompat.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" /// LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can @@ -95,10 +96,10 @@ namespace llvm { /// Traits class to determine whether an enum has a /// LLVM_BITMASK_LARGEST_ENUMERATOR enumerator. template -struct is_bitmask_enum : std::false_type {}; +struct LLVM_CLASS_ABI is_bitmask_enum : std::false_type {}; template -struct is_bitmask_enum< +struct LLVM_CLASS_ABI is_bitmask_enum< E, std::enable_if_t= 0>> : std::true_type {}; @@ -106,7 +107,7 @@ struct is_bitmask_enum< template struct largest_bitmask_enum_bit; template -struct largest_bitmask_enum_bit< +struct LLVM_CLASS_ABI largest_bitmask_enum_bit< E, std::enable_if_t= 0>> { using UnderlyingTy = std::underlying_type_t; static constexpr UnderlyingTy value = diff --git a/llvm/include/llvm/ADT/Bitset.h b/llvm/include/llvm/ADT/Bitset.h index 839d3fe3abf6e..787c8d6c67fce 100644 --- a/llvm/include/llvm/ADT/Bitset.h +++ b/llvm/include/llvm/ADT/Bitset.h @@ -28,7 +28,7 @@ namespace llvm { /// nice to use std::bitset directly, but it doesn't support constant /// initialization. template -class Bitset { +class LLVM_CLASS_ABI Bitset { typedef uintptr_t BitWord; enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT }; diff --git a/llvm/include/llvm/ADT/BreadthFirstIterator.h b/llvm/include/llvm/ADT/BreadthFirstIterator.h index 29e96693c4d1a..7664ce68ac2a8 100644 --- a/llvm/include/llvm/ADT/BreadthFirstIterator.h +++ b/llvm/include/llvm/ADT/BreadthFirstIterator.h @@ -21,6 +21,7 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -30,7 +31,7 @@ namespace llvm { // bf_iterator_storage - A private class which is used to figure out where to // store the visited set. We only provide a non-external variant for now. -template class bf_iterator_storage { +template class LLVM_CLASS_ABI bf_iterator_storage { public: SetType Visited; }; @@ -44,7 +45,7 @@ template ::NodeRef>, class GT = GraphTraits> -class bf_iterator : public bf_iterator_storage { +class LLVM_CLASS_ABI bf_iterator : public bf_iterator_storage { public: using iterator_category = std::forward_iterator_tag; using value_type = typename GT::NodeRef; diff --git a/llvm/include/llvm/ADT/CachedHashString.h b/llvm/include/llvm/ADT/CachedHashString.h index ebd40e3207156..efc4fd0dd33b9 100644 --- a/llvm/include/llvm/ADT/CachedHashString.h +++ b/llvm/include/llvm/ADT/CachedHashString.h @@ -22,11 +22,12 @@ #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Compiler.h" namespace llvm { /// A container which contains a StringRef plus a precomputed hash. -class CachedHashStringRef { +class LLVM_CLASS_ABI CachedHashStringRef { const char *P; uint32_t Size; uint32_t Hash; @@ -47,7 +48,7 @@ class CachedHashStringRef { uint32_t hash() const { return Hash; } }; -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static CachedHashStringRef getEmptyKey() { return CachedHashStringRef(DenseMapInfo::getEmptyKey(), 0); } @@ -69,7 +70,7 @@ template <> struct DenseMapInfo { /// A container which contains a string, which it owns, plus a precomputed hash. /// /// We do not null-terminate the string. -class CachedHashString { +class LLVM_CLASS_ABI CachedHashString { friend struct DenseMapInfo; char *P; @@ -150,7 +151,7 @@ class CachedHashString { } }; -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static CachedHashString getEmptyKey() { return CachedHashString(CachedHashString::ConstructEmptyOrTombstoneTy(), CachedHashString::getEmptyKeyPtr()); diff --git a/llvm/include/llvm/ADT/CoalescingBitVector.h b/llvm/include/llvm/ADT/CoalescingBitVector.h index 4940bc1c2c18b..f82d4fd7588ca 100644 --- a/llvm/include/llvm/ADT/CoalescingBitVector.h +++ b/llvm/include/llvm/ADT/CoalescingBitVector.h @@ -19,6 +19,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -35,7 +36,7 @@ namespace llvm { /// performance for non-sequential find() operations. /// /// \tparam IndexT - The type of the index into the bitvector. -template class CoalescingBitVector { +template class LLVM_CLASS_ABI CoalescingBitVector { static_assert(std::is_unsigned::value, "Index must be an unsigned integer."); diff --git a/llvm/include/llvm/ADT/CombinationGenerator.h b/llvm/include/llvm/ADT/CombinationGenerator.h index 6100aa9812293..42cabbbd02bfd 100644 --- a/llvm/include/llvm/ADT/CombinationGenerator.h +++ b/llvm/include/llvm/ADT/CombinationGenerator.h @@ -37,7 +37,7 @@ namespace llvm { template -class CombinationGenerator { +class LLVM_CLASS_ABI CombinationGenerator { template struct WrappingIterator { using value_type = T; diff --git a/llvm/include/llvm/ADT/ConcurrentHashtable.h b/llvm/include/llvm/ADT/ConcurrentHashtable.h index a07688228da18..2ecc5b35121b7 100644 --- a/llvm/include/llvm/ADT/ConcurrentHashtable.h +++ b/llvm/include/llvm/ADT/ConcurrentHashtable.h @@ -15,6 +15,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Parallel.h" #include "llvm/Support/WithColor.h" @@ -73,7 +74,7 @@ namespace llvm { /// KeyDataTy items. template -class ConcurrentHashTableInfoByPtr { +class LLVM_CLASS_ABI ConcurrentHashTableInfoByPtr { public: /// \returns Hash value for the specified \p Key. static inline uint64_t getHashValue(const KeyTy &Key) { @@ -99,7 +100,7 @@ class ConcurrentHashTableInfoByPtr { template > -class ConcurrentHashTableByPtr { +class LLVM_CLASS_ABI ConcurrentHashTableByPtr { public: ConcurrentHashTableByPtr( AllocatorTy &Allocator, uint64_t EstimatedSize = 100000, diff --git a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h index c3872af2a0b4e..641caa6b4e2f1 100644 --- a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h +++ b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h @@ -8,6 +8,7 @@ #ifndef LLVM_ADT_DAGDELTAALGORITHM_H #define LLVM_ADT_DAGDELTAALGORITHM_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -35,7 +36,7 @@ namespace llvm { /// substantially fewer tests with appropriate dependencies. \see DeltaAlgorithm /// for more information on the properties which the predicate function itself /// should satisfy. -class DAGDeltaAlgorithm { +class LLVM_CLASS_ABI DAGDeltaAlgorithm { virtual void anchor(); public: diff --git a/llvm/include/llvm/ADT/DeltaAlgorithm.h b/llvm/include/llvm/ADT/DeltaAlgorithm.h index e1743fd001968..e6647539ee907 100644 --- a/llvm/include/llvm/ADT/DeltaAlgorithm.h +++ b/llvm/include/llvm/ADT/DeltaAlgorithm.h @@ -8,6 +8,7 @@ #ifndef LLVM_ADT_DELTAALGORITHM_H #define LLVM_ADT_DELTAALGORITHM_H +#include "llvm/Support/Compiler.h" #include #include @@ -32,7 +33,7 @@ namespace llvm { /// requirements, and the algorithm will generally produce reasonable /// results. However, it may run substantially more tests than with a good /// predicate. -class DeltaAlgorithm { +class LLVM_CLASS_ABI DeltaAlgorithm { public: using change_ty = unsigned; // FIXME: Use a decent data structure. diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index 3ef6a7cd1b4b5..075240b3301cf 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -39,7 +39,7 @@ namespace detail { // We extend a pair to allow users to override the bucket type with their own // implementation without requiring two members. template -struct DenseMapPair : public std::pair { +struct LLVM_CLASS_ABI DenseMapPair : public std::pair { using std::pair::pair; KeyT &getFirst() { return std::pair::first; } @@ -58,7 +58,7 @@ class DenseMapIterator; template -class DenseMapBase : public DebugEpochBase { +class LLVM_CLASS_ABI DenseMapBase : public DebugEpochBase { template using const_arg_type_t = typename const_pointer_or_const_ref::type; @@ -738,7 +738,7 @@ bool operator!=( template , typename BucketT = llvm::detail::DenseMapPair> -class DenseMap : public DenseMapBase, +class LLVM_CLASS_ABI DenseMap : public DenseMapBase, KeyT, ValueT, KeyInfoT, BucketT> { friend class DenseMapBase; @@ -904,7 +904,7 @@ class DenseMap : public DenseMapBase, template , typename BucketT = llvm::detail::DenseMapPair> -class SmallDenseMap +class LLVM_CLASS_ABI SmallDenseMap : public DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT> { @@ -1218,7 +1218,7 @@ class SmallDenseMap template -class DenseMapIterator : DebugEpochBase::HandleBase { +class LLVM_CLASS_ABI DenseMapIterator : DebugEpochBase::HandleBase { friend class DenseMapIterator; friend class DenseMapIterator; diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h index 5b7dce7b53c62..5f19061d289da 100644 --- a/llvm/include/llvm/ADT/DenseMapInfo.h +++ b/llvm/include/llvm/ADT/DenseMapInfo.h @@ -14,6 +14,7 @@ #ifndef LLVM_ADT_DENSEMAPINFO_H #define LLVM_ADT_DENSEMAPINFO_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -47,7 +48,7 @@ static inline unsigned combineHashValue(unsigned a, unsigned b) { /// in derived DenseMapInfo specializations; in non-SFINAE use cases this should /// just be `void`. template -struct DenseMapInfo { +struct LLVM_CLASS_ABI DenseMapInfo { //static inline T getEmptyKey(); //static inline T getTombstoneKey(); //static unsigned getHashValue(const T &Val); @@ -60,7 +61,7 @@ struct DenseMapInfo { // declared key types. Assume that no pointer key type requires more than 4096 // bytes of alignment. template -struct DenseMapInfo { +struct LLVM_CLASS_ABI DenseMapInfo { // The following should hold, but it would require T to be complete: // static_assert(alignof(T) <= (1 << Log2MaxAlign), // "DenseMap does not support pointer keys requiring more than " @@ -88,7 +89,7 @@ struct DenseMapInfo { }; // Provide DenseMapInfo for chars. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline char getEmptyKey() { return ~0; } static inline char getTombstoneKey() { return ~0 - 1; } static unsigned getHashValue(const char& Val) { return Val * 37U; } @@ -99,7 +100,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for unsigned chars. -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline unsigned char getEmptyKey() { return ~0; } static inline unsigned char getTombstoneKey() { return ~0 - 1; } static unsigned getHashValue(const unsigned char &Val) { return Val * 37U; } @@ -110,7 +111,7 @@ template <> struct DenseMapInfo { }; // Provide DenseMapInfo for unsigned shorts. -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline unsigned short getEmptyKey() { return 0xFFFF; } static inline unsigned short getTombstoneKey() { return 0xFFFF - 1; } static unsigned getHashValue(const unsigned short &Val) { return Val * 37U; } @@ -121,7 +122,7 @@ template <> struct DenseMapInfo { }; // Provide DenseMapInfo for unsigned ints. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline unsigned getEmptyKey() { return ~0U; } static inline unsigned getTombstoneKey() { return ~0U - 1; } static unsigned getHashValue(const unsigned& Val) { return Val * 37U; } @@ -132,7 +133,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for unsigned longs. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline unsigned long getEmptyKey() { return ~0UL; } static inline unsigned long getTombstoneKey() { return ~0UL - 1L; } @@ -146,7 +147,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for unsigned long longs. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline unsigned long long getEmptyKey() { return ~0ULL; } static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; } @@ -161,7 +162,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for shorts. -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline short getEmptyKey() { return 0x7FFF; } static inline short getTombstoneKey() { return -0x7FFF - 1; } static unsigned getHashValue(const short &Val) { return Val * 37U; } @@ -169,7 +170,7 @@ template <> struct DenseMapInfo { }; // Provide DenseMapInfo for ints. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline int getEmptyKey() { return 0x7fffffff; } static inline int getTombstoneKey() { return -0x7fffffff - 1; } static unsigned getHashValue(const int& Val) { return (unsigned)(Val * 37U); } @@ -180,7 +181,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for longs. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline long getEmptyKey() { return (1UL << (sizeof(long) * 8 - 1)) - 1UL; } @@ -197,7 +198,7 @@ template<> struct DenseMapInfo { }; // Provide DenseMapInfo for long longs. -template<> struct DenseMapInfo { +template<> struct LLVM_CLASS_ABI DenseMapInfo { static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; } static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; } @@ -213,7 +214,7 @@ template<> struct DenseMapInfo { // Provide DenseMapInfo for all pairs whose members have info. template -struct DenseMapInfo> { +struct LLVM_CLASS_ABI DenseMapInfo> { using Pair = std::pair; using FirstInfo = DenseMapInfo; using SecondInfo = DenseMapInfo; @@ -248,7 +249,7 @@ struct DenseMapInfo> { }; // Provide DenseMapInfo for all tuples whose members have info. -template struct DenseMapInfo> { +template struct LLVM_CLASS_ABI DenseMapInfo> { using Tuple = std::tuple; static inline Tuple getEmptyKey() { diff --git a/llvm/include/llvm/ADT/DenseMapInfoVariant.h b/llvm/include/llvm/ADT/DenseMapInfoVariant.h index a97f9b9566c81..33faab3044f80 100644 --- a/llvm/include/llvm/ADT/DenseMapInfoVariant.h +++ b/llvm/include/llvm/ADT/DenseMapInfoVariant.h @@ -21,7 +21,7 @@ namespace llvm { // Provide DenseMapInfo for variants whose all alternatives have DenseMapInfo. -template struct DenseMapInfo> { +template struct LLVM_CLASS_ABI DenseMapInfo> { using Variant = std::variant; using FirstT = std::variant_alternative_t<0, Variant>; diff --git a/llvm/include/llvm/ADT/DenseSet.h b/llvm/include/llvm/ADT/DenseSet.h index b89c88626e43b..c43aa8840fcb4 100644 --- a/llvm/include/llvm/ADT/DenseSet.h +++ b/llvm/include/llvm/ADT/DenseSet.h @@ -16,6 +16,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/type_traits.h" #include @@ -27,11 +28,11 @@ namespace llvm { namespace detail { -struct DenseSetEmpty {}; +struct LLVM_CLASS_ABI DenseSetEmpty {}; // Use the empty base class trick so we can create a DenseMap where the buckets // contain only a single item. -template class DenseSetPair : public DenseSetEmpty { +template class LLVM_CLASS_ABI DenseSetPair : public DenseSetEmpty { KeyT key; public: @@ -51,7 +52,7 @@ template class DenseSetPair : public DenseSetEmpty { /// or the equivalent SmallDenseMap type. ValueInfoT must implement the /// DenseMapInfo "concept". template -class DenseSetImpl { +class LLVM_CLASS_ABI DenseSetImpl { static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT), "DenseMap buckets unexpectedly large!"); MapTy TheMap; @@ -265,7 +266,7 @@ bool operator!=(const DenseSetImpl &LHS, /// Implements a dense probed hash-table based set. template > -class DenseSet : public detail::DenseSetImpl< +class LLVM_CLASS_ABI DenseSet : public detail::DenseSetImpl< ValueT, DenseMap>, ValueInfoT> { @@ -283,7 +284,7 @@ class DenseSet : public detail::DenseSetImpl< /// stored inline. template > -class SmallDenseSet +class LLVM_CLASS_ABI SmallDenseSet : public detail::DenseSetImpl< ValueT, SmallDenseMap>, diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h index 71053c2d0d8a8..df5d5dac21611 100644 --- a/llvm/include/llvm/ADT/DepthFirstIterator.h +++ b/llvm/include/llvm/ADT/DepthFirstIterator.h @@ -37,6 +37,7 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -47,13 +48,13 @@ namespace llvm { // df_iterator_storage - A private class which is used to figure out where to // store the visited set. template // Non-external set -class df_iterator_storage { +class LLVM_CLASS_ABI df_iterator_storage { public: SetType Visited; }; template -class df_iterator_storage { +class LLVM_CLASS_ABI df_iterator_storage { public: df_iterator_storage(SetType &VSet) : Visited(VSet) {} df_iterator_storage(const df_iterator_storage &S) : Visited(S.Visited) {} @@ -66,7 +67,7 @@ class df_iterator_storage { // node have been processed. It is intended to distinguish of back and // cross edges in the spanning tree but is not used in the common case. template -struct df_iterator_default_set : public SmallPtrSet { +struct LLVM_CLASS_ABI df_iterator_default_set : public SmallPtrSet { using BaseSet = SmallPtrSet; using iterator = typename BaseSet::iterator; @@ -82,7 +83,7 @@ template ::NodeRef>, bool ExtStorage = false, class GT = GraphTraits> -class df_iterator : public df_iterator_storage { +class LLVM_CLASS_ABI df_iterator : public df_iterator_storage { public: using iterator_category = std::forward_iterator_tag; using value_type = typename GT::NodeRef; @@ -232,7 +233,7 @@ iterator_range> depth_first(const T& G) { // Provide global definitions of external depth first iterators... template ::NodeRef>> -struct df_ext_iterator : public df_iterator { +struct LLVM_CLASS_ABI df_ext_iterator : public df_iterator { df_ext_iterator(const df_iterator &V) : df_iterator(V) {} }; @@ -258,7 +259,7 @@ template ::NodeRef>, bool External = false> -struct idf_iterator : public df_iterator, SetTy, External> { +struct LLVM_CLASS_ABI idf_iterator : public df_iterator, SetTy, External> { idf_iterator(const df_iterator, SetTy, External> &V) : df_iterator, SetTy, External>(V) {} }; @@ -281,7 +282,7 @@ iterator_range> inverse_depth_first(const T& G) { // Provide global definitions of external inverse depth first iterators... template ::NodeRef>> -struct idf_ext_iterator : public idf_iterator { +struct LLVM_CLASS_ABI idf_ext_iterator : public idf_iterator { idf_ext_iterator(const idf_iterator &V) : idf_iterator(V) {} idf_ext_iterator(const df_iterator, SetTy, true> &V) diff --git a/llvm/include/llvm/ADT/DirectedGraph.h b/llvm/include/llvm/ADT/DirectedGraph.h index 83c0bea6393c4..55c79f73338b6 100644 --- a/llvm/include/llvm/ADT/DirectedGraph.h +++ b/llvm/include/llvm/ADT/DirectedGraph.h @@ -18,6 +18,7 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -25,7 +26,7 @@ namespace llvm { /// Represent an edge in the directed graph. /// The edge contains the target node it connects to. -template class DGEdge { +template class LLVM_CLASS_ABI DGEdge { public: DGEdge() = delete; /// Create an edge pointing to the given node \p N. @@ -70,7 +71,7 @@ template class DGEdge { /// Represent a node in the directed graph. /// The node has a (possibly empty) list of outgoing edges. -template class DGNode { +template class LLVM_CLASS_ABI DGNode { public: using EdgeListTy = SetVector; using iterator = typename EdgeListTy::iterator; @@ -170,7 +171,7 @@ template class DGNode { /// The graph is represented by a table of nodes. /// Each node contains a (possibly empty) list of outgoing edges. /// Each edge contains the target node it connects to. -template class DirectedGraph { +template class LLVM_CLASS_ABI DirectedGraph { protected: using NodeListTy = SmallVector; using EdgeListTy = SmallVector; diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h index fd0700c8e408a..2249313addb8f 100644 --- a/llvm/include/llvm/ADT/EnumeratedArray.h +++ b/llvm/include/llvm/ADT/EnumeratedArray.h @@ -15,6 +15,7 @@ #ifndef LLVM_ADT_ENUMERATEDARRAY_H #define LLVM_ADT_ENUMERATEDARRAY_H +#include "llvm/Support/Compiler.h" #include #include @@ -23,7 +24,7 @@ namespace llvm { template (LargestEnum)> -class EnumeratedArray { +class LLVM_CLASS_ABI EnumeratedArray { public: using iterator = ValueType *; using const_iterator = const ValueType *; diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h index fc41d6f2c92d2..24e8af5490fa4 100644 --- a/llvm/include/llvm/ADT/EpochTracker.h +++ b/llvm/include/llvm/ADT/EpochTracker.h @@ -17,6 +17,7 @@ #define LLVM_ADT_EPOCHTRACKER_H #include "llvm/Config/abi-breaking.h" +#include "llvm/Support/Compiler.h" #include @@ -85,7 +86,7 @@ class DebugEpochBase { #define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE #endif // _MSC_VER -class DebugEpochBase { +class LLVM_CLASS_ABI DebugEpochBase { public: void incrementEpoch() {} diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h index 4f98b84cf97d2..060651f1bda01 100644 --- a/llvm/include/llvm/ADT/EquivalenceClasses.h +++ b/llvm/include/llvm/ADT/EquivalenceClasses.h @@ -15,6 +15,7 @@ #ifndef LLVM_ADT_EQUIVALENCECLASSES_H #define LLVM_ADT_EQUIVALENCECLASSES_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -57,7 +58,7 @@ namespace llvm { /// 5 1 2 /// template > -class EquivalenceClasses { +class LLVM_CLASS_ABI EquivalenceClasses { /// ECValue - The EquivalenceClasses data structure is just a set of these. /// Each of these represents a relation for a value. First it stores the /// value itself, which provides the ordering that the set queries. Next, it diff --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h index 468de085d1bed..430270b8000ca 100644 --- a/llvm/include/llvm/ADT/FloatingPointMode.h +++ b/llvm/include/llvm/ADT/FloatingPointMode.h @@ -17,6 +17,7 @@ #include "llvm/ADT/BitmaskEnum.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" namespace llvm { @@ -67,7 +68,7 @@ inline raw_ostream &operator << (raw_ostream &OS, RoundingMode RM) { /// Represent subnormal handling kind for floating point instruction inputs and /// outputs. -struct DenormalMode { +struct LLVM_CLASS_ABI DenormalMode { /// Represent handled modes for denormal (aka subnormal) modes in the floating /// point environment. enum DenormalModeKind : int8_t { @@ -267,17 +268,17 @@ enum FPClassTest : unsigned { LLVM_DECLARE_ENUM_AS_BITMASK(FPClassTest, /* LargestValue */ fcPosInf); /// Return the test mask which returns true if the value's sign bit is flipped. -FPClassTest fneg(FPClassTest Mask); +LLVM_FUNC_ABI FPClassTest fneg(FPClassTest Mask); /// Return the test mask which returns true after fabs is applied to the value. -FPClassTest inverse_fabs(FPClassTest Mask); +LLVM_FUNC_ABI FPClassTest inverse_fabs(FPClassTest Mask); /// Return the test mask which returns true if the value could have the same set /// of classes, but with a different sign. -FPClassTest unknown_sign(FPClassTest Mask); +LLVM_FUNC_ABI FPClassTest unknown_sign(FPClassTest Mask); /// Write a human readable form of \p Mask to \p OS -raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask); +LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask); } // namespace llvm diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h index f82eabd5044b2..0ab96a67520df 100644 --- a/llvm/include/llvm/ADT/FoldingSet.h +++ b/llvm/include/llvm/ADT/FoldingSet.h @@ -21,6 +21,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -113,7 +114,7 @@ class StringRef; /// in the bucket via a singly linked list. The last node in the list points /// back to the bucket to facilitate node removal. /// -class FoldingSetBase { +class LLVM_CLASS_ABI FoldingSetBase { protected: /// Buckets - Array of bucket chains. void **Buckets; @@ -229,7 +230,7 @@ class FoldingSetBase { /// DefaultFoldingSetTrait - This class provides default implementations /// for FoldingSetTrait implementations. -template struct DefaultFoldingSetTrait { +template struct LLVM_CLASS_ABI DefaultFoldingSetTrait { static void Profile(const T &X, FoldingSetNodeID &ID) { X.Profile(ID); } @@ -259,12 +260,12 @@ template struct DefaultFoldingSetTrait { /// types. Combined with the FoldingSetNodeWrapper class, one can add objects /// to FoldingSets that were not originally designed to have that behavior. template -struct FoldingSetTrait : public DefaultFoldingSetTrait {}; +struct LLVM_CLASS_ABI FoldingSetTrait : public DefaultFoldingSetTrait {}; /// DefaultContextualFoldingSetTrait - Like DefaultFoldingSetTrait, but /// for ContextualFoldingSets. template -struct DefaultContextualFoldingSetTrait { +struct LLVM_CLASS_ABI DefaultContextualFoldingSetTrait { static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) { X.Profile(ID, Context); } @@ -277,7 +278,7 @@ struct DefaultContextualFoldingSetTrait { /// ContextualFoldingSetTrait - Like FoldingSetTrait, but for /// ContextualFoldingSets. -template struct ContextualFoldingSetTrait +template struct LLVM_CLASS_ABI ContextualFoldingSetTrait : public DefaultContextualFoldingSetTrait {}; //===--------------------------------------------------------------------===// @@ -286,7 +287,7 @@ template struct ContextualFoldingSetTrait /// than using plain FoldingSetNodeIDs, since the 32-element SmallVector /// is often much larger than necessary, and the possibility of heap /// allocation means it requires a non-trivial destructor call. -class FoldingSetNodeIDRef { +class LLVM_CLASS_ABI FoldingSetNodeIDRef { const unsigned *Data = nullptr; size_t Size = 0; @@ -316,7 +317,7 @@ class FoldingSetNodeIDRef { /// FoldingSetNodeID - This class is used to gather all the unique data bits of /// a node. When all the bits are gathered this class is used to produce a /// hash value for the node. -class FoldingSetNodeID { +class LLVM_CLASS_ABI FoldingSetNodeID { /// Bits - Vector of all the data bits that make the node unique. /// Use a SmallVector to avoid a heap allocation in the common case. SmallVector Bits; @@ -433,7 +434,7 @@ DefaultContextualFoldingSetTrait::ComputeHash(T &X, //===----------------------------------------------------------------------===// /// FoldingSetImpl - An implementation detail that lets us share code between /// FoldingSet and ContextualFoldingSet. -template class FoldingSetImpl : public FoldingSetBase { +template class LLVM_CLASS_ABI FoldingSetImpl : public FoldingSetBase { protected: explicit FoldingSetImpl(unsigned Log2InitSize) : FoldingSetBase(Log2InitSize) {} @@ -518,7 +519,7 @@ template class FoldingSetImpl : public FoldingSetBase { /// move-assigning and destroying. This is primarily to enable movable APIs /// that incorporate these objects. template -class FoldingSet : public FoldingSetImpl, T> { +class LLVM_CLASS_ABI FoldingSet : public FoldingSetImpl, T> { using Super = FoldingSetImpl; using Node = typename Super::Node; @@ -570,7 +571,7 @@ class FoldingSet : public FoldingSetImpl, T> { /// function with signature /// void Profile(FoldingSetNodeID &, Ctx); template -class ContextualFoldingSet +class LLVM_CLASS_ABI ContextualFoldingSet : public FoldingSetImpl, T> { // Unfortunately, this can't derive from FoldingSet because the // construction of the vtable for FoldingSet requires @@ -629,7 +630,7 @@ class ContextualFoldingSet /// order based on the insertion order. T must be a subclass of FoldingSetNode /// and implement a Profile function. template > -class FoldingSetVector { +class LLVM_CLASS_ABI FoldingSetVector { FoldingSet Set; VectorT Vector; @@ -690,7 +691,7 @@ class FoldingSetVector { //===----------------------------------------------------------------------===// /// FoldingSetIteratorImpl - This is the common iterator support shared by all /// folding sets, which knows how to walk the folding set hash table. -class FoldingSetIteratorImpl { +class LLVM_CLASS_ABI FoldingSetIteratorImpl { protected: FoldingSetNode *NodePtr; @@ -707,7 +708,7 @@ class FoldingSetIteratorImpl { } }; -template class FoldingSetIterator : public FoldingSetIteratorImpl { +template class LLVM_CLASS_ABI FoldingSetIterator : public FoldingSetIteratorImpl { public: explicit FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {} @@ -732,7 +733,7 @@ template class FoldingSetIterator : public FoldingSetIteratorImpl { /// FoldingSetBucketIteratorImpl - This is the common bucket iterator support /// shared by all folding sets, which knows how to walk a particular bucket /// of a folding set hash table. -class FoldingSetBucketIteratorImpl { +class LLVM_CLASS_ABI FoldingSetBucketIteratorImpl { protected: void *Ptr; @@ -756,7 +757,7 @@ class FoldingSetBucketIteratorImpl { }; template -class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { +class LLVM_CLASS_ABI FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { public: explicit FoldingSetBucketIterator(void **Bucket) : FoldingSetBucketIteratorImpl(Bucket) {} @@ -780,7 +781,7 @@ class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { /// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary /// types in an enclosing object so that they can be inserted into FoldingSets. template -class FoldingSetNodeWrapper : public FoldingSetNode { +class LLVM_CLASS_ABI FoldingSetNodeWrapper : public FoldingSetNode { T data; public: @@ -803,7 +804,7 @@ class FoldingSetNodeWrapper : public FoldingSetNode { /// each time it is needed. This trades space for speed (which can be /// significant if the ID is long), and it also permits nodes to drop /// information that would otherwise only be required for recomputing an ID. -class FastFoldingSetNode : public FoldingSetNode { +class LLVM_CLASS_ABI FastFoldingSetNode : public FoldingSetNode { FoldingSetNodeID FastID; protected: @@ -816,13 +817,13 @@ class FastFoldingSetNode : public FoldingSetNode { //===----------------------------------------------------------------------===// // Partial specializations of FoldingSetTrait. -template struct FoldingSetTrait { +template struct LLVM_CLASS_ABI FoldingSetTrait { static inline void Profile(T *X, FoldingSetNodeID &ID) { ID.AddPointer(X); } }; template -struct FoldingSetTrait> { +struct LLVM_CLASS_ABI FoldingSetTrait> { static inline void Profile(const std::pair &P, FoldingSetNodeID &ID) { ID.Add(P.first); @@ -831,7 +832,7 @@ struct FoldingSetTrait> { }; template -struct FoldingSetTrait::value>> { +struct LLVM_CLASS_ABI FoldingSetTrait::value>> { static void Profile(const T &X, FoldingSetNodeID &ID) { ID.AddInteger(llvm::to_underlying(X)); } diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h index 4cf1de488c7bd..5a1e6ed25ded1 100644 --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -35,6 +35,7 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/STLForwardCompat.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MemAlloc.h" #include "llvm/Support/type_traits.h" #include @@ -76,7 +77,7 @@ using EnableIfCallable = std::enable_if_t()...)), Ret>>::value>; -template class UniqueFunctionBase { +template class LLVM_CLASS_ABI UniqueFunctionBase { protected: static constexpr size_t InlineStorageSize = sizeof(void *) * 3; @@ -359,7 +360,7 @@ typename UniqueFunctionBase::TrivialCallback } // namespace detail template -class unique_function : public detail::UniqueFunctionBase { +class LLVM_CLASS_ABI unique_function : public detail::UniqueFunctionBase { using Base = detail::UniqueFunctionBase; public: @@ -384,7 +385,7 @@ class unique_function : public detail::UniqueFunctionBase { }; template -class unique_function +class LLVM_CLASS_ABI unique_function : public detail::UniqueFunctionBase { using Base = detail::UniqueFunctionBase; diff --git a/llvm/include/llvm/ADT/GenericCycleImpl.h b/llvm/include/llvm/ADT/GenericCycleImpl.h index 74faff98b9033..d0799b5cca5ae 100644 --- a/llvm/include/llvm/ADT/GenericCycleImpl.h +++ b/llvm/include/llvm/ADT/GenericCycleImpl.h @@ -26,6 +26,7 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/GenericCycleInfo.h" +#include "llvm/Support/Compiler.h" #define DEBUG_TYPE "generic-cycle-impl" diff --git a/llvm/include/llvm/ADT/GenericCycleInfo.h b/llvm/include/llvm/ADT/GenericCycleInfo.h index 83c4c2759d468..fa3455ca5ef54 100644 --- a/llvm/include/llvm/ADT/GenericCycleInfo.h +++ b/llvm/include/llvm/ADT/GenericCycleInfo.h @@ -32,6 +32,7 @@ #include "llvm/ADT/GenericSSAContext.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SetVector.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -41,7 +42,7 @@ template class GenericCycleInfo; template class GenericCycleInfoCompute; /// A possibly irreducible generalization of a \ref Loop. -template class GenericCycle { +template class LLVM_CLASS_ABI GenericCycle { public: using BlockT = typename ContextT::BlockT; using FunctionT = typename ContextT::FunctionT; @@ -219,7 +220,7 @@ template class GenericCycle { }; /// \brief Cycle information for a function. -template class GenericCycleInfo { +template class LLVM_CLASS_ABI GenericCycleInfo { public: using BlockT = typename ContextT::BlockT; using CycleT = GenericCycle; @@ -314,7 +315,7 @@ template class GenericCycleInfo { }; /// \brief GraphTraits for iterating over a sub-tree of the CycleT tree. -template struct CycleGraphTraits { +template struct LLVM_CLASS_ABI CycleGraphTraits { using NodeRef = CycleRefT; using nodes_iterator = ChildIteratorT; @@ -349,11 +350,11 @@ template struct CycleGraphTraits { }; template -struct GraphTraits *> +struct LLVM_CLASS_ABI GraphTraits *> : CycleGraphTraits *, typename GenericCycle::const_child_iterator> {}; template -struct GraphTraits *> +struct LLVM_CLASS_ABI GraphTraits *> : CycleGraphTraits *, typename GenericCycle::const_child_iterator> {}; diff --git a/llvm/include/llvm/ADT/GenericSSAContext.h b/llvm/include/llvm/ADT/GenericSSAContext.h index 6aa3a8b9b6e0b..aed7f892ca074 100644 --- a/llvm/include/llvm/ADT/GenericSSAContext.h +++ b/llvm/include/llvm/ADT/GenericSSAContext.h @@ -17,6 +17,7 @@ #ifndef LLVM_ADT_GENERICSSACONTEXT_H #define LLVM_ADT_GENERICSSACONTEXT_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/Printable.h" namespace llvm { @@ -38,7 +39,7 @@ template struct GenericSSATraits; // // We use FunctionT as a template argument and not GenericSSATraits to allow // forward declarations using well-known typenames. -template class GenericSSAContext { +template class LLVM_CLASS_ABI GenericSSAContext { using SSATraits = GenericSSATraits<_FunctionT>; const typename SSATraits::FunctionT *F; diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h index b7d0a1228ebfc..1af97cb7ba3ff 100644 --- a/llvm/include/llvm/ADT/GenericUniformityImpl.h +++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h @@ -43,6 +43,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SparseBitVector.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/include/llvm/ADT/GenericUniformityInfo.h b/llvm/include/llvm/ADT/GenericUniformityInfo.h index e53afccc020b4..44bcef836acc9 100644 --- a/llvm/include/llvm/ADT/GenericUniformityInfo.h +++ b/llvm/include/llvm/ADT/GenericUniformityInfo.h @@ -10,6 +10,7 @@ #define LLVM_ADT_GENERICUNIFORMITYINFO_H #include "llvm/ADT/GenericCycleInfo.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" namespace llvm { diff --git a/llvm/include/llvm/ADT/GraphTraits.h b/llvm/include/llvm/ADT/GraphTraits.h index 3a7773592af3d..8f5bed0c3cc4d 100644 --- a/llvm/include/llvm/ADT/GraphTraits.h +++ b/llvm/include/llvm/ADT/GraphTraits.h @@ -20,6 +20,7 @@ #define LLVM_ADT_GRAPHTRAITS_H #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" namespace llvm { @@ -34,7 +35,7 @@ namespace llvm { // be achieved by carrying more data in NodeRef. See LoopBodyTraits for one // example. template -struct GraphTraits { +struct LLVM_CLASS_ABI GraphTraits { // Elements to provide: // typedef NodeRef - Type of Node token in the graph, which should @@ -94,7 +95,7 @@ struct GraphTraits { // for (; I != E; ++I) { ... } // template -struct Inverse { +struct LLVM_CLASS_ABI Inverse { const GraphType &Graph; inline Inverse(const GraphType &G) : Graph(G) {} @@ -102,7 +103,7 @@ struct Inverse { // Provide a partial specialization of GraphTraits so that the inverse of an // inverse falls back to the original graph. -template struct GraphTraits>> : GraphTraits {}; +template struct LLVM_CLASS_ABI GraphTraits>> : GraphTraits {}; // Provide iterator ranges for the graph traits nodes and children template diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h index 4e82ba9a6fba2..131dfb320a0df 100644 --- a/llvm/include/llvm/ADT/Hashing.h +++ b/llvm/include/llvm/ADT/Hashing.h @@ -44,6 +44,7 @@ #ifndef LLVM_ADT_HASHING_H #define LLVM_ADT_HASHING_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/SwapByteOrder.h" @@ -71,7 +72,7 @@ template struct DenseMapInfo; /// using llvm::hash_value; /// llvm::hash_code code = hash_value(x); /// \endcode -class hash_code { +class LLVM_CLASS_ABI hash_code { size_t value; public: @@ -140,7 +141,7 @@ template hash_code hash_value(const std::optional &arg); /// undone. This makes it thread-hostile and very hard to use outside of /// immediately on start of a simple program designed for reproducible /// behavior. -void set_fixed_execution_hash_seed(uint64_t fixed_value); +LLVM_FUNC_ABI void set_fixed_execution_hash_seed(uint64_t fixed_value); // All of the implementation details of actually computing the various hash @@ -265,7 +266,7 @@ inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) { /// The intermediate state used during hashing. /// Currently, the algorithm for computing hash codes is based on CityHash and /// keeps 56 bytes of arbitrary state. -struct hash_state { +struct LLVM_CLASS_ABI hash_state { uint64_t h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0; /// Create a new hash_state structure and initialize it based on the @@ -328,7 +329,7 @@ struct hash_state { /// This variable can be set using the \see llvm::set_fixed_execution_seed /// function. See that function for details. Do not, under any circumstances, /// set or read this variable. -extern uint64_t fixed_seed_override; +LLVM_FUNC_ABI extern uint64_t fixed_seed_override; inline uint64_t get_execution_seed() { // FIXME: This needs to be a per-execution seed. This is just a placeholder @@ -355,7 +356,7 @@ inline uint64_t get_execution_seed() { // for equality. For all the platforms we care about, this holds for integers // and pointers, but there are platforms where it doesn't and we would like to // support user-defined types which happen to satisfy this property. -template struct is_hashable_data +template struct LLVM_CLASS_ABI is_hashable_data : std::integral_constant::value || std::is_pointer::value) && 64 % sizeof(T) == 0)> {}; @@ -364,7 +365,7 @@ template struct is_hashable_data // is no alignment-derived padding in the pair. This is a bit of a lie because // std::pair isn't truly POD, but it's close enough in all reasonable // implementations for our use case of hashing the underlying data. -template struct is_hashable_data > +template struct LLVM_CLASS_ABI is_hashable_data > : std::integral_constant::value && is_hashable_data::value && (sizeof(T) + sizeof(U)) == @@ -504,7 +505,7 @@ namespace detail { /// recursive combining of arguments used in hash_combine. It is particularly /// useful at minimizing the code in the recursive calls to ease the pain /// caused by a lack of variadic functions. -struct hash_combine_recursive_helper { +struct LLVM_CLASS_ABI hash_combine_recursive_helper { char buffer[64] = {}; hash_state state; const uint64_t seed; @@ -674,7 +675,7 @@ template hash_code hash_value(const std::optional &arg) { return arg ? hash_combine(true, *arg) : hash_value(false); } -template <> struct DenseMapInfo { +template <> struct LLVM_CLASS_ABI DenseMapInfo { static inline hash_code getEmptyKey() { return hash_code(-1); } static inline hash_code getTombstoneKey() { return hash_code(-2); } static unsigned getHashValue(hash_code val) { return val; } @@ -687,7 +688,7 @@ template <> struct DenseMapInfo { namespace std { template<> -struct hash { +struct LLVM_CLASS_ABI hash { size_t operator()(llvm::hash_code const& Val) const { return Val; } diff --git a/llvm/include/llvm/ADT/ImmutableList.h b/llvm/include/llvm/ADT/ImmutableList.h index 0b6f5e4d16368..c977b5ceccc7f 100644 --- a/llvm/include/llvm/ADT/ImmutableList.h +++ b/llvm/include/llvm/ADT/ImmutableList.h @@ -25,7 +25,7 @@ namespace llvm { template class ImmutableListFactory; template -class ImmutableListImpl : public FoldingSetNode { +class LLVM_CLASS_ABI ImmutableListImpl : public FoldingSetNode { friend class ImmutableListFactory; T Head; @@ -62,7 +62,7 @@ class ImmutableListImpl : public FoldingSetNode { /// of a group of lists. When the factory object is reclaimed, all lists /// created by that factory are released as well. template -class ImmutableList { +class LLVM_CLASS_ABI ImmutableList { public: using value_type = T; using Factory = ImmutableListFactory; @@ -147,7 +147,7 @@ class ImmutableList { }; template -class ImmutableListFactory { +class LLVM_CLASS_ABI ImmutableListFactory { using ListTy = ImmutableListImpl; using CacheTy = FoldingSet; @@ -221,7 +221,7 @@ class ImmutableListFactory { // Partially-specialized Traits. //===----------------------------------------------------------------------===// -template struct DenseMapInfo, void> { +template struct LLVM_CLASS_ABI DenseMapInfo, void> { static inline ImmutableList getEmptyKey() { return reinterpret_cast*>(-1); } diff --git a/llvm/include/llvm/ADT/ImmutableMap.h b/llvm/include/llvm/ADT/ImmutableMap.h index 3d19ca41a5be0..6fe6c01fb68ae 100644 --- a/llvm/include/llvm/ADT/ImmutableMap.h +++ b/llvm/include/llvm/ADT/ImmutableMap.h @@ -25,7 +25,7 @@ namespace llvm { /// and second elements in a pair are used to generate profile information, /// only the first element (the key) is used by isEqual and isLess. template -struct ImutKeyValueInfo { +struct LLVM_CLASS_ABI ImutKeyValueInfo { using value_type = const std::pair; using value_type_ref = const value_type&; using key_type = const T; @@ -60,7 +60,7 @@ struct ImutKeyValueInfo { template > -class ImmutableMap { +class LLVM_CLASS_ABI ImmutableMap { public: using value_type = typename ValInfo::value_type; using value_type_ref = typename ValInfo::value_type_ref; @@ -200,7 +200,7 @@ class ImmutableMap { // NOTE: This will possibly become the new implementation of ImmutableMap some day. template > -class ImmutableMapRef { +class LLVM_CLASS_ABI ImmutableMapRef { public: using value_type = typename ValInfo::value_type; using value_type_ref = typename ValInfo::value_type_ref; diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h index 5bee746688ce4..e4b0eb0fcd9f0 100644 --- a/llvm/include/llvm/ADT/ImmutableSet.h +++ b/llvm/include/llvm/ADT/ImmutableSet.h @@ -40,7 +40,7 @@ template class ImutAVLTreeInOrderIterator; template class ImutAVLTreeGenericIterator; template -class ImutAVLTree { +class LLVM_CLASS_ABI ImutAVLTree { public: using key_type_ref = typename ImutInfo::key_type_ref; using value_type = typename ImutInfo::value_type; @@ -346,7 +346,7 @@ class ImutAVLTree { }; template -struct IntrusiveRefCntPtrInfo> { +struct LLVM_CLASS_ABI IntrusiveRefCntPtrInfo> { static void retain(ImutAVLTree *Tree) { Tree->retain(); } static void release(ImutAVLTree *Tree) { Tree->release(); } }; @@ -356,7 +356,7 @@ struct IntrusiveRefCntPtrInfo> { //===----------------------------------------------------------------------===// template -class ImutAVLFactory { +class LLVM_CLASS_ABI ImutAVLFactory { friend class ImutAVLTree; using TreeTy = ImutAVLTree; @@ -638,7 +638,7 @@ class ImutAVLFactory { // Immutable AVL-Tree Iterators. //===----------------------------------------------------------------------===// -template class ImutAVLTreeGenericIterator { +template class LLVM_CLASS_ABI ImutAVLTreeGenericIterator { SmallVector stack; public: @@ -752,7 +752,7 @@ template class ImutAVLTreeGenericIterator { } }; -template class ImutAVLTreeInOrderIterator { +template class LLVM_CLASS_ABI ImutAVLTreeInOrderIterator { using InternalIteratorTy = ImutAVLTreeGenericIterator; InternalIteratorTy InternalItr; @@ -812,7 +812,7 @@ template class ImutAVLTreeInOrderIterator { /// Generic iterator that wraps a T::TreeTy::iterator and exposes /// iterator::getValue() on dereference. template -struct ImutAVLValueIterator +struct LLVM_CLASS_ABI ImutAVLValueIterator : iterator_adaptor_base< ImutAVLValueIterator, typename T::TreeTy::iterator, typename std::iterator_traits< @@ -835,7 +835,7 @@ struct ImutAVLValueIterator /// profile method of an object. Specializations for primitive integers /// and generic handling of pointers is done below. template -struct ImutProfileInfo { +struct LLVM_CLASS_ABI ImutProfileInfo { using value_type = const T; using value_type_ref = const T&; @@ -846,7 +846,7 @@ struct ImutProfileInfo { /// Profile traits for integers. template -struct ImutProfileInteger { +struct LLVM_CLASS_ABI ImutProfileInteger { using value_type = const T; using value_type_ref = const T&; @@ -873,7 +873,7 @@ PROFILE_INTEGER_INFO(unsigned long long) /// Profile traits for booleans. template <> -struct ImutProfileInfo { +struct LLVM_CLASS_ABI ImutProfileInfo { using value_type = const bool; using value_type_ref = const bool&; @@ -885,7 +885,7 @@ struct ImutProfileInfo { /// Generic profile trait for pointer types. We treat pointers as /// references to unique objects. template -struct ImutProfileInfo { +struct LLVM_CLASS_ABI ImutProfileInfo { using value_type = const T*; using value_type_ref = value_type; @@ -905,7 +905,7 @@ struct ImutProfileInfo { /// elements of immutable containers that defaults to using /// std::equal_to<> and std::less<> to perform comparison of elements. template -struct ImutContainerInfo : public ImutProfileInfo { +struct LLVM_CLASS_ABI ImutContainerInfo : public ImutProfileInfo { using value_type = typename ImutProfileInfo::value_type; using value_type_ref = typename ImutProfileInfo::value_type_ref; using key_type = value_type; @@ -931,7 +931,7 @@ struct ImutContainerInfo : public ImutProfileInfo { /// as references to unique objects. Pointers are thus compared by /// their addresses. template -struct ImutContainerInfo : public ImutProfileInfo { +struct LLVM_CLASS_ABI ImutContainerInfo : public ImutProfileInfo { using value_type = typename ImutProfileInfo::value_type; using value_type_ref = typename ImutProfileInfo::value_type_ref; using key_type = value_type; @@ -954,7 +954,7 @@ struct ImutContainerInfo : public ImutProfileInfo { //===----------------------------------------------------------------------===// template > -class ImmutableSet { +class LLVM_CLASS_ABI ImmutableSet { public: using value_type = typename ValInfo::value_type; using value_type_ref = typename ValInfo::value_type_ref; @@ -1080,7 +1080,7 @@ class ImmutableSet { // NOTE: This may some day replace the current ImmutableSet. template > -class ImmutableSetRef { +class LLVM_CLASS_ABI ImmutableSetRef { public: using value_type = typename ValInfo::value_type; using value_type_ref = typename ValInfo::value_type_ref; diff --git a/llvm/include/llvm/ADT/IndexedMap.h b/llvm/include/llvm/ADT/IndexedMap.h index b1ebbdd1bfd54..571d7bf82afce 100644 --- a/llvm/include/llvm/ADT/IndexedMap.h +++ b/llvm/include/llvm/ADT/IndexedMap.h @@ -23,12 +23,13 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/identity.h" +#include "llvm/Support/Compiler.h" #include namespace llvm { template > - class IndexedMap { + class LLVM_CLASS_ABI IndexedMap { using IndexT = typename ToIndexT::argument_type; // Prefer SmallVector with zero inline storage over std::vector. IndexedMaps // can grow very large and SmallVector grows more efficiently as long as T diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h index 9ee8a46be411e..f2080fa0ddf81 100644 --- a/llvm/include/llvm/ADT/IntEqClasses.h +++ b/llvm/include/llvm/ADT/IntEqClasses.h @@ -22,10 +22,11 @@ #define LLVM_ADT_INTEQCLASSES_H #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" namespace llvm { -class IntEqClasses { +class LLVM_CLASS_ABI IntEqClasses { /// EC - When uncompressed, map each integer to a smaller member of its /// equivalence class. The class leader is the smallest member and maps to /// itself. diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h index 99bf308772233..a1ebb800e2e08 100644 --- a/llvm/include/llvm/ADT/IntervalMap.h +++ b/llvm/include/llvm/ADT/IntervalMap.h @@ -107,6 +107,7 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/RecyclingAllocator.h" #include #include @@ -137,7 +138,7 @@ namespace llvm { //===----------------------------------------------------------------------===// template -struct IntervalMapInfo { +struct LLVM_CLASS_ABI IntervalMapInfo { /// startLess - Return true if x is not in [a;b]. /// This is x < a both for closed intervals and for [a;b) half-open intervals. static inline bool startLess(const T &x, const T &a) { @@ -164,7 +165,7 @@ struct IntervalMapInfo { }; template -struct IntervalMapHalfOpenInfo { +struct LLVM_CLASS_ABI IntervalMapHalfOpenInfo { /// startLess - Return true if x is not in [a;b). static inline bool startLess(const T &x, const T &a) { return x < a; @@ -220,7 +221,7 @@ using IdxPair = std::pair; //===----------------------------------------------------------------------===// template -class NodeBase { +class LLVM_CLASS_ABI NodeBase { public: enum { Capacity = N }; @@ -411,7 +412,7 @@ void adjustSiblingSizes(NodeT *Node[], unsigned Nodes, /// @param Position Insert position. /// @param Grow Reserve space for a new element at Position. /// @return (node, offset) for Position. -IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity, +LLVM_FUNC_ABI IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity, const unsigned *CurSize, unsigned NewSize[], unsigned Position, bool Grow); @@ -436,7 +437,7 @@ enum { }; template -struct NodeSizer { +struct LLVM_CLASS_ABI NodeSizer { enum { // Compute the leaf node branching factor that makes a node fit in three // cache lines. The branching factor must be at least 3, or some B+-tree @@ -490,7 +491,7 @@ struct NodeSizer { // //===----------------------------------------------------------------------===// -class NodeRef { +class LLVM_CLASS_ABI NodeRef { struct CacheAlignedPointerTraits { static inline void *getAsVoidPointer(void *P) { return P; } static inline void *getFromVoidPointer(void *P) { return P; } @@ -563,7 +564,7 @@ class NodeRef { //===----------------------------------------------------------------------===// template -class LeafNode : public NodeBase, ValT, N> { +class LLVM_CLASS_ABI LeafNode : public NodeBase, ValT, N> { public: const KeyT &start(unsigned i) const { return this->first[i].first; } const KeyT &stop(unsigned i) const { return this->first[i].second; } @@ -700,7 +701,7 @@ insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) { //===----------------------------------------------------------------------===// template -class BranchNode : public NodeBase { +class LLVM_CLASS_ABI BranchNode : public NodeBase { public: const KeyT &stop(unsigned i) const { return this->second[i]; } const NodeRef &subtree(unsigned i) const { return this->first[i]; } @@ -770,7 +771,7 @@ class BranchNode : public NodeBase { // //===----------------------------------------------------------------------===// -class Path { +class LLVM_CLASS_ABI Path { /// Entry - Each step in the path is a node pointer and an offset into that /// node. struct Entry { @@ -933,7 +934,7 @@ class Path { template ::LeafSize, typename Traits = IntervalMapInfo> -class IntervalMap { +class LLVM_CLASS_ABI IntervalMap { using Sizer = IntervalMapImpl::NodeSizer; using Leaf = IntervalMapImpl::LeafNode; using Branch = @@ -2107,7 +2108,7 @@ iterator::overflow(unsigned Level) { /// for (IntervalMapOverlaps I(a, b); I.valid() ; ++I) { ... } /// template -class IntervalMapOverlaps { +class LLVM_CLASS_ABI IntervalMapOverlaps { using KeyType = typename MapA::KeyType; using Traits = typename MapA::KeyTraits; diff --git a/llvm/include/llvm/ADT/IntervalTree.h b/llvm/include/llvm/ADT/IntervalTree.h index cb707bd77a64d..3dbf50089fca9 100644 --- a/llvm/include/llvm/ADT/IntervalTree.h +++ b/llvm/include/llvm/ADT/IntervalTree.h @@ -19,6 +19,7 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" #include @@ -196,7 +197,7 @@ namespace llvm { /// associated \a Value. /// \a PointT corresponds to the interval endpoints type. /// \a ValueT corresponds to the interval value type. -template class IntervalData { +template class LLVM_CLASS_ABI IntervalData { protected: using PointType = PointT; using ValueType = ValueT; @@ -246,7 +247,7 @@ using ValueTypeIsValid = std::bool_constant::value || template > -class IntervalTree { +class LLVM_CLASS_ABI IntervalTree { static_assert(PointTypeIsValid::value, "PointT must be a fundamental type"); static_assert(ValueTypeIsValid::value, diff --git a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h index 90349e02014dd..597eba1614fbd 100644 --- a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -60,6 +60,7 @@ #ifndef LLVM_ADT_INTRUSIVEREFCNTPTR_H #define LLVM_ADT_INTRUSIVEREFCNTPTR_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -73,7 +74,7 @@ namespace llvm { /// calls to Release() and Retain(), which increment and decrement the object's /// refcount, respectively. When a Release() call decrements the refcount to 0, /// the object deletes itself. -template class RefCountedBase { +template class LLVM_CLASS_ABI RefCountedBase { mutable unsigned RefCount = 0; protected: @@ -105,7 +106,7 @@ template class RefCountedBase { }; /// A thread-safe version of \c RefCountedBase. -template class ThreadSafeRefCountedBase { +template class LLVM_CLASS_ABI ThreadSafeRefCountedBase { mutable std::atomic RefCount{0}; protected: @@ -158,7 +159,7 @@ template class ThreadSafeRefCountedBase { /// forward-declares Foo and specializes IntrusiveRefCntPtrInfo. Then /// Bar.h could use IntrusiveRefCntPtr, although it still couldn't call any /// functions on Foo itself, because Foo would be an incomplete type. -template struct IntrusiveRefCntPtrInfo { +template struct LLVM_CLASS_ABI IntrusiveRefCntPtrInfo { static unsigned useCount(const T *obj) { return obj->UseCount(); } static void retain(T *obj) { obj->Retain(); } static void release(T *obj) { obj->Release(); } @@ -170,7 +171,7 @@ template struct IntrusiveRefCntPtrInfo { /// This class increments its pointee's reference count when it is created, and /// decrements its refcount when it's destroyed (or is changed to point to a /// different object). -template class IntrusiveRefCntPtr { +template class LLVM_CLASS_ABI IntrusiveRefCntPtr { T *Obj = nullptr; public: @@ -292,7 +293,7 @@ bool operator!=(const IntrusiveRefCntPtr &A, std::nullptr_t B) { // Casting.h. template struct simplify_type; -template struct simplify_type> { +template struct LLVM_CLASS_ABI simplify_type> { using SimpleType = T *; static SimpleType getSimplifiedValue(IntrusiveRefCntPtr &Val) { @@ -300,7 +301,7 @@ template struct simplify_type> { } }; -template struct simplify_type> { +template struct LLVM_CLASS_ABI simplify_type> { using SimpleType = /*const*/ T *; static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr &Val) { diff --git a/llvm/include/llvm/ADT/LazyAtomicPointer.h b/llvm/include/llvm/ADT/LazyAtomicPointer.h index 890584746220d..dbcfae9a58b0e 100644 --- a/llvm/include/llvm/ADT/LazyAtomicPointer.h +++ b/llvm/include/llvm/ADT/LazyAtomicPointer.h @@ -31,7 +31,7 @@ namespace llvm { /// /// TODO: In C++20, use std::atomic::wait() instead of spinning and call /// std::atomic::notify_all() in \a loadOrGenerate(). -template class LazyAtomicPointer { +template class LLVM_CLASS_ABI LazyAtomicPointer { static constexpr uintptr_t getNull() { return 0; } static constexpr uintptr_t getBusy() { return -1ULL; } diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h index c45779c0ce8e0..2b2637bbd05d5 100644 --- a/llvm/include/llvm/ADT/MapVector.h +++ b/llvm/include/llvm/ADT/MapVector.h @@ -19,6 +19,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -33,7 +34,7 @@ namespace llvm { template , typename VectorType = SmallVector, 0>> -class MapVector { +class LLVM_CLASS_ABI MapVector { MapType Map; VectorType Vector; @@ -228,7 +229,7 @@ void MapVector::remove_if(Function Pred) { /// A MapVector that performs no allocations if smaller than a certain /// size. template -struct SmallMapVector +struct LLVM_CLASS_ABI SmallMapVector : MapVector, SmallVector, N>> { }; diff --git a/llvm/include/llvm/ADT/PackedVector.h b/llvm/include/llvm/ADT/PackedVector.h index b448685ab6163..a92f3e6ab5f0d 100644 --- a/llvm/include/llvm/ADT/PackedVector.h +++ b/llvm/include/llvm/ADT/PackedVector.h @@ -26,7 +26,7 @@ class PackedVectorBase; // This won't be necessary if we can specialize members without specializing // the parent template. template -class PackedVectorBase { +class LLVM_CLASS_ABI PackedVectorBase { protected: static T getValue(const BitVectorTy &Bits, unsigned Idx) { T val = T(); @@ -43,7 +43,7 @@ class PackedVectorBase { }; template -class PackedVectorBase { +class LLVM_CLASS_ABI PackedVectorBase { protected: static T getValue(const BitVectorTy &Bits, unsigned Idx) { T val = T(); @@ -73,7 +73,7 @@ class PackedVectorBase { /// will create a vector accepting values -2, -1, 0, 1. Any other value will hit /// an assertion. template -class PackedVector : public PackedVectorBase::is_signed> { BitVectorTy Bits; using base = PackedVectorBase class PagedVector { +template class LLVM_CLASS_ABI PagedVector { static_assert(PageSize > 1, "PageSize must be greater than 0. Most likely " "you want it to be greater than 16."); /// The actual number of elements in the vector which can be accessed. diff --git a/llvm/include/llvm/ADT/PointerEmbeddedInt.h b/llvm/include/llvm/ADT/PointerEmbeddedInt.h index fbc48af79da1e..632bf8e218831 100644 --- a/llvm/include/llvm/ADT/PointerEmbeddedInt.h +++ b/llvm/include/llvm/ADT/PointerEmbeddedInt.h @@ -10,6 +10,7 @@ #define LLVM_ADT_POINTEREMBEDDEDINT_H #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include @@ -30,7 +31,7 @@ namespace llvm { /// in the above abstractions without testing the particular active member. /// Also, the default constructed value zero initializes the integer. template -class PointerEmbeddedInt { +class LLVM_CLASS_ABI PointerEmbeddedInt { uintptr_t Value = 0; // Note: This '<' is correct; using '<=' would result in some shifts @@ -79,7 +80,7 @@ class PointerEmbeddedInt { // Provide pointer like traits to support use with pointer unions and sum // types. template -struct PointerLikeTypeTraits> { +struct LLVM_CLASS_ABI PointerLikeTypeTraits> { using T = PointerEmbeddedInt; static inline void *getAsVoidPointer(const T &P) { @@ -100,7 +101,7 @@ struct PointerLikeTypeTraits> { // Teach DenseMap how to use PointerEmbeddedInt objects as keys if the Int type // itself can be a key. template -struct DenseMapInfo> { +struct LLVM_CLASS_ABI DenseMapInfo> { using T = PointerEmbeddedInt; using IntInfo = DenseMapInfo; diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h index f73f5bcd6ce0c..f6c9eb3366b78 100644 --- a/llvm/include/llvm/ADT/PointerIntPair.h +++ b/llvm/include/llvm/ADT/PointerIntPair.h @@ -25,7 +25,7 @@ namespace llvm { namespace detail { -template struct PunnedPointer { +template struct LLVM_CLASS_ABI PunnedPointer { static_assert(sizeof(Ptr) == sizeof(intptr_t), ""); // Asserts that allow us to let the compiler implement the destructor and @@ -77,7 +77,7 @@ struct PointerIntPairInfo; template , typename Info = PointerIntPairInfo> -class PointerIntPair { +class LLVM_CLASS_ABI PointerIntPair { // Used by MSVC visualizer and generally helpful for debugging/visualizing. using InfoTy = Info; detail::PunnedPointer Value; @@ -165,7 +165,7 @@ class PointerIntPair { }; template -struct PointerIntPairInfo { +struct LLVM_CLASS_ABI PointerIntPairInfo { static_assert(PtrTraits::NumLowBitsAvailable < std::numeric_limits::digits, "cannot use a pointer type that has all bits free"); @@ -216,7 +216,7 @@ struct PointerIntPairInfo { // Provide specialization of DenseMapInfo for PointerIntPair. template -struct DenseMapInfo, void> { +struct LLVM_CLASS_ABI DenseMapInfo, void> { using Ty = PointerIntPair; static Ty getEmptyKey() { @@ -242,7 +242,7 @@ struct DenseMapInfo, void> { // Teach SmallPtrSet that PointerIntPair is "basically a pointer". template -struct PointerLikeTypeTraits< +struct LLVM_CLASS_ABI PointerLikeTypeTraits< PointerIntPair> { static inline void * getAsVoidPointer(const PointerIntPair &P) { @@ -280,13 +280,13 @@ get(const PointerIntPair &Pair) { namespace std { template -struct tuple_size< +struct LLVM_CLASS_ABI tuple_size< llvm::PointerIntPair> : std::integral_constant {}; template -struct tuple_element< +struct LLVM_CLASS_ABI tuple_element< I, llvm::PointerIntPair> : std::conditional {}; } // namespace std diff --git a/llvm/include/llvm/ADT/PointerSumType.h b/llvm/include/llvm/ADT/PointerSumType.h index 57f045035a784..d6da023f9515c 100644 --- a/llvm/include/llvm/ADT/PointerSumType.h +++ b/llvm/include/llvm/ADT/PointerSumType.h @@ -11,6 +11,7 @@ #include "llvm/ADT/bit.h" #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include #include @@ -24,7 +25,7 @@ namespace llvm { /// allocation. template > -struct PointerSumTypeMember { +struct LLVM_CLASS_ABI PointerSumTypeMember { enum { Tag = N }; using PointerT = PointerArgT; using TraitsT = TraitsArgT; @@ -67,7 +68,7 @@ template struct PointerSumTypeHelper; /// /// There is no support for constructing or accessing with a dynamic tag as /// that would fundamentally violate the type safety provided by the sum type. -template class PointerSumType { +template class LLVM_CLASS_ABI PointerSumType { using HelperT = detail::PointerSumTypeHelper; // We keep both the raw value and the min tag value's pointer in a union. When @@ -203,7 +204,7 @@ namespace detail { /// compile-time lookup of the member from a particular tag value, along with /// useful constants and compile time checking infrastructure.. template -struct PointerSumTypeHelper : MemberTs... { +struct LLVM_CLASS_ABI PointerSumTypeHelper : MemberTs... { // First we use a trick to allow quickly looking up information about // a particular member of the sum type. This works because we arranged to // have this type derive from all of the member type templates. We can select @@ -263,7 +264,7 @@ struct PointerSumTypeHelper : MemberTs... { // Teach DenseMap how to use PointerSumTypes as keys. template -struct DenseMapInfo> { +struct LLVM_CLASS_ABI DenseMapInfo> { using SumType = PointerSumType; using HelperT = detail::PointerSumTypeHelper; enum { SomeTag = HelperT::MinTag }; diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h index 7d4ed02b62262..df6532d1b3d14 100644 --- a/llvm/include/llvm/ADT/PointerUnion.h +++ b/llvm/include/llvm/ADT/PointerUnion.h @@ -19,6 +19,7 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Casting.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include #include @@ -39,13 +40,13 @@ namespace pointer_union_detail { } /// Find the first type in a list of types. - template struct GetFirstType { + template struct LLVM_CLASS_ABI GetFirstType { using type = T; }; /// Provide PointerLikeTypeTraits for void* that is used by PointerUnion /// for the template arguments. - template class PointerUnionUIntTraits { + template class LLVM_CLASS_ABI PointerUnionUIntTraits { public: static inline void *getAsVoidPointer(void *P) { return P; } static inline void *getFromVoidPointer(void *P) { return P; } @@ -56,7 +57,7 @@ namespace pointer_union_detail { class PointerUnionMembers; template - class PointerUnionMembers { + class LLVM_CLASS_ABI PointerUnionMembers { protected: ValTy Val; PointerUnionMembers() = default; @@ -67,7 +68,7 @@ namespace pointer_union_detail { template - class PointerUnionMembers + class LLVM_CLASS_ABI PointerUnionMembers : public PointerUnionMembers { using Base = PointerUnionMembers; public: @@ -109,7 +110,7 @@ template struct CastInfoPointerUnionImpl; /// X = P.get(); // runtime assertion failure. /// PointerUnion Q; // compile time failure. template -class PointerUnion +class LLVM_CLASS_ABI PointerUnion : public pointer_union_detail::PointerUnionMembers< PointerUnion, PointerIntPair< @@ -223,7 +224,7 @@ bool operator<(PointerUnion lhs, PointerUnion rhs) { /// friend'. /// So we define this struct to be a bridge between CastInfo and /// PointerUnion. -template struct CastInfoPointerUnionImpl { +template struct LLVM_CLASS_ABI CastInfoPointerUnionImpl { using From = PointerUnion; template static inline bool isPossible(From &F) { @@ -238,7 +239,7 @@ template struct CastInfoPointerUnionImpl { // Specialization of CastInfo for PointerUnion template -struct CastInfo> +struct LLVM_CLASS_ABI CastInfo> : public DefaultDoCastIfPossible, CastInfo>> { using From = PointerUnion; @@ -254,7 +255,7 @@ struct CastInfo> }; template -struct CastInfo> +struct LLVM_CLASS_ABI CastInfo> : public ConstStrippingForwardingCast, CastInfo>> { }; @@ -262,7 +263,7 @@ struct CastInfo> // Teach SmallPtrSet that PointerUnion is "basically a pointer", that has // # low bits available = min(PT1bits,PT2bits)-1. template -struct PointerLikeTypeTraits> { +struct LLVM_CLASS_ABI PointerLikeTypeTraits> { static inline void *getAsVoidPointer(const PointerUnion &P) { return P.getOpaqueValue(); } @@ -278,7 +279,7 @@ struct PointerLikeTypeTraits> { }; // Teach DenseMap how to use PointerUnions as keys. -template struct DenseMapInfo> { +template struct LLVM_CLASS_ABI DenseMapInfo> { using Union = PointerUnion; using FirstInfo = DenseMapInfo::type>; diff --git a/llvm/include/llvm/ADT/PostOrderIterator.h b/llvm/include/llvm/ADT/PostOrderIterator.h index 33d3330a40bd3..c377dbce53613 100644 --- a/llvm/include/llvm/ADT/PostOrderIterator.h +++ b/llvm/include/llvm/ADT/PostOrderIterator.h @@ -20,6 +20,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -56,7 +57,7 @@ namespace llvm { /// Default po_iterator_storage implementation with an internal set object. template -class po_iterator_storage { +class LLVM_CLASS_ABI po_iterator_storage { SetType Visited; public: @@ -72,7 +73,7 @@ class po_iterator_storage { /// Specialization of po_iterator_storage that references an external set. template -class po_iterator_storage { +class LLVM_CLASS_ABI po_iterator_storage { SetType &Visited; public: @@ -94,7 +95,7 @@ class po_iterator_storage { template ::NodeRef, 8>, bool ExtStorage = false, class GT = GraphTraits> -class po_iterator : public po_iterator_storage { +class LLVM_CLASS_ABI po_iterator : public po_iterator_storage { public: using iterator_category = std::forward_iterator_tag; using value_type = typename GT::NodeRef; @@ -197,7 +198,7 @@ template iterator_range> post_order(const T &G) { // Provide global definitions of external postorder iterators... template ::NodeRef>> -struct po_ext_iterator : public po_iterator { +struct LLVM_CLASS_ABI po_ext_iterator : public po_iterator { po_ext_iterator(const po_iterator &V) : po_iterator(V) {} }; @@ -220,7 +221,7 @@ iterator_range> post_order_ext(const T &G, SetType & // Provide global definitions of inverse post order iterators... template ::NodeRef>, bool External = false> -struct ipo_iterator : public po_iterator, SetType, External> { +struct LLVM_CLASS_ABI ipo_iterator : public po_iterator, SetType, External> { ipo_iterator(const po_iterator, SetType, External> &V) : po_iterator, SetType, External> (V) {} }; @@ -242,7 +243,7 @@ iterator_range> inverse_post_order(const T &G) { // Provide global definitions of external inverse postorder iterators... template ::NodeRef>> -struct ipo_ext_iterator : public ipo_iterator { +struct LLVM_CLASS_ABI ipo_ext_iterator : public ipo_iterator { ipo_ext_iterator(const ipo_iterator &V) : ipo_iterator(V) {} ipo_ext_iterator(const po_iterator, SetType, true> &V) : @@ -293,7 +294,7 @@ inverse_post_order_ext(const T &G, SetType &S) { // template> -class ReversePostOrderTraversal { +class LLVM_CLASS_ABI ReversePostOrderTraversal { using NodeRef = typename GT::NodeRef; using VecTy = SmallVector; diff --git a/llvm/include/llvm/ADT/PriorityQueue.h b/llvm/include/llvm/ADT/PriorityQueue.h index f40c160f0f5e6..76b77be8ef344 100644 --- a/llvm/include/llvm/ADT/PriorityQueue.h +++ b/llvm/include/llvm/ADT/PriorityQueue.h @@ -14,6 +14,7 @@ #ifndef LLVM_ADT_PRIORITYQUEUE_H #define LLVM_ADT_PRIORITYQUEUE_H +#include "llvm/Support/Compiler.h" #include #include @@ -25,7 +26,7 @@ namespace llvm { template, class Compare = std::less > -class PriorityQueue : public std::priority_queue { +class LLVM_CLASS_ABI PriorityQueue : public std::priority_queue { public: explicit PriorityQueue(const Compare &compare = Compare(), const Sequence &sequence = Sequence()) diff --git a/llvm/include/llvm/ADT/PriorityWorklist.h b/llvm/include/llvm/ADT/PriorityWorklist.h index 2b6510f42d569..9db8fc1d46284 100644 --- a/llvm/include/llvm/ADT/PriorityWorklist.h +++ b/llvm/include/llvm/ADT/PriorityWorklist.h @@ -52,7 +52,7 @@ namespace llvm { /// and a SmallDenseMap if custom data structures are not provided. template , typename MapT = DenseMap> -class PriorityWorklist { +class LLVM_CLASS_ABI PriorityWorklist { public: using value_type = T; using key_type = T; @@ -252,7 +252,7 @@ class PriorityWorklist { /// A version of \c PriorityWorklist that selects small size optimized data /// structures for the vector and map. template -class SmallPriorityWorklist +class LLVM_CLASS_ABI SmallPriorityWorklist : public PriorityWorklist, SmallDenseMap> { public: diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h index e743ae7c11edb..ee01dad0a6925 100644 --- a/llvm/include/llvm/ADT/SCCIterator.h +++ b/llvm/include/llvm/ADT/SCCIterator.h @@ -26,6 +26,7 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -44,7 +45,7 @@ namespace llvm { /// build up a vector of nodes in a particular SCC. Note that it is a forward /// iterator and thus you cannot backtrack or re-visit nodes. template > -class scc_iterator : public iterator_facade_base< +class LLVM_CLASS_ABI scc_iterator : public iterator_facade_base< scc_iterator, std::forward_iterator_tag, const std::vector, ptrdiff_t> { using NodeRef = typename GT::NodeRef; @@ -250,7 +251,7 @@ template scc_iterator scc_end(const T &G) { /// have a predecessor and then applied to all nodes of the SCC. Such order /// ensures that high-weighted edges are visited first during the traversal. template > -class scc_member_iterator { +class LLVM_CLASS_ABI scc_member_iterator { using NodeType = typename GT::NodeType; using EdgeType = typename GT::EdgeType; using NodesType = std::vector; @@ -320,7 +321,7 @@ scc_member_iterator::scc_member_iterator( } // Sort edges by weights. - struct EdgeComparer { + struct LLVM_CLASS_ABI EdgeComparer { bool operator()(const EdgeType *L, const EdgeType *R) const { return L->Weight > R->Weight; } diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 18bc4d108b156..537bb15d0f199 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -24,6 +24,7 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Config/abi-breaking.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include #include @@ -50,20 +51,20 @@ namespace llvm { // Extra additions to //===----------------------------------------------------------------------===// -template struct make_const_ptr { +template struct LLVM_CLASS_ABI make_const_ptr { using type = std::add_pointer_t>; }; -template struct make_const_ref { +template struct LLVM_CLASS_ABI make_const_ref { using type = std::add_lvalue_reference_t>; }; namespace detail { -template class Op, class... Args> struct detector { +template class Op, class... Args> struct LLVM_CLASS_ABI detector { using value_t = std::false_type; }; template