diff options
Diffstat (limited to 'include/llvm-c/Core.h')
-rw-r--r-- | include/llvm-c/Core.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index d3308ef..696ef6a 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -51,6 +51,7 @@ typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef; typedef struct LLVMOpaqueValue *LLVMValueRef; typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; +typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef; typedef enum { LLVMVoidTypeKind, /* type with no size */ @@ -489,10 +490,26 @@ LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name); +/*===-- Module providers --------------------------------------------------===*/ + +/* Encapsulates the module M in a module provider, taking ownership of the + * module. + * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider. + */ +LLVMModuleProviderRef +LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M); + +/* Destroys the module provider MP as well as the contained module. + * See the destructor llvm::ModuleProvider::~ModuleProvider. + */ +void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP); + #ifdef __cplusplus } namespace llvm { + class ModuleProvider; + /* Opaque module conversions */ inline Module *unwrap(LLVMModuleRef M) { @@ -587,6 +604,16 @@ namespace llvm { inline LLVMTypeHandleRef wrap(PATypeHolder *B) { return reinterpret_cast<LLVMTypeHandleRef>(B); } + + /* Opaque module provider conversions. + */ + inline ModuleProvider *unwrap(LLVMModuleProviderRef P) { + return reinterpret_cast<ModuleProvider*>(P); + } + + inline LLVMModuleProviderRef wrap(ModuleProvider *P) { + return reinterpret_cast<LLVMModuleProviderRef>(P); + } } #endif /* !defined(__cplusplus) */ |