1 /*===-- llvm-c/Support.h - C Interface Types declarations ---------*- C -*-===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* This file defines types used by the the C interface to LLVM. *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_TYPES_H
15 #define LLVM_C_TYPES_H
17 #include "llvm/Support/DataTypes.h"
24 * @defgroup LLVMCSupportTypes Types and Enumerations
34 * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore
35 * parameters must be passed as base types. Despite the declared types, most
36 * of the functions provided operate only on branches of the type hierarchy.
37 * The declared parameter names are descriptive and specify which type is
38 * required. Additionally, each type hierarchy is documented along with the
39 * functions that operate upon it. For more detail, refer to LLVM's C++ code.
40 * If in doubt, refer to Core.cpp, which performs parameter downcasts in the
41 * form unwrap<RequiredType>(Param).
45 * Used to pass regions of memory through LLVM interfaces.
47 * @see llvm::MemoryBuffer
49 typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
52 * The top-level container for all LLVM global data. See the LLVMContext class.
54 typedef struct LLVMOpaqueContext *LLVMContextRef;
57 * The top-level container for all other LLVM Intermediate Representation (IR)
62 typedef struct LLVMOpaqueModule *LLVMModuleRef;
65 * Each value in the LLVM IR has a type, an LLVMTypeRef.
69 typedef struct LLVMOpaqueType *LLVMTypeRef;
72 * Represents an individual value in LLVM IR.
74 * This models llvm::Value.
76 typedef struct LLVMOpaqueValue *LLVMValueRef;
79 * Represents a basic block of instructions in LLVM IR.
81 * This models llvm::BasicBlock.
83 typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
86 * Represents an LLVM basic block builder.
88 * This models llvm::IRBuilder.
90 typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
93 * Interface used to provide a module to JIT or interpreter.
94 * This is now just a synonym for llvm::Module, but we have to keep using the
95 * different type to keep binary compatibility.
97 typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
99 /** @see llvm::PassManagerBase */
100 typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
102 /** @see llvm::PassRegistry */
103 typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
106 * Used to get the users and usees of a Value.
109 typedef struct LLVMOpaqueUse *LLVMUseRef;
112 * @see llvm::DiagnosticInfo
114 typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;