1 /*===-- llvm-c/Support.h - C Interface Types declarations ---------*- C -*-===*\ 2 |* *| 3 |* The LLVM Compiler Infrastructure *| 4 |* *| 5 |* This file is distributed under the University of Illinois Open Source *| 6 |* License. See LICENSE.TXT for details. *| 7 |* *| 8 |*===----------------------------------------------------------------------===*| 9 |* *| 10 |* This file defines types used by the the C interface to LLVM. *| 11 |* *| 12 \*===----------------------------------------------------------------------===*/ 13 14 module llvm.c.types; 15 16 extern(C) nothrow: 17 18 /** 19 * @defgroup LLVMCSupportTypes Types and Enumerations 20 * 21 * @{ 22 */ 23 24 alias LLVMBool = int; 25 26 /* Opaque types. */ 27 28 /** 29 * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore 30 * parameters must be passed as base types. Despite the declared types, most 31 * of the functions provided operate only on branches of the type hierarchy. 32 * The declared parameter names are descriptive and specify which type is 33 * required. Additionally, each type hierarchy is documented along with the 34 * functions that operate upon it. For more detail, refer to LLVM's C++ code. 35 * If in doubt, refer to Core.cpp, which performs parameter downcasts in the 36 * form unwrap<RequiredType>(Param). 37 */ 38 39 /** 40 * Used to pass regions of memory through LLVM interfaces. 41 * 42 * @see llvm::MemoryBuffer 43 */ 44 struct __LLVMOpaqueMemoryBuffer {}; 45 alias LLVMMemoryBufferRef = __LLVMOpaqueMemoryBuffer*; 46 47 /** 48 * The top-level container for all LLVM global data. See the LLVMContext class. 49 */ 50 struct __LLVMOpaqueContext {}; 51 alias LLVMContextRef = __LLVMOpaqueContext*; 52 53 /** 54 * The top-level container for all other LLVM Intermediate Representation (IR) 55 * objects. 56 * 57 * @see llvm::Module 58 */ 59 struct __LLVMOpaqueModule {}; 60 alias LLVMModuleRef = __LLVMOpaqueModule*; 61 62 /** 63 * Each value in the LLVM IR has a type, an LLVMTypeRef. 64 * 65 * @see llvm::Type 66 */ 67 struct __LLVMOpaqueType {}; 68 alias LLVMTypeRef = __LLVMOpaqueType*; 69 70 /** 71 * Represents an individual value in LLVM IR. 72 * 73 * This models llvm::Value. 74 */ 75 struct __LLVMOpaqueValue {}; 76 alias LLVMValueRef = __LLVMOpaqueValue*; 77 78 /** 79 * Represents a basic block of instructions in LLVM IR. 80 * 81 * This models llvm::BasicBlock. 82 */ 83 struct __LLVMOpaqueBasicBlock {}; 84 alias LLVMBasicBlockRef = __LLVMOpaqueBasicBlock*; 85 86 /** 87 * Represents an LLVM basic block builder. 88 * 89 * This models llvm::IRBuilder. 90 */ 91 struct __LLVMOpaqueBuilder {}; 92 alias LLVMBuilderRef = __LLVMOpaqueBuilder*; 93 94 /** 95 * Interface used to provide a module to JIT or interpreter. 96 * This is now just a synonym for llvm::Module, but we have to keep using the 97 * different type to keep binary compatibility. 98 */ 99 struct __LLVMOpaqueModuleProvider {}; 100 alias LLVMModuleProviderRef = __LLVMOpaqueModuleProvider*; 101 102 /** @see llvm::PassManagerBase */ 103 struct __LLVMOpaquePassManager {}; 104 alias LLVMPassManagerRef = __LLVMOpaquePassManager*; 105 106 /** @see llvm::PassRegistry */ 107 struct __LLVMOpaquePassRegistry {}; 108 alias __LLVMOpaquePassRegistry *LLVMPassRegistryRef; 109 110 /** 111 * Used to get the users and usees of a Value. 112 * 113 * @see llvm::Use */ 114 struct __LLVMOpaqueUse {}; 115 alias LLVMUseRef = __LLVMOpaqueUse*; 116 117 /** 118 * Used to represent an attributes. 119 * 120 * @see llvm::Attribute 121 */ 122 struct __LLVMOpaqueAttribute {}; 123 alias LLVMAttributeRef = __LLVMOpaqueAttribute*; 124 125 /** 126 * @see llvm::DiagnosticInfo 127 */ 128 struct __LLVMOpaqueDiagnosticInfo {}; 129 alias LLVMDiagnosticInfoRef = __LLVMOpaqueDiagnosticInfo*; 130 131 /** 132 * @} 133 */ 134