Add C API bindings for DIBuilder 'Type' APIs
[lldb.git] / llvm / bindings / go / llvm / DIBuilderBindings.h
1 //===- DIBuilderBindings.h - Bindings for DIBuilder -------------*- 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 C bindings for the DIBuilder class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_BINDINGS_GO_LLVM_DIBUILDERBINDINGS_H
15 #define LLVM_BINDINGS_GO_LLVM_DIBUILDERBINDINGS_H
16
17 #include "IRBindings.h"
18 #include "llvm-c/Core.h"
19 #include "llvm-c/DebugInfo.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 // FIXME: These bindings shouldn't be Go-specific and should eventually move to
26 // a (somewhat) less stable collection of C APIs for use in creating bindings of
27 // LLVM in other languages.
28
29 typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
30
31 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef D,
32                                                 LLVMMetadataRef Scope,
33                                                 LLVMMetadataRef File,
34                                                 unsigned Line, unsigned Column);
35
36 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef D,
37                                                     LLVMMetadataRef Scope,
38                                                     LLVMMetadataRef File,
39                                                     unsigned Discriminator);
40
41 LLVMMetadataRef LLVMDIBuilderCreateFunction(
42     LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name,
43     const char *LinkageName, LLVMMetadataRef File, unsigned Line,
44     LLVMMetadataRef CompositeType, int IsLocalToUnit, int IsDefinition,
45     unsigned ScopeLine, unsigned Flags, int IsOptimized);
46
47 LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
48     LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name,
49     LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty, int AlwaysPreserve,
50     unsigned Flags, uint32_t AlignInBits);
51
52 LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
53     LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name, unsigned ArgNo,
54     LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty, int AlwaysPreserve,
55     unsigned Flags);
56
57 LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef D,
58                                            LLVMMetadataRef Ty, const char *Name,
59                                            LLVMMetadataRef File, unsigned Line,
60                                            LLVMMetadataRef Context);
61
62 LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef D, int64_t Lo,
63                                                  int64_t Count);
64
65 LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef D,
66                                               LLVMMetadataRef *Data,
67                                               size_t Length);
68
69 LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef D,
70                                                   LLVMMetadataRef *Data,
71                                                   size_t Length);
72
73 LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Dref,
74                                               int64_t *Addr, size_t Length);
75
76 LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef D,
77                                              LLVMValueRef Storage,
78                                              LLVMMetadataRef VarInfo,
79                                              LLVMMetadataRef Expr,
80                                              LLVMBasicBlockRef Block);
81
82 LLVMValueRef LLVMDIBuilderInsertValueAtEnd(LLVMDIBuilderRef D, LLVMValueRef Val,
83                                            LLVMMetadataRef VarInfo,
84                                            LLVMMetadataRef Expr,
85                                            LLVMBasicBlockRef Block);
86
87 #ifdef __cplusplus
88 } // extern "C"
89 #endif
90
91 #endif