OSDN Git Service

[ORC] Update ORC C bindings to use the new llvm::Error C API.
[android-x86/external-llvm.git] / include / llvm-c / DebugInfo.h
1 //===------------ DebugInfo.h - LLVM C API Debug Info API -----------------===//
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 declares the C API endpoints for generating DWARF Debug Info
11 ///
12 /// Note: This interface is experimental. It is *NOT* stable, and may be
13 ///       changed without warning.
14 ///
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_C_DEBUGINFO_H
18 #define LLVM_C_DEBUGINFO_H
19
20 #include "llvm-c/Core.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * Debug info flags.
28  */
29 typedef enum {
30   LLVMDIFlagZero = 0,
31   LLVMDIFlagPrivate = 1,
32   LLVMDIFlagProtected = 2,
33   LLVMDIFlagPublic = 3,
34   LLVMDIFlagFwdDecl = 1 << 2,
35   LLVMDIFlagAppleBlock = 1 << 3,
36   LLVMDIFlagBlockByrefStruct = 1 << 4,
37   LLVMDIFlagVirtual = 1 << 5,
38   LLVMDIFlagArtificial = 1 << 6,
39   LLVMDIFlagExplicit = 1 << 7,
40   LLVMDIFlagPrototyped = 1 << 8,
41   LLVMDIFlagObjcClassComplete = 1 << 9,
42   LLVMDIFlagObjectPointer = 1 << 10,
43   LLVMDIFlagVector = 1 << 11,
44   LLVMDIFlagStaticMember = 1 << 12,
45   LLVMDIFlagLValueReference = 1 << 13,
46   LLVMDIFlagRValueReference = 1 << 14,
47   LLVMDIFlagReserved = 1 << 15,
48   LLVMDIFlagSingleInheritance = 1 << 16,
49   LLVMDIFlagMultipleInheritance = 2 << 16,
50   LLVMDIFlagVirtualInheritance = 3 << 16,
51   LLVMDIFlagIntroducedVirtual = 1 << 18,
52   LLVMDIFlagBitField = 1 << 19,
53   LLVMDIFlagNoReturn = 1 << 20,
54   LLVMDIFlagMainSubprogram = 1 << 21,
55   LLVMDIFlagTypePassByValue = 1 << 22,
56   LLVMDIFlagTypePassByReference = 1 << 23,
57   LLVMDIFlagFixedEnum = 1 << 24,
58   LLVMDIFlagThunk = 1 << 25,
59   LLVMDIFlagTrivial = 1 << 26,
60   LLVMDIFlagBigEndian = 1 << 27,
61   LLVMDIFlagLittleEndian = 1 << 28,
62   LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
63   LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected |
64                             LLVMDIFlagPublic,
65   LLVMDIFlagPtrToMemberRep = LLVMDIFlagSingleInheritance |
66                              LLVMDIFlagMultipleInheritance |
67                              LLVMDIFlagVirtualInheritance
68 } LLVMDIFlags;
69
70 /**
71  * Source languages known by DWARF.
72  */
73 typedef enum {
74   LLVMDWARFSourceLanguageC89,
75   LLVMDWARFSourceLanguageC,
76   LLVMDWARFSourceLanguageAda83,
77   LLVMDWARFSourceLanguageC_plus_plus,
78   LLVMDWARFSourceLanguageCobol74,
79   LLVMDWARFSourceLanguageCobol85,
80   LLVMDWARFSourceLanguageFortran77,
81   LLVMDWARFSourceLanguageFortran90,
82   LLVMDWARFSourceLanguagePascal83,
83   LLVMDWARFSourceLanguageModula2,
84   // New in DWARF v3:
85   LLVMDWARFSourceLanguageJava,
86   LLVMDWARFSourceLanguageC99,
87   LLVMDWARFSourceLanguageAda95,
88   LLVMDWARFSourceLanguageFortran95,
89   LLVMDWARFSourceLanguagePLI,
90   LLVMDWARFSourceLanguageObjC,
91   LLVMDWARFSourceLanguageObjC_plus_plus,
92   LLVMDWARFSourceLanguageUPC,
93   LLVMDWARFSourceLanguageD,
94   // New in DWARF v4:
95   LLVMDWARFSourceLanguagePython,
96   // New in DWARF v5:
97   LLVMDWARFSourceLanguageOpenCL,
98   LLVMDWARFSourceLanguageGo,
99   LLVMDWARFSourceLanguageModula3,
100   LLVMDWARFSourceLanguageHaskell,
101   LLVMDWARFSourceLanguageC_plus_plus_03,
102   LLVMDWARFSourceLanguageC_plus_plus_11,
103   LLVMDWARFSourceLanguageOCaml,
104   LLVMDWARFSourceLanguageRust,
105   LLVMDWARFSourceLanguageC11,
106   LLVMDWARFSourceLanguageSwift,
107   LLVMDWARFSourceLanguageJulia,
108   LLVMDWARFSourceLanguageDylan,
109   LLVMDWARFSourceLanguageC_plus_plus_14,
110   LLVMDWARFSourceLanguageFortran03,
111   LLVMDWARFSourceLanguageFortran08,
112   LLVMDWARFSourceLanguageRenderScript,
113   LLVMDWARFSourceLanguageBLISS,
114   // Vendor extensions:
115   LLVMDWARFSourceLanguageMips_Assembler,
116   LLVMDWARFSourceLanguageGOOGLE_RenderScript,
117   LLVMDWARFSourceLanguageBORLAND_Delphi
118 } LLVMDWARFSourceLanguage;
119
120 /**
121  * The amount of debug information to emit.
122  */
123 typedef enum {
124     LLVMDWARFEmissionNone = 0,
125     LLVMDWARFEmissionFull,
126     LLVMDWARFEmissionLineTablesOnly
127 } LLVMDWARFEmissionKind;
128
129 /**
130  * An LLVM DWARF type encoding.
131  */
132 typedef unsigned LLVMDWARFTypeEncoding;
133
134 /**
135  * The current debug metadata version number.
136  */
137 unsigned LLVMDebugMetadataVersion(void);
138
139 /**
140  * The version of debug metadata that's present in the provided \c Module.
141  */
142 unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module);
143
144 /**
145  * Strip debug info in the module if it exists.
146  * To do this, we remove all calls to the debugger intrinsics and any named
147  * metadata for debugging. We also remove debug locations for instructions.
148  * Return true if module is modified.
149  */
150 LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module);
151
152 /**
153  * Construct a builder for a module, and do not allow for unresolved nodes
154  * attached to the module.
155  */
156 LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M);
157
158 /**
159  * Construct a builder for a module and collect unresolved nodes attached
160  * to the module in order to resolve cycles during a call to
161  * \c LLVMDIBuilderFinalize.
162  */
163 LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M);
164
165 /**
166  * Deallocates the \c DIBuilder and everything it owns.
167  * @note You must call \c LLVMDIBuilderFinalize before this
168  */
169 void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder);
170
171 /**
172  * Construct any deferred debug info descriptors.
173  */
174 void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder);
175
176 /**
177  * A CompileUnit provides an anchor for all debugging
178  * information generated during this instance of compilation.
179  * \param Lang          Source programming language, eg.
180  *                      \c LLVMDWARFSourceLanguageC99
181  * \param FileRef       File info.
182  * \param Producer      Identify the producer of debugging information
183  *                      and code.  Usually this is a compiler
184  *                      version string.
185  * \param ProducerLen   The length of the C string passed to \c Producer.
186  * \param isOptimized   A boolean flag which indicates whether optimization
187  *                      is enabled or not.
188  * \param Flags         This string lists command line options. This
189  *                      string is directly embedded in debug info
190  *                      output which may be used by a tool
191  *                      analyzing generated debugging information.
192  * \param FlagsLen      The length of the C string passed to \c Flags.
193  * \param RuntimeVer    This indicates runtime version for languages like
194  *                      Objective-C.
195  * \param SplitName     The name of the file that we'll split debug info
196  *                      out into.
197  * \param SplitNameLen  The length of the C string passed to \c SplitName.
198  * \param Kind          The kind of debug information to generate.
199  * \param DWOId         The DWOId if this is a split skeleton compile unit.
200  * \param SplitDebugInlining    Whether to emit inline debug info.
201  * \param DebugInfoForProfiling Whether to emit extra debug info for
202  *                              profile collection.
203  */
204 LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(
205     LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
206     LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
207     LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
208     unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
209     LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
210     LLVMBool DebugInfoForProfiling);
211
212 /**
213  * Create a file descriptor to hold debugging information for a file.
214  * \param Builder      The \c DIBuilder.
215  * \param Filename     File name.
216  * \param FilenameLen  The length of the C string passed to \c Filename.
217  * \param Directory    Directory.
218  * \param DirectoryLen The length of the C string passed to \c Directory.
219  */
220 LLVMMetadataRef
221 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
222                         size_t FilenameLen, const char *Directory,
223                         size_t DirectoryLen);
224
225 /**
226  * Creates a new descriptor for a module with the specified parent scope.
227  * \param Builder         The \c DIBuilder.
228  * \param ParentScope     The parent scope containing this module declaration.
229  * \param Name            Module name.
230  * \param NameLen         The length of the C string passed to \c Name.
231  * \param ConfigMacros    A space-separated shell-quoted list of -D macro
232                           definitions as they would appear on a command line.
233  * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
234  * \param IncludePath     The path to the module map file.
235  * \param IncludePathLen  The length of the C string passed to \c IncludePath.
236  * \param ISysRoot        The Clang system root (value of -isysroot).
237  * \param ISysRootLen     The length of the C string passed to \c ISysRoot.
238  */
239 LLVMMetadataRef
240 LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
241                           const char *Name, size_t NameLen,
242                           const char *ConfigMacros, size_t ConfigMacrosLen,
243                           const char *IncludePath, size_t IncludePathLen,
244                           const char *ISysRoot, size_t ISysRootLen);
245
246 /**
247  * Creates a new descriptor for a namespace with the specified parent scope.
248  * \param Builder          The \c DIBuilder.
249  * \param ParentScope      The parent scope containing this module declaration.
250  * \param Name             NameSpace name.
251  * \param NameLen          The length of the C string passed to \c Name.
252  * \param ExportSymbols    Whether or not the namespace exports symbols, e.g.
253  *                         this is true of C++ inline namespaces.
254  */
255 LLVMMetadataRef
256 LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder,
257                              LLVMMetadataRef ParentScope,
258                              const char *Name, size_t NameLen,
259                              LLVMBool ExportSymbols);
260
261 /**
262  * Create a new descriptor for the specified subprogram.
263  * \param Builder         The \c DIBuilder.
264  * \param Scope           Function scope.
265  * \param Name            Function name.
266  * \param NameLen         Length of enumeration name.
267  * \param LinkageName     Mangled function name.
268  * \param LinkageNameLen  Length of linkage name.
269  * \param File            File where this variable is defined.
270  * \param LineNo          Line number.
271  * \param Ty              Function type.
272  * \param IsLocalToUnit   True if this function is not externally visible.
273  * \param IsDefinition    True if this is a function definition.
274  * \param ScopeLine       Set to the beginning of the scope this starts
275  * \param Flags           E.g.: \c LLVMDIFlagLValueReference. These flags are
276  *                        used to emit dwarf attributes.
277  * \param IsOptimized     True if optimization is ON.
278  */
279 LLVMMetadataRef LLVMDIBuilderCreateFunction(
280     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
281     size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
282     LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
283     LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
284     unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized);
285
286 /**
287  * Create a descriptor for a lexical block with the specified parent context.
288  * \param Builder      The \c DIBuilder.
289  * \param Scope        Parent lexical block.
290  * \param File         Source file.
291  * \param Line         The line in the source file.
292  * \param Column       The column in the source file.
293  */
294 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
295     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
296     LLVMMetadataRef File, unsigned Line, unsigned Column);
297
298 /**
299  * Create a descriptor for a lexical block with a new file attached.
300  * \param Builder        The \c DIBuilder.
301  * \param Scope          Lexical block.
302  * \param File           Source file.
303  * \param Discriminator  DWARF path discriminator value.
304  */
305 LLVMMetadataRef
306 LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder,
307                                     LLVMMetadataRef Scope,
308                                     LLVMMetadataRef File,
309                                     unsigned Discriminator);
310
311 /**
312  * Create a descriptor for an imported namespace. Suitable for e.g. C++
313  * using declarations.
314  * \param Builder    The \c DIBuilder.
315  * \param Scope      The scope this module is imported into
316  * \param File       File where the declaration is located.
317  * \param Line       Line number of the declaration.
318  */
319 LLVMMetadataRef
320 LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder,
321                                                LLVMMetadataRef Scope,
322                                                LLVMMetadataRef NS,
323                                                LLVMMetadataRef File,
324                                                unsigned Line);
325
326 /**
327  * Create a descriptor for an imported module that aliases another
328  * imported entity descriptor.
329  * \param Builder        The \c DIBuilder.
330  * \param Scope          The scope this module is imported into
331  * \param ImportedEntity Previous imported entity to alias.
332  * \param File           File where the declaration is located.
333  * \param Line           Line number of the declaration.
334  */
335 LLVMMetadataRef
336 LLVMDIBuilderCreateImportedModuleFromAlias(LLVMDIBuilderRef Builder,
337                                            LLVMMetadataRef Scope,
338                                            LLVMMetadataRef ImportedEntity,
339                                            LLVMMetadataRef File,
340                                            unsigned Line);
341
342 /**
343  * Create a descriptor for an imported module.
344  * \param Builder    The \c DIBuilder.
345  * \param Scope      The scope this module is imported into
346  * \param M          The module being imported here
347  * \param File       File where the declaration is located.
348  * \param Line       Line number of the declaration.
349  */
350 LLVMMetadataRef
351 LLVMDIBuilderCreateImportedModuleFromModule(LLVMDIBuilderRef Builder,
352                                             LLVMMetadataRef Scope,
353                                             LLVMMetadataRef M,
354                                             LLVMMetadataRef File,
355                                             unsigned Line);
356
357 /**
358  * Create a descriptor for an imported function, type, or variable.  Suitable
359  * for e.g. FORTRAN-style USE declarations.
360  * \param Builder    The DIBuilder.
361  * \param Scope      The scope this module is imported into.
362  * \param Decl       The declaration (or definition) of a function, type,
363                      or variable.
364  * \param File       File where the declaration is located.
365  * \param Line       Line number of the declaration.
366  * \param Name       A name that uniquely identifies this imported declaration.
367  * \param NameLen    The length of the C string passed to \c Name.
368  */
369 LLVMMetadataRef
370 LLVMDIBuilderCreateImportedDeclaration(LLVMDIBuilderRef Builder,
371                                        LLVMMetadataRef Scope,
372                                        LLVMMetadataRef Decl,
373                                        LLVMMetadataRef File,
374                                        unsigned Line,
375                                        const char *Name, size_t NameLen);
376
377 /**
378  * Creates a new DebugLocation that describes a source location.
379  * \param Line The line in the source file.
380  * \param Column The column in the source file.
381  * \param Scope The scope in which the location resides.
382  * \param InlinedAt The scope where this location was inlined, if at all.
383  *                  (optional).
384  * \note If the item to which this location is attached cannot be
385  *       attributed to a source line, pass 0 for the line and column.
386  */
387 LLVMMetadataRef
388 LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line,
389                                  unsigned Column, LLVMMetadataRef Scope,
390                                  LLVMMetadataRef InlinedAt);
391
392 /**
393  * Get the line number of this debug location.
394  * \param Location     The debug location.
395  *
396  * @see DILocation::getLine()
397  */
398 unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
399
400 /**
401  * Get the column number of this debug location.
402  * \param Location     The debug location.
403  *
404  * @see DILocation::getColumn()
405  */
406 unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
407
408 /**
409  * Get the local scope associated with this debug location.
410  * \param Location     The debug location.
411  *
412  * @see DILocation::getScope()
413  */
414 LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
415
416 /**
417  * Create a type array.
418  * \param Builder        The DIBuilder.
419  * \param Data           The type elements.
420  * \param NumElements    Number of type elements.
421  */
422 LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder,
423                                                   LLVMMetadataRef *Data,
424                                                   size_t NumElements);
425
426 /**
427  * Create subroutine type.
428  * \param Builder        The DIBuilder.
429  * \param File            The file in which the subroutine resides.
430  * \param ParameterTypes  An array of subroutine parameter types. This
431  *                        includes return type at 0th index.
432  * \param NumParameterTypes The number of parameter types in \c ParameterTypes
433  * \param Flags           E.g.: \c LLVMDIFlagLValueReference.
434  *                        These flags are used to emit dwarf attributes.
435  */
436 LLVMMetadataRef
437 LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
438                                   LLVMMetadataRef File,
439                                   LLVMMetadataRef *ParameterTypes,
440                                   unsigned NumParameterTypes,
441                                   LLVMDIFlags Flags);
442
443 /**
444  * Create debugging information entry for an enumeration.
445  * \param Builder        The DIBuilder.
446  * \param Scope          Scope in which this enumeration is defined.
447  * \param Name           Enumeration name.
448  * \param NameLen        Length of enumeration name.
449  * \param File           File where this member is defined.
450  * \param LineNumber     Line number.
451  * \param SizeInBits     Member size.
452  * \param AlignInBits    Member alignment.
453  * \param Elements       Enumeration elements.
454  * \param NumElements    Number of enumeration elements.
455  * \param ClassTy        Underlying type of a C++11/ObjC fixed enum.
456  */
457 LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
458     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
459     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
460     uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
461     unsigned NumElements, LLVMMetadataRef ClassTy);
462
463 /**
464  * Create debugging information entry for a union.
465  * \param Builder      The DIBuilder.
466  * \param Scope        Scope in which this union is defined.
467  * \param Name         Union name.
468  * \param NameLen      Length of union name.
469  * \param File         File where this member is defined.
470  * \param LineNumber   Line number.
471  * \param SizeInBits   Member size.
472  * \param AlignInBits  Member alignment.
473  * \param Flags        Flags to encode member attribute, e.g. private
474  * \param Elements     Union elements.
475  * \param NumElements  Number of union elements.
476  * \param RunTimeLang  Optional parameter, Objective-C runtime version.
477  * \param UniqueId     A unique identifier for the union.
478  * \param UniqueIdLen  Length of unique identifier.
479  */
480 LLVMMetadataRef LLVMDIBuilderCreateUnionType(
481     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
482     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
483     uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
484     LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
485     const char *UniqueId, size_t UniqueIdLen);
486
487
488 /**
489  * Create debugging information entry for an array.
490  * \param Builder      The DIBuilder.
491  * \param Size         Array size.
492  * \param AlignInBits  Alignment.
493  * \param Ty           Element type.
494  * \param Subscripts   Subscripts.
495  * \param NumSubscripts Number of subscripts.
496  */
497 LLVMMetadataRef
498 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
499                              uint32_t AlignInBits, LLVMMetadataRef Ty,
500                              LLVMMetadataRef *Subscripts,
501                              unsigned NumSubscripts);
502
503 /**
504  * Create debugging information entry for a vector type.
505  * \param Builder      The DIBuilder.
506  * \param Size         Vector size.
507  * \param AlignInBits  Alignment.
508  * \param Ty           Element type.
509  * \param Subscripts   Subscripts.
510  * \param NumSubscripts Number of subscripts.
511  */
512 LLVMMetadataRef
513 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
514                               uint32_t AlignInBits, LLVMMetadataRef Ty,
515                               LLVMMetadataRef *Subscripts,
516                               unsigned NumSubscripts);
517
518 /**
519  * Create a DWARF unspecified type.
520  * \param Builder   The DIBuilder.
521  * \param Name      The unspecified type's name.
522  * \param NameLen   Length of type name.
523  */
524 LLVMMetadataRef
525 LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name,
526                                    size_t NameLen);
527
528 /**
529  * Create debugging information entry for a basic
530  * type.
531  * \param Builder     The DIBuilder.
532  * \param Name        Type name.
533  * \param NameLen     Length of type name.
534  * \param SizeInBits  Size of the type.
535  * \param Encoding    DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
536  * \param Flags       Flags to encode optional attribute like endianity
537  */
538 LLVMMetadataRef
539 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
540                              size_t NameLen, uint64_t SizeInBits,
541                              LLVMDWARFTypeEncoding Encoding,
542                              LLVMDIFlags Flags);
543
544 /**
545  * Create debugging information entry for a pointer.
546  * \param Builder     The DIBuilder.
547  * \param PointeeTy         Type pointed by this pointer.
548  * \param SizeInBits        Size.
549  * \param AlignInBits       Alignment. (optional, pass 0 to ignore)
550  * \param AddressSpace      DWARF address space. (optional, pass 0 to ignore)
551  * \param Name              Pointer type name. (optional)
552  * \param NameLen           Length of pointer type name. (optional)
553  */
554 LLVMMetadataRef LLVMDIBuilderCreatePointerType(
555     LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
556     uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
557     const char *Name, size_t NameLen);
558
559 /**
560  * Create debugging information entry for a struct.
561  * \param Builder     The DIBuilder.
562  * \param Scope        Scope in which this struct is defined.
563  * \param Name         Struct name.
564  * \param NameLen      Struct name length.
565  * \param File         File where this member is defined.
566  * \param LineNumber   Line number.
567  * \param SizeInBits   Member size.
568  * \param AlignInBits  Member alignment.
569  * \param Flags        Flags to encode member attribute, e.g. private
570  * \param Elements     Struct elements.
571  * \param NumElements  Number of struct elements.
572  * \param RunTimeLang  Optional parameter, Objective-C runtime version.
573  * \param VTableHolder The object containing the vtable for the struct.
574  * \param UniqueId     A unique identifier for the struct.
575  * \param UniqueIdLen  Length of the unique identifier for the struct.
576  */
577 LLVMMetadataRef LLVMDIBuilderCreateStructType(
578     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
579     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
580     uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
581     LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
582     unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
583     const char *UniqueId, size_t UniqueIdLen);
584
585 /**
586  * Create debugging information entry for a member.
587  * \param Builder      The DIBuilder.
588  * \param Scope        Member scope.
589  * \param Name         Member name.
590  * \param NameLen      Length of member name.
591  * \param File         File where this member is defined.
592  * \param LineNo       Line number.
593  * \param SizeInBits   Member size.
594  * \param AlignInBits  Member alignment.
595  * \param OffsetInBits Member offset.
596  * \param Flags        Flags to encode member attribute, e.g. private
597  * \param Ty           Parent type.
598  */
599 LLVMMetadataRef LLVMDIBuilderCreateMemberType(
600     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
601     size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
602     uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
603     LLVMDIFlags Flags, LLVMMetadataRef Ty);
604
605 /**
606  * Create debugging information entry for a
607  * C++ static data member.
608  * \param Builder      The DIBuilder.
609  * \param Scope        Member scope.
610  * \param Name         Member name.
611  * \param NameLen      Length of member name.
612  * \param File         File where this member is declared.
613  * \param LineNumber   Line number.
614  * \param Type         Type of the static member.
615  * \param Flags        Flags to encode member attribute, e.g. private.
616  * \param ConstantVal  Const initializer of the member.
617  * \param AlignInBits  Member alignment.
618  */
619 LLVMMetadataRef
620 LLVMDIBuilderCreateStaticMemberType(
621     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
622     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
623     LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
624     uint32_t AlignInBits);
625
626 /**
627  * Create debugging information entry for a pointer to member.
628  * \param Builder      The DIBuilder.
629  * \param PointeeType  Type pointed to by this pointer.
630  * \param ClassType    Type for which this pointer points to members of.
631  * \param SizeInBits   Size.
632  * \param AlignInBits  Alignment.
633  * \param Flags        Flags.
634  */
635 LLVMMetadataRef
636 LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
637                                      LLVMMetadataRef PointeeType,
638                                      LLVMMetadataRef ClassType,
639                                      uint64_t SizeInBits,
640                                      uint32_t AlignInBits,
641                                      LLVMDIFlags Flags);
642 /**
643  * Create debugging information entry for Objective-C instance variable.
644  * \param Builder      The DIBuilder.
645  * \param Name         Member name.
646  * \param NameLen      The length of the C string passed to \c Name.
647  * \param File         File where this member is defined.
648  * \param LineNo       Line number.
649  * \param SizeInBits   Member size.
650  * \param AlignInBits  Member alignment.
651  * \param OffsetInBits Member offset.
652  * \param Flags        Flags to encode member attribute, e.g. private
653  * \param Ty           Parent type.
654  * \param PropertyNode Property associated with this ivar.
655  */
656 LLVMMetadataRef
657 LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder,
658                             const char *Name, size_t NameLen,
659                             LLVMMetadataRef File, unsigned LineNo,
660                             uint64_t SizeInBits, uint32_t AlignInBits,
661                             uint64_t OffsetInBits, LLVMDIFlags Flags,
662                             LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
663
664 /**
665  * Create debugging information entry for Objective-C property.
666  * \param Builder            The DIBuilder.
667  * \param Name               Property name.
668  * \param NameLen            The length of the C string passed to \c Name.
669  * \param File               File where this property is defined.
670  * \param LineNo             Line number.
671  * \param GetterName         Name of the Objective C property getter selector.
672  * \param GetterNameLen      The length of the C string passed to \c GetterName.
673  * \param SetterName         Name of the Objective C property setter selector.
674  * \param SetterNameLen      The length of the C string passed to \c SetterName.
675  * \param PropertyAttributes Objective C property attributes.
676  * \param Ty                 Type.
677  */
678 LLVMMetadataRef
679 LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
680                                 const char *Name, size_t NameLen,
681                                 LLVMMetadataRef File, unsigned LineNo,
682                                 const char *GetterName, size_t GetterNameLen,
683                                 const char *SetterName, size_t SetterNameLen,
684                                 unsigned PropertyAttributes,
685                                 LLVMMetadataRef Ty);
686
687 /**
688  * Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
689  * \param Builder   The DIBuilder.
690  * \param Type      The underlying type to which this pointer points.
691  */
692 LLVMMetadataRef
693 LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
694                                      LLVMMetadataRef Type);
695
696 /**
697  * Create debugging information entry for a qualified
698  * type, e.g. 'const int'.
699  * \param Builder     The DIBuilder.
700  * \param Tag         Tag identifying type,
701  *                    e.g. LLVMDWARFTypeQualifier_volatile_type
702  * \param Type        Base Type.
703  */
704 LLVMMetadataRef
705 LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag,
706                                  LLVMMetadataRef Type);
707
708 /**
709  * Create debugging information entry for a c++
710  * style reference or rvalue reference type.
711  * \param Builder   The DIBuilder.
712  * \param Tag       Tag identifying type,
713  * \param Type      Base Type.
714  */
715 LLVMMetadataRef
716 LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag,
717                                  LLVMMetadataRef Type);
718
719 /**
720  * Create C++11 nullptr type.
721  * \param Builder   The DIBuilder.
722  */
723 LLVMMetadataRef
724 LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder);
725
726 /**
727  * Create debugging information entry for a typedef.
728  * \param Builder    The DIBuilder.
729  * \param Type       Original type.
730  * \param Name       Typedef name.
731  * \param File       File where this type is defined.
732  * \param LineNo     Line number.
733  * \param Scope      The surrounding context for the typedef.
734  */
735 LLVMMetadataRef
736 LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type,
737                            const char *Name, size_t NameLen,
738                            LLVMMetadataRef File, unsigned LineNo,
739                            LLVMMetadataRef Scope);
740
741 /**
742  * Create debugging information entry to establish inheritance relationship
743  * between two types.
744  * \param Builder       The DIBuilder.
745  * \param Ty            Original type.
746  * \param BaseTy        Base type. Ty is inherits from base.
747  * \param BaseOffset    Base offset.
748  * \param VBPtrOffset  Virtual base pointer offset.
749  * \param Flags         Flags to describe inheritance attribute, e.g. private
750  */
751 LLVMMetadataRef
752 LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder,
753                                LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
754                                uint64_t BaseOffset, uint32_t VBPtrOffset,
755                                LLVMDIFlags Flags);
756
757 /**
758  * Create a permanent forward-declared type.
759  * \param Builder             The DIBuilder.
760  * \param Tag                 A unique tag for this type.
761  * \param Name                Type name.
762  * \param NameLen             Length of type name.
763  * \param Scope               Type scope.
764  * \param File                File where this type is defined.
765  * \param Line                Line number where this type is defined.
766  * \param RuntimeLang         Indicates runtime version for languages like
767  *                            Objective-C.
768  * \param SizeInBits          Member size.
769  * \param AlignInBits         Member alignment.
770  * \param UniqueIdentifier    A unique identifier for the type.
771  * \param UniqueIdentifierLen Length of the unique identifier.
772  */
773 LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
774     LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
775     size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
776     unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
777     const char *UniqueIdentifier, size_t UniqueIdentifierLen);
778
779 /**
780  * Create a temporary forward-declared type.
781  * \param Builder             The DIBuilder.
782  * \param Tag                 A unique tag for this type.
783  * \param Name                Type name.
784  * \param NameLen             Length of type name.
785  * \param Scope               Type scope.
786  * \param File                File where this type is defined.
787  * \param Line                Line number where this type is defined.
788  * \param RuntimeLang         Indicates runtime version for languages like
789  *                            Objective-C.
790  * \param SizeInBits          Member size.
791  * \param AlignInBits         Member alignment.
792  * \param Flags               Flags.
793  * \param UniqueIdentifier    A unique identifier for the type.
794  * \param UniqueIdentifierLen Length of the unique identifier.
795  */
796 LLVMMetadataRef
797 LLVMDIBuilderCreateReplaceableCompositeType(
798     LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
799     size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
800     unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
801     LLVMDIFlags Flags, const char *UniqueIdentifier,
802     size_t UniqueIdentifierLen);
803
804 /**
805  * Create debugging information entry for a bit field member.
806  * \param Builder             The DIBuilder.
807  * \param Scope               Member scope.
808  * \param Name                Member name.
809  * \param NameLen             Length of member name.
810  * \param File                File where this member is defined.
811  * \param LineNumber          Line number.
812  * \param SizeInBits          Member size.
813  * \param OffsetInBits        Member offset.
814  * \param StorageOffsetInBits Member storage offset.
815  * \param Flags               Flags to encode member attribute.
816  * \param Type                Parent type.
817  */
818 LLVMMetadataRef
819 LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder,
820                                       LLVMMetadataRef Scope,
821                                       const char *Name, size_t NameLen,
822                                       LLVMMetadataRef File, unsigned LineNumber,
823                                       uint64_t SizeInBits,
824                                       uint64_t OffsetInBits,
825                                       uint64_t StorageOffsetInBits,
826                                       LLVMDIFlags Flags, LLVMMetadataRef Type);
827
828 /**
829  * Create debugging information entry for a class.
830  * \param Scope               Scope in which this class is defined.
831  * \param Name                Class name.
832  * \param NameLen             The length of the C string passed to \c Name.
833  * \param File                File where this member is defined.
834  * \param LineNumber          Line number.
835  * \param SizeInBits          Member size.
836  * \param AlignInBits         Member alignment.
837  * \param OffsetInBits        Member offset.
838  * \param Flags               Flags to encode member attribute, e.g. private.
839  * \param DerivedFrom         Debug info of the base class of this type.
840  * \param Elements            Class members.
841  * \param NumElements         Number of class elements.
842  * \param VTableHolder        Debug info of the base class that contains vtable
843  *                            for this type. This is used in
844  *                            DW_AT_containing_type. See DWARF documentation
845  *                            for more info.
846  * \param TemplateParamsNode  Template type parameters.
847  * \param UniqueIdentifier    A unique identifier for the type.
848  * \param UniqueIdentifierLen Length of the unique identifier.
849  */
850 LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
851     LLVMMetadataRef Scope, const char *Name, size_t NameLen,
852     LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
853     uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
854     LLVMMetadataRef DerivedFrom,
855     LLVMMetadataRef *Elements, unsigned NumElements,
856     LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
857     const char *UniqueIdentifier, size_t UniqueIdentifierLen);
858
859 /**
860  * Create a uniqued DIType* clone with FlagArtificial set.
861  * \param Builder     The DIBuilder.
862  * \param Type        The underlying type.
863  */
864 LLVMMetadataRef
865 LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder,
866                                   LLVMMetadataRef Type);
867
868 /**
869  * Get the name of this DIType.
870  * \param DType     The DIType.
871  * \param Length    The length of the returned string.
872  *
873  * @see DIType::getName()
874  */
875 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
876
877 /**
878  * Get the size of this DIType in bits.
879  * \param DType     The DIType.
880  *
881  * @see DIType::getSizeInBits()
882  */
883 uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType);
884
885 /**
886  * Get the offset of this DIType in bits.
887  * \param DType     The DIType.
888  *
889  * @see DIType::getOffsetInBits()
890  */
891 uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType);
892
893 /**
894  * Get the alignment of this DIType in bits.
895  * \param DType     The DIType.
896  *
897  * @see DIType::getAlignInBits()
898  */
899 uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType);
900
901 /**
902  * Get the source line where this DIType is declared.
903  * \param DType     The DIType.
904  *
905  * @see DIType::getLine()
906  */
907 unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
908
909 /**
910  * Get the flags associated with this DIType.
911  * \param DType     The DIType.
912  *
913  * @see DIType::getFlags()
914  */
915 LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
916
917 /**
918  * Create a descriptor for a value range.
919  * \param Builder    The DIBuilder.
920  * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
921  * \param Count      Count of elements in the subrange.
922  */
923 LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder,
924                                                  int64_t LowerBound,
925                                                  int64_t Count);
926
927 /**
928  * Create an array of DI Nodes.
929  * \param Builder        The DIBuilder.
930  * \param Data           The DI Node elements.
931  * \param NumElements    Number of DI Node elements.
932  */
933 LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
934                                               LLVMMetadataRef *Data,
935                                               size_t NumElements);
936
937 /**
938  * Create a new descriptor for the specified variable which has a complex
939  * address expression for its address.
940  * \param Builder     The DIBuilder.
941  * \param Addr        An array of complex address operations.
942  * \param Length      Length of the address operation array.
943  */
944 LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder,
945                                               int64_t *Addr, size_t Length);
946
947 /**
948  * Create a new descriptor for the specified variable that does not have an
949  * address, but does have a constant value.
950  * \param Builder     The DIBuilder.
951  * \param Value       The constant value.
952  */
953 LLVMMetadataRef
954 LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder,
955                                            int64_t Value);
956
957 /**
958  * Create a new descriptor for the specified variable.
959  * \param Scope       Variable scope.
960  * \param Name        Name of the variable.
961  * \param NameLen     The length of the C string passed to \c Name.
962  * \param Linkage     Mangled  name of the variable.
963  * \param LinkLen     The length of the C string passed to \c Linkage.
964  * \param File        File where this variable is defined.
965  * \param LineNo      Line number.
966  * \param Ty          Variable Type.
967  * \param LocalToUnit Boolean flag indicate whether this variable is
968  *                    externally visible or not.
969  * \param Expr        The location of the global relative to the attached
970  *                    GlobalVariable.
971  * \param Decl        Reference to the corresponding declaration.
972  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
973  *                    specified)
974  */
975 LLVMMetadataRef
976 LLVMDIBuilderCreateGlobalVariableExpression(LLVMDIBuilderRef Builder,
977                                             LLVMMetadataRef Scope,
978                                             const char *Name, size_t NameLen,
979                                             const char *Linkage, size_t LinkLen,
980                                             LLVMMetadataRef File,
981                                             unsigned LineNo,
982                                             LLVMMetadataRef Ty,
983                                             LLVMBool LocalToUnit,
984                                             LLVMMetadataRef Expr,
985                                             LLVMMetadataRef Decl,
986                                             uint32_t AlignInBits);
987 /**
988  * Create a new temporary \c MDNode.  Suitable for use in constructing cyclic
989  * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
990  * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
991  * \param Ctx            The context in which to construct the temporary node.
992  * \param Data           The metadata elements.
993  * \param NumElements    Number of metadata elements.
994  */
995 LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data,
996                                     size_t NumElements);
997
998 /**
999  * Deallocate a temporary node.
1000  *
1001  * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1002  * references will be reset.
1003  * \param TempNode    The temporary metadata node.
1004  */
1005 void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode);
1006
1007 /**
1008  * Replace all uses of temporary metadata.
1009  * \param TempTargetMetadata    The temporary metadata node.
1010  * \param Replacement           The replacement metadata node.
1011  */
1012 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
1013                                     LLVMMetadataRef Replacement);
1014
1015 /**
1016  * Create a new descriptor for the specified global variable that is temporary
1017  * and meant to be RAUWed.
1018  * \param Scope       Variable scope.
1019  * \param Name        Name of the variable.
1020  * \param NameLen     The length of the C string passed to \c Name.
1021  * \param Linkage     Mangled  name of the variable.
1022  * \param LnkLen      The length of the C string passed to \c Linkage.
1023  * \param File        File where this variable is defined.
1024  * \param LineNo      Line number.
1025  * \param Ty          Variable Type.
1026  * \param LocalToUnit Boolean flag indicate whether this variable is
1027  *                    externally visible or not.
1028  * \param Decl        Reference to the corresponding declaration.
1029  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1030  *                    specified)
1031  */
1032 LLVMMetadataRef
1033 LLVMDIBuilderCreateTempGlobalVariableFwdDecl(LLVMDIBuilderRef Builder,
1034                                              LLVMMetadataRef Scope,
1035                                              const char *Name, size_t NameLen,
1036                                              const char *Linkage, size_t LnkLen,
1037                                              LLVMMetadataRef File,
1038                                              unsigned LineNo,
1039                                              LLVMMetadataRef Ty,
1040                                              LLVMBool LocalToUnit,
1041                                              LLVMMetadataRef Decl,
1042                                              uint32_t AlignInBits);
1043
1044 /**
1045  * Insert a new llvm.dbg.declare intrinsic call before the given instruction.
1046  * \param Builder     The DIBuilder.
1047  * \param Storage     The storage of the variable to declare.
1048  * \param VarInfo     The variable's debug info descriptor.
1049  * \param Expr        A complex location expression for the variable.
1050  * \param DebugLoc    Debug info location.
1051  * \param Instr       Instruction acting as a location for the new intrinsic.
1052  */
1053 LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
1054   LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1055   LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1056
1057 /**
1058  * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic
1059  * block. If the basic block has a terminator instruction, the intrinsic is
1060  * inserted before that terminator instruction.
1061  * \param Builder     The DIBuilder.
1062  * \param Storage     The storage of the variable to declare.
1063  * \param VarInfo     The variable's debug info descriptor.
1064  * \param Expr        A complex location expression for the variable.
1065  * \param DebugLoc    Debug info location.
1066  * \param Block       Basic block acting as a location for the new intrinsic.
1067  */
1068 LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
1069     LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1070     LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1071
1072 /**
1073  * Insert a new llvm.dbg.value intrinsic call before the given instruction.
1074  * \param Builder     The DIBuilder.
1075  * \param Val         The value of the variable.
1076  * \param VarInfo     The variable's debug info descriptor.
1077  * \param Expr        A complex location expression for the variable.
1078  * \param DebugLoc    Debug info location.
1079  * \param Instr       Instruction acting as a location for the new intrinsic.
1080  */
1081 LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder,
1082                                                LLVMValueRef Val,
1083                                                LLVMMetadataRef VarInfo,
1084                                                LLVMMetadataRef Expr,
1085                                                LLVMMetadataRef DebugLoc,
1086                                                LLVMValueRef Instr);
1087
1088 /**
1089  * Insert a new llvm.dbg.value intrinsic call at the end of the given basic
1090  * block. If the basic block has a terminator instruction, the intrinsic is
1091  * inserted before that terminator instruction.
1092  * \param Builder     The DIBuilder.
1093  * \param Val         The value of the variable.
1094  * \param VarInfo     The variable's debug info descriptor.
1095  * \param Expr        A complex location expression for the variable.
1096  * \param DebugLoc    Debug info location.
1097  * \param Block       Basic block acting as a location for the new intrinsic.
1098  */
1099 LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder,
1100                                               LLVMValueRef Val,
1101                                               LLVMMetadataRef VarInfo,
1102                                               LLVMMetadataRef Expr,
1103                                               LLVMMetadataRef DebugLoc,
1104                                               LLVMBasicBlockRef Block);
1105
1106 /**
1107  * Create a new descriptor for a local auto variable.
1108  * \param Builder         The DIBuilder.
1109  * \param Scope           The local scope the variable is declared in.
1110  * \param Name            Variable name.
1111  * \param NameLen         Length of variable name.
1112  * \param File            File where this variable is defined.
1113  * \param LineNo          Line number.
1114  * \param Ty              Metadata describing the type of the variable.
1115  * \param AlwaysPreserve  If true, this descriptor will survive optimizations.
1116  * \param Flags           Flags.
1117  * \param AlignInBits     Variable alignment.
1118  */
1119 LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
1120     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1121     size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1122     LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1123
1124 /**
1125  * Create a new descriptor for a function parameter variable.
1126  * \param Builder         The DIBuilder.
1127  * \param Scope           The local scope the variable is declared in.
1128  * \param Name            Variable name.
1129  * \param NameLen         Length of variable name.
1130  * \param ArgNo           Unique argument number for this variable; starts at 1.
1131  * \param File            File where this variable is defined.
1132  * \param LineNo          Line number.
1133  * \param Ty              Metadata describing the type of the variable.
1134  * \param AlwaysPreserve  If true, this descriptor will survive optimizations.
1135  * \param Flags           Flags.
1136  */
1137 LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
1138     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1139     size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1140     LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1141
1142 /**
1143  * Get the metadata of the subprogram attached to a function.
1144  *
1145  * @see llvm::Function::getSubprogram()
1146  */
1147 LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func);
1148
1149 /**
1150  * Set the subprogram attached to a function.
1151  *
1152  * @see llvm::Function::setSubprogram()
1153  */
1154 void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
1155
1156 #ifdef __cplusplus
1157 } /* end extern "C" */
1158 #endif
1159
1160 #endif