Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / include / llvm-c / DebugInfo.h
blobb4c9b6578490e3c64b676c2a0f70ad9b50fabded
1 //===------------ DebugInfo.h - LLVM C API Debug Info API -----------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// This file declares the C API endpoints for generating DWARF Debug Info
10 ///
11 /// Note: This interface is experimental. It is *NOT* stable, and may be
12 /// changed without warning.
13 ///
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_C_DEBUGINFO_H
17 #define LLVM_C_DEBUGINFO_H
19 #include "llvm-c/Core.h"
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 /**
26 * Debug info flags.
28 typedef enum {
29 LLVMDIFlagZero = 0,
30 LLVMDIFlagPrivate = 1,
31 LLVMDIFlagProtected = 2,
32 LLVMDIFlagPublic = 3,
33 LLVMDIFlagFwdDecl = 1 << 2,
34 LLVMDIFlagAppleBlock = 1 << 3,
35 LLVMDIFlagBlockByrefStruct = 1 << 4,
36 LLVMDIFlagVirtual = 1 << 5,
37 LLVMDIFlagArtificial = 1 << 6,
38 LLVMDIFlagExplicit = 1 << 7,
39 LLVMDIFlagPrototyped = 1 << 8,
40 LLVMDIFlagObjcClassComplete = 1 << 9,
41 LLVMDIFlagObjectPointer = 1 << 10,
42 LLVMDIFlagVector = 1 << 11,
43 LLVMDIFlagStaticMember = 1 << 12,
44 LLVMDIFlagLValueReference = 1 << 13,
45 LLVMDIFlagRValueReference = 1 << 14,
46 LLVMDIFlagReserved = 1 << 15,
47 LLVMDIFlagSingleInheritance = 1 << 16,
48 LLVMDIFlagMultipleInheritance = 2 << 16,
49 LLVMDIFlagVirtualInheritance = 3 << 16,
50 LLVMDIFlagIntroducedVirtual = 1 << 18,
51 LLVMDIFlagBitField = 1 << 19,
52 LLVMDIFlagNoReturn = 1 << 20,
53 LLVMDIFlagMainSubprogram = 1 << 21,
54 LLVMDIFlagTypePassByValue = 1 << 22,
55 LLVMDIFlagTypePassByReference = 1 << 23,
56 LLVMDIFlagEnumClass = 1 << 24,
57 LLVMDIFlagFixedEnum = LLVMDIFlagEnumClass, // Deprecated.
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;
70 /**
71 * Source languages known by DWARF.
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;
121 * The amount of debug information to emit.
123 typedef enum {
124 LLVMDWARFEmissionNone = 0,
125 LLVMDWARFEmissionFull,
126 LLVMDWARFEmissionLineTablesOnly
127 } LLVMDWARFEmissionKind;
130 * The kind of metadata nodes.
132 enum {
133 LLVMMDStringMetadataKind,
134 LLVMConstantAsMetadataMetadataKind,
135 LLVMLocalAsMetadataMetadataKind,
136 LLVMDistinctMDOperandPlaceholderMetadataKind,
137 LLVMMDTupleMetadataKind,
138 LLVMDILocationMetadataKind,
139 LLVMDIExpressionMetadataKind,
140 LLVMDIGlobalVariableExpressionMetadataKind,
141 LLVMGenericDINodeMetadataKind,
142 LLVMDISubrangeMetadataKind,
143 LLVMDIEnumeratorMetadataKind,
144 LLVMDIBasicTypeMetadataKind,
145 LLVMDIDerivedTypeMetadataKind,
146 LLVMDICompositeTypeMetadataKind,
147 LLVMDISubroutineTypeMetadataKind,
148 LLVMDIFileMetadataKind,
149 LLVMDICompileUnitMetadataKind,
150 LLVMDISubprogramMetadataKind,
151 LLVMDILexicalBlockMetadataKind,
152 LLVMDILexicalBlockFileMetadataKind,
153 LLVMDINamespaceMetadataKind,
154 LLVMDIModuleMetadataKind,
155 LLVMDITemplateTypeParameterMetadataKind,
156 LLVMDITemplateValueParameterMetadataKind,
157 LLVMDIGlobalVariableMetadataKind,
158 LLVMDILocalVariableMetadataKind,
159 LLVMDILabelMetadataKind,
160 LLVMDIObjCPropertyMetadataKind,
161 LLVMDIImportedEntityMetadataKind,
162 LLVMDIMacroMetadataKind,
163 LLVMDIMacroFileMetadataKind
165 typedef unsigned LLVMMetadataKind;
168 * An LLVM DWARF type encoding.
170 typedef unsigned LLVMDWARFTypeEncoding;
173 * The current debug metadata version number.
175 unsigned LLVMDebugMetadataVersion(void);
178 * The version of debug metadata that's present in the provided \c Module.
180 unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module);
183 * Strip debug info in the module if it exists.
184 * To do this, we remove all calls to the debugger intrinsics and any named
185 * metadata for debugging. We also remove debug locations for instructions.
186 * Return true if module is modified.
188 LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module);
191 * Construct a builder for a module, and do not allow for unresolved nodes
192 * attached to the module.
194 LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M);
197 * Construct a builder for a module and collect unresolved nodes attached
198 * to the module in order to resolve cycles during a call to
199 * \c LLVMDIBuilderFinalize.
201 LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M);
204 * Deallocates the \c DIBuilder and everything it owns.
205 * @note You must call \c LLVMDIBuilderFinalize before this
207 void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder);
210 * Construct any deferred debug info descriptors.
212 void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder);
215 * A CompileUnit provides an anchor for all debugging
216 * information generated during this instance of compilation.
217 * \param Lang Source programming language, eg.
218 * \c LLVMDWARFSourceLanguageC99
219 * \param FileRef File info.
220 * \param Producer Identify the producer of debugging information
221 * and code. Usually this is a compiler
222 * version string.
223 * \param ProducerLen The length of the C string passed to \c Producer.
224 * \param isOptimized A boolean flag which indicates whether optimization
225 * is enabled or not.
226 * \param Flags This string lists command line options. This
227 * string is directly embedded in debug info
228 * output which may be used by a tool
229 * analyzing generated debugging information.
230 * \param FlagsLen The length of the C string passed to \c Flags.
231 * \param RuntimeVer This indicates runtime version for languages like
232 * Objective-C.
233 * \param SplitName The name of the file that we'll split debug info
234 * out into.
235 * \param SplitNameLen The length of the C string passed to \c SplitName.
236 * \param Kind The kind of debug information to generate.
237 * \param DWOId The DWOId if this is a split skeleton compile unit.
238 * \param SplitDebugInlining Whether to emit inline debug info.
239 * \param DebugInfoForProfiling Whether to emit extra debug info for
240 * profile collection.
242 LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(
243 LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
244 LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
245 LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
246 unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
247 LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
248 LLVMBool DebugInfoForProfiling);
251 * Create a file descriptor to hold debugging information for a file.
252 * \param Builder The \c DIBuilder.
253 * \param Filename File name.
254 * \param FilenameLen The length of the C string passed to \c Filename.
255 * \param Directory Directory.
256 * \param DirectoryLen The length of the C string passed to \c Directory.
258 LLVMMetadataRef
259 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
260 size_t FilenameLen, const char *Directory,
261 size_t DirectoryLen);
264 * Creates a new descriptor for a module with the specified parent scope.
265 * \param Builder The \c DIBuilder.
266 * \param ParentScope The parent scope containing this module declaration.
267 * \param Name Module name.
268 * \param NameLen The length of the C string passed to \c Name.
269 * \param ConfigMacros A space-separated shell-quoted list of -D macro
270 definitions as they would appear on a command line.
271 * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
272 * \param IncludePath The path to the module map file.
273 * \param IncludePathLen The length of the C string passed to \c IncludePath.
274 * \param ISysRoot The Clang system root (value of -isysroot).
275 * \param ISysRootLen The length of the C string passed to \c ISysRoot.
277 LLVMMetadataRef
278 LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
279 const char *Name, size_t NameLen,
280 const char *ConfigMacros, size_t ConfigMacrosLen,
281 const char *IncludePath, size_t IncludePathLen,
282 const char *ISysRoot, size_t ISysRootLen);
285 * Creates a new descriptor for a namespace with the specified parent scope.
286 * \param Builder The \c DIBuilder.
287 * \param ParentScope The parent scope containing this module declaration.
288 * \param Name NameSpace name.
289 * \param NameLen The length of the C string passed to \c Name.
290 * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
291 * this is true of C++ inline namespaces.
293 LLVMMetadataRef
294 LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder,
295 LLVMMetadataRef ParentScope,
296 const char *Name, size_t NameLen,
297 LLVMBool ExportSymbols);
300 * Create a new descriptor for the specified subprogram.
301 * \param Builder The \c DIBuilder.
302 * \param Scope Function scope.
303 * \param Name Function name.
304 * \param NameLen Length of enumeration name.
305 * \param LinkageName Mangled function name.
306 * \param LinkageNameLen Length of linkage name.
307 * \param File File where this variable is defined.
308 * \param LineNo Line number.
309 * \param Ty Function type.
310 * \param IsLocalToUnit True if this function is not externally visible.
311 * \param IsDefinition True if this is a function definition.
312 * \param ScopeLine Set to the beginning of the scope this starts
313 * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
314 * used to emit dwarf attributes.
315 * \param IsOptimized True if optimization is ON.
317 LLVMMetadataRef LLVMDIBuilderCreateFunction(
318 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
319 size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
320 LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
321 LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
322 unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized);
325 * Create a descriptor for a lexical block with the specified parent context.
326 * \param Builder The \c DIBuilder.
327 * \param Scope Parent lexical block.
328 * \param File Source file.
329 * \param Line The line in the source file.
330 * \param Column The column in the source file.
332 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
333 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
334 LLVMMetadataRef File, unsigned Line, unsigned Column);
337 * Create a descriptor for a lexical block with a new file attached.
338 * \param Builder The \c DIBuilder.
339 * \param Scope Lexical block.
340 * \param File Source file.
341 * \param Discriminator DWARF path discriminator value.
343 LLVMMetadataRef
344 LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder,
345 LLVMMetadataRef Scope,
346 LLVMMetadataRef File,
347 unsigned Discriminator);
350 * Create a descriptor for an imported namespace. Suitable for e.g. C++
351 * using declarations.
352 * \param Builder The \c DIBuilder.
353 * \param Scope The scope this module is imported into
354 * \param File File where the declaration is located.
355 * \param Line Line number of the declaration.
357 LLVMMetadataRef
358 LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder,
359 LLVMMetadataRef Scope,
360 LLVMMetadataRef NS,
361 LLVMMetadataRef File,
362 unsigned Line);
365 * Create a descriptor for an imported module that aliases another
366 * imported entity descriptor.
367 * \param Builder The \c DIBuilder.
368 * \param Scope The scope this module is imported into
369 * \param ImportedEntity Previous imported entity to alias.
370 * \param File File where the declaration is located.
371 * \param Line Line number of the declaration.
373 LLVMMetadataRef
374 LLVMDIBuilderCreateImportedModuleFromAlias(LLVMDIBuilderRef Builder,
375 LLVMMetadataRef Scope,
376 LLVMMetadataRef ImportedEntity,
377 LLVMMetadataRef File,
378 unsigned Line);
381 * Create a descriptor for an imported module.
382 * \param Builder The \c DIBuilder.
383 * \param Scope The scope this module is imported into
384 * \param M The module being imported here
385 * \param File File where the declaration is located.
386 * \param Line Line number of the declaration.
388 LLVMMetadataRef
389 LLVMDIBuilderCreateImportedModuleFromModule(LLVMDIBuilderRef Builder,
390 LLVMMetadataRef Scope,
391 LLVMMetadataRef M,
392 LLVMMetadataRef File,
393 unsigned Line);
396 * Create a descriptor for an imported function, type, or variable. Suitable
397 * for e.g. FORTRAN-style USE declarations.
398 * \param Builder The DIBuilder.
399 * \param Scope The scope this module is imported into.
400 * \param Decl The declaration (or definition) of a function, type,
401 or variable.
402 * \param File File where the declaration is located.
403 * \param Line Line number of the declaration.
404 * \param Name A name that uniquely identifies this imported declaration.
405 * \param NameLen The length of the C string passed to \c Name.
407 LLVMMetadataRef
408 LLVMDIBuilderCreateImportedDeclaration(LLVMDIBuilderRef Builder,
409 LLVMMetadataRef Scope,
410 LLVMMetadataRef Decl,
411 LLVMMetadataRef File,
412 unsigned Line,
413 const char *Name, size_t NameLen);
416 * Creates a new DebugLocation that describes a source location.
417 * \param Line The line in the source file.
418 * \param Column The column in the source file.
419 * \param Scope The scope in which the location resides.
420 * \param InlinedAt The scope where this location was inlined, if at all.
421 * (optional).
422 * \note If the item to which this location is attached cannot be
423 * attributed to a source line, pass 0 for the line and column.
425 LLVMMetadataRef
426 LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line,
427 unsigned Column, LLVMMetadataRef Scope,
428 LLVMMetadataRef InlinedAt);
431 * Get the line number of this debug location.
432 * \param Location The debug location.
434 * @see DILocation::getLine()
436 unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
439 * Get the column number of this debug location.
440 * \param Location The debug location.
442 * @see DILocation::getColumn()
444 unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
447 * Get the local scope associated with this debug location.
448 * \param Location The debug location.
450 * @see DILocation::getScope()
452 LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
455 * Create a type array.
456 * \param Builder The DIBuilder.
457 * \param Data The type elements.
458 * \param NumElements Number of type elements.
460 LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder,
461 LLVMMetadataRef *Data,
462 size_t NumElements);
465 * Create subroutine type.
466 * \param Builder The DIBuilder.
467 * \param File The file in which the subroutine resides.
468 * \param ParameterTypes An array of subroutine parameter types. This
469 * includes return type at 0th index.
470 * \param NumParameterTypes The number of parameter types in \c ParameterTypes
471 * \param Flags E.g.: \c LLVMDIFlagLValueReference.
472 * These flags are used to emit dwarf attributes.
474 LLVMMetadataRef
475 LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
476 LLVMMetadataRef File,
477 LLVMMetadataRef *ParameterTypes,
478 unsigned NumParameterTypes,
479 LLVMDIFlags Flags);
482 * Create debugging information entry for an enumerator.
483 * @param Builder The DIBuilder.
484 * @param Name Enumerator name.
485 * @param NameLen Length of enumerator name.
486 * @param Value Enumerator value.
487 * @param IsUnsigned True if the value is unsigned.
489 LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
490 const char *Name, size_t NameLen,
491 int64_t Value,
492 LLVMBool IsUnsigned);
495 * Create debugging information entry for an enumeration.
496 * \param Builder The DIBuilder.
497 * \param Scope Scope in which this enumeration is defined.
498 * \param Name Enumeration name.
499 * \param NameLen Length of enumeration name.
500 * \param File File where this member is defined.
501 * \param LineNumber Line number.
502 * \param SizeInBits Member size.
503 * \param AlignInBits Member alignment.
504 * \param Elements Enumeration elements.
505 * \param NumElements Number of enumeration elements.
506 * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
508 LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
509 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
510 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
511 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
512 unsigned NumElements, LLVMMetadataRef ClassTy);
515 * Create debugging information entry for a union.
516 * \param Builder The DIBuilder.
517 * \param Scope Scope in which this union is defined.
518 * \param Name Union name.
519 * \param NameLen Length of union name.
520 * \param File File where this member is defined.
521 * \param LineNumber Line number.
522 * \param SizeInBits Member size.
523 * \param AlignInBits Member alignment.
524 * \param Flags Flags to encode member attribute, e.g. private
525 * \param Elements Union elements.
526 * \param NumElements Number of union elements.
527 * \param RunTimeLang Optional parameter, Objective-C runtime version.
528 * \param UniqueId A unique identifier for the union.
529 * \param UniqueIdLen Length of unique identifier.
531 LLVMMetadataRef LLVMDIBuilderCreateUnionType(
532 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
533 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
534 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
535 LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
536 const char *UniqueId, size_t UniqueIdLen);
540 * Create debugging information entry for an array.
541 * \param Builder The DIBuilder.
542 * \param Size Array size.
543 * \param AlignInBits Alignment.
544 * \param Ty Element type.
545 * \param Subscripts Subscripts.
546 * \param NumSubscripts Number of subscripts.
548 LLVMMetadataRef
549 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
550 uint32_t AlignInBits, LLVMMetadataRef Ty,
551 LLVMMetadataRef *Subscripts,
552 unsigned NumSubscripts);
555 * Create debugging information entry for a vector type.
556 * \param Builder The DIBuilder.
557 * \param Size Vector size.
558 * \param AlignInBits Alignment.
559 * \param Ty Element type.
560 * \param Subscripts Subscripts.
561 * \param NumSubscripts Number of subscripts.
563 LLVMMetadataRef
564 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
565 uint32_t AlignInBits, LLVMMetadataRef Ty,
566 LLVMMetadataRef *Subscripts,
567 unsigned NumSubscripts);
570 * Create a DWARF unspecified type.
571 * \param Builder The DIBuilder.
572 * \param Name The unspecified type's name.
573 * \param NameLen Length of type name.
575 LLVMMetadataRef
576 LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name,
577 size_t NameLen);
580 * Create debugging information entry for a basic
581 * type.
582 * \param Builder The DIBuilder.
583 * \param Name Type name.
584 * \param NameLen Length of type name.
585 * \param SizeInBits Size of the type.
586 * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
587 * \param Flags Flags to encode optional attribute like endianity
589 LLVMMetadataRef
590 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
591 size_t NameLen, uint64_t SizeInBits,
592 LLVMDWARFTypeEncoding Encoding,
593 LLVMDIFlags Flags);
596 * Create debugging information entry for a pointer.
597 * \param Builder The DIBuilder.
598 * \param PointeeTy Type pointed by this pointer.
599 * \param SizeInBits Size.
600 * \param AlignInBits Alignment. (optional, pass 0 to ignore)
601 * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
602 * \param Name Pointer type name. (optional)
603 * \param NameLen Length of pointer type name. (optional)
605 LLVMMetadataRef LLVMDIBuilderCreatePointerType(
606 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
607 uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
608 const char *Name, size_t NameLen);
611 * Create debugging information entry for a struct.
612 * \param Builder The DIBuilder.
613 * \param Scope Scope in which this struct is defined.
614 * \param Name Struct name.
615 * \param NameLen Struct name length.
616 * \param File File where this member is defined.
617 * \param LineNumber Line number.
618 * \param SizeInBits Member size.
619 * \param AlignInBits Member alignment.
620 * \param Flags Flags to encode member attribute, e.g. private
621 * \param Elements Struct elements.
622 * \param NumElements Number of struct elements.
623 * \param RunTimeLang Optional parameter, Objective-C runtime version.
624 * \param VTableHolder The object containing the vtable for the struct.
625 * \param UniqueId A unique identifier for the struct.
626 * \param UniqueIdLen Length of the unique identifier for the struct.
628 LLVMMetadataRef LLVMDIBuilderCreateStructType(
629 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
630 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
631 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
632 LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
633 unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
634 const char *UniqueId, size_t UniqueIdLen);
637 * Create debugging information entry for a member.
638 * \param Builder The DIBuilder.
639 * \param Scope Member scope.
640 * \param Name Member name.
641 * \param NameLen Length of member name.
642 * \param File File where this member is defined.
643 * \param LineNo Line number.
644 * \param SizeInBits Member size.
645 * \param AlignInBits Member alignment.
646 * \param OffsetInBits Member offset.
647 * \param Flags Flags to encode member attribute, e.g. private
648 * \param Ty Parent type.
650 LLVMMetadataRef LLVMDIBuilderCreateMemberType(
651 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
652 size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
653 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
654 LLVMDIFlags Flags, LLVMMetadataRef Ty);
657 * Create debugging information entry for a
658 * C++ static data member.
659 * \param Builder The DIBuilder.
660 * \param Scope Member scope.
661 * \param Name Member name.
662 * \param NameLen Length of member name.
663 * \param File File where this member is declared.
664 * \param LineNumber Line number.
665 * \param Type Type of the static member.
666 * \param Flags Flags to encode member attribute, e.g. private.
667 * \param ConstantVal Const initializer of the member.
668 * \param AlignInBits Member alignment.
670 LLVMMetadataRef
671 LLVMDIBuilderCreateStaticMemberType(
672 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
673 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
674 LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
675 uint32_t AlignInBits);
678 * Create debugging information entry for a pointer to member.
679 * \param Builder The DIBuilder.
680 * \param PointeeType Type pointed to by this pointer.
681 * \param ClassType Type for which this pointer points to members of.
682 * \param SizeInBits Size.
683 * \param AlignInBits Alignment.
684 * \param Flags Flags.
686 LLVMMetadataRef
687 LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
688 LLVMMetadataRef PointeeType,
689 LLVMMetadataRef ClassType,
690 uint64_t SizeInBits,
691 uint32_t AlignInBits,
692 LLVMDIFlags Flags);
694 * Create debugging information entry for Objective-C instance variable.
695 * \param Builder The DIBuilder.
696 * \param Name Member name.
697 * \param NameLen The length of the C string passed to \c Name.
698 * \param File File where this member is defined.
699 * \param LineNo Line number.
700 * \param SizeInBits Member size.
701 * \param AlignInBits Member alignment.
702 * \param OffsetInBits Member offset.
703 * \param Flags Flags to encode member attribute, e.g. private
704 * \param Ty Parent type.
705 * \param PropertyNode Property associated with this ivar.
707 LLVMMetadataRef
708 LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder,
709 const char *Name, size_t NameLen,
710 LLVMMetadataRef File, unsigned LineNo,
711 uint64_t SizeInBits, uint32_t AlignInBits,
712 uint64_t OffsetInBits, LLVMDIFlags Flags,
713 LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
716 * Create debugging information entry for Objective-C property.
717 * \param Builder The DIBuilder.
718 * \param Name Property name.
719 * \param NameLen The length of the C string passed to \c Name.
720 * \param File File where this property is defined.
721 * \param LineNo Line number.
722 * \param GetterName Name of the Objective C property getter selector.
723 * \param GetterNameLen The length of the C string passed to \c GetterName.
724 * \param SetterName Name of the Objective C property setter selector.
725 * \param SetterNameLen The length of the C string passed to \c SetterName.
726 * \param PropertyAttributes Objective C property attributes.
727 * \param Ty Type.
729 LLVMMetadataRef
730 LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
731 const char *Name, size_t NameLen,
732 LLVMMetadataRef File, unsigned LineNo,
733 const char *GetterName, size_t GetterNameLen,
734 const char *SetterName, size_t SetterNameLen,
735 unsigned PropertyAttributes,
736 LLVMMetadataRef Ty);
739 * Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
740 * \param Builder The DIBuilder.
741 * \param Type The underlying type to which this pointer points.
743 LLVMMetadataRef
744 LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
745 LLVMMetadataRef Type);
748 * Create debugging information entry for a qualified
749 * type, e.g. 'const int'.
750 * \param Builder The DIBuilder.
751 * \param Tag Tag identifying type,
752 * e.g. LLVMDWARFTypeQualifier_volatile_type
753 * \param Type Base Type.
755 LLVMMetadataRef
756 LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag,
757 LLVMMetadataRef Type);
760 * Create debugging information entry for a c++
761 * style reference or rvalue reference type.
762 * \param Builder The DIBuilder.
763 * \param Tag Tag identifying type,
764 * \param Type Base Type.
766 LLVMMetadataRef
767 LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag,
768 LLVMMetadataRef Type);
771 * Create C++11 nullptr type.
772 * \param Builder The DIBuilder.
774 LLVMMetadataRef
775 LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder);
778 * Create debugging information entry for a typedef.
779 * \param Builder The DIBuilder.
780 * \param Type Original type.
781 * \param Name Typedef name.
782 * \param File File where this type is defined.
783 * \param LineNo Line number.
784 * \param Scope The surrounding context for the typedef.
786 LLVMMetadataRef
787 LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type,
788 const char *Name, size_t NameLen,
789 LLVMMetadataRef File, unsigned LineNo,
790 LLVMMetadataRef Scope);
793 * Create debugging information entry to establish inheritance relationship
794 * between two types.
795 * \param Builder The DIBuilder.
796 * \param Ty Original type.
797 * \param BaseTy Base type. Ty is inherits from base.
798 * \param BaseOffset Base offset.
799 * \param VBPtrOffset Virtual base pointer offset.
800 * \param Flags Flags to describe inheritance attribute, e.g. private
802 LLVMMetadataRef
803 LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder,
804 LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
805 uint64_t BaseOffset, uint32_t VBPtrOffset,
806 LLVMDIFlags Flags);
809 * Create a permanent forward-declared type.
810 * \param Builder The DIBuilder.
811 * \param Tag A unique tag for this type.
812 * \param Name Type name.
813 * \param NameLen Length of type name.
814 * \param Scope Type scope.
815 * \param File File where this type is defined.
816 * \param Line Line number where this type is defined.
817 * \param RuntimeLang Indicates runtime version for languages like
818 * Objective-C.
819 * \param SizeInBits Member size.
820 * \param AlignInBits Member alignment.
821 * \param UniqueIdentifier A unique identifier for the type.
822 * \param UniqueIdentifierLen Length of the unique identifier.
824 LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
825 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
826 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
827 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
828 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
831 * Create a temporary forward-declared type.
832 * \param Builder The DIBuilder.
833 * \param Tag A unique tag for this type.
834 * \param Name Type name.
835 * \param NameLen Length of type name.
836 * \param Scope Type scope.
837 * \param File File where this type is defined.
838 * \param Line Line number where this type is defined.
839 * \param RuntimeLang Indicates runtime version for languages like
840 * Objective-C.
841 * \param SizeInBits Member size.
842 * \param AlignInBits Member alignment.
843 * \param Flags Flags.
844 * \param UniqueIdentifier A unique identifier for the type.
845 * \param UniqueIdentifierLen Length of the unique identifier.
847 LLVMMetadataRef
848 LLVMDIBuilderCreateReplaceableCompositeType(
849 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
850 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
851 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
852 LLVMDIFlags Flags, const char *UniqueIdentifier,
853 size_t UniqueIdentifierLen);
856 * Create debugging information entry for a bit field member.
857 * \param Builder The DIBuilder.
858 * \param Scope Member scope.
859 * \param Name Member name.
860 * \param NameLen Length of member name.
861 * \param File File where this member is defined.
862 * \param LineNumber Line number.
863 * \param SizeInBits Member size.
864 * \param OffsetInBits Member offset.
865 * \param StorageOffsetInBits Member storage offset.
866 * \param Flags Flags to encode member attribute.
867 * \param Type Parent type.
869 LLVMMetadataRef
870 LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder,
871 LLVMMetadataRef Scope,
872 const char *Name, size_t NameLen,
873 LLVMMetadataRef File, unsigned LineNumber,
874 uint64_t SizeInBits,
875 uint64_t OffsetInBits,
876 uint64_t StorageOffsetInBits,
877 LLVMDIFlags Flags, LLVMMetadataRef Type);
880 * Create debugging information entry for a class.
881 * \param Scope Scope in which this class is defined.
882 * \param Name Class name.
883 * \param NameLen The length of the C string passed to \c Name.
884 * \param File File where this member is defined.
885 * \param LineNumber Line number.
886 * \param SizeInBits Member size.
887 * \param AlignInBits Member alignment.
888 * \param OffsetInBits Member offset.
889 * \param Flags Flags to encode member attribute, e.g. private.
890 * \param DerivedFrom Debug info of the base class of this type.
891 * \param Elements Class members.
892 * \param NumElements Number of class elements.
893 * \param VTableHolder Debug info of the base class that contains vtable
894 * for this type. This is used in
895 * DW_AT_containing_type. See DWARF documentation
896 * for more info.
897 * \param TemplateParamsNode Template type parameters.
898 * \param UniqueIdentifier A unique identifier for the type.
899 * \param UniqueIdentifierLen Length of the unique identifier.
901 LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
902 LLVMMetadataRef Scope, const char *Name, size_t NameLen,
903 LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
904 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
905 LLVMMetadataRef DerivedFrom,
906 LLVMMetadataRef *Elements, unsigned NumElements,
907 LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
908 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
911 * Create a uniqued DIType* clone with FlagArtificial set.
912 * \param Builder The DIBuilder.
913 * \param Type The underlying type.
915 LLVMMetadataRef
916 LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder,
917 LLVMMetadataRef Type);
920 * Get the name of this DIType.
921 * \param DType The DIType.
922 * \param Length The length of the returned string.
924 * @see DIType::getName()
926 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
929 * Get the size of this DIType in bits.
930 * \param DType The DIType.
932 * @see DIType::getSizeInBits()
934 uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType);
937 * Get the offset of this DIType in bits.
938 * \param DType The DIType.
940 * @see DIType::getOffsetInBits()
942 uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType);
945 * Get the alignment of this DIType in bits.
946 * \param DType The DIType.
948 * @see DIType::getAlignInBits()
950 uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType);
953 * Get the source line where this DIType is declared.
954 * \param DType The DIType.
956 * @see DIType::getLine()
958 unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
961 * Get the flags associated with this DIType.
962 * \param DType The DIType.
964 * @see DIType::getFlags()
966 LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
969 * Create a descriptor for a value range.
970 * \param Builder The DIBuilder.
971 * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
972 * \param Count Count of elements in the subrange.
974 LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder,
975 int64_t LowerBound,
976 int64_t Count);
979 * Create an array of DI Nodes.
980 * \param Builder The DIBuilder.
981 * \param Data The DI Node elements.
982 * \param NumElements Number of DI Node elements.
984 LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
985 LLVMMetadataRef *Data,
986 size_t NumElements);
989 * Create a new descriptor for the specified variable which has a complex
990 * address expression for its address.
991 * \param Builder The DIBuilder.
992 * \param Addr An array of complex address operations.
993 * \param Length Length of the address operation array.
995 LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder,
996 int64_t *Addr, size_t Length);
999 * Create a new descriptor for the specified variable that does not have an
1000 * address, but does have a constant value.
1001 * \param Builder The DIBuilder.
1002 * \param Value The constant value.
1004 LLVMMetadataRef
1005 LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder,
1006 int64_t Value);
1009 * Create a new descriptor for the specified variable.
1010 * \param Scope Variable scope.
1011 * \param Name Name of the variable.
1012 * \param NameLen The length of the C string passed to \c Name.
1013 * \param Linkage Mangled name of the variable.
1014 * \param LinkLen The length of the C string passed to \c Linkage.
1015 * \param File File where this variable is defined.
1016 * \param LineNo Line number.
1017 * \param Ty Variable Type.
1018 * \param LocalToUnit Boolean flag indicate whether this variable is
1019 * externally visible or not.
1020 * \param Expr The location of the global relative to the attached
1021 * GlobalVariable.
1022 * \param Decl Reference to the corresponding declaration.
1023 * variables.
1024 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1025 * specified)
1027 LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(
1028 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1029 size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
1030 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1031 LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
1033 * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
1034 * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
1035 * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
1036 * \param Ctx The context in which to construct the temporary node.
1037 * \param Data The metadata elements.
1038 * \param NumElements Number of metadata elements.
1040 LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data,
1041 size_t NumElements);
1044 * Deallocate a temporary node.
1046 * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1047 * references will be reset.
1048 * \param TempNode The temporary metadata node.
1050 void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode);
1053 * Replace all uses of temporary metadata.
1054 * \param TempTargetMetadata The temporary metadata node.
1055 * \param Replacement The replacement metadata node.
1057 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
1058 LLVMMetadataRef Replacement);
1061 * Create a new descriptor for the specified global variable that is temporary
1062 * and meant to be RAUWed.
1063 * \param Scope Variable scope.
1064 * \param Name Name of the variable.
1065 * \param NameLen The length of the C string passed to \c Name.
1066 * \param Linkage Mangled name of the variable.
1067 * \param LnkLen The length of the C string passed to \c Linkage.
1068 * \param File File where this variable is defined.
1069 * \param LineNo Line number.
1070 * \param Ty Variable Type.
1071 * \param LocalToUnit Boolean flag indicate whether this variable is
1072 * externally visible or not.
1073 * \param Decl Reference to the corresponding declaration.
1074 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1075 * specified)
1077 LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(
1078 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1079 size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
1080 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1081 LLVMMetadataRef Decl, uint32_t AlignInBits);
1084 * Insert a new llvm.dbg.declare intrinsic call before the given instruction.
1085 * \param Builder The DIBuilder.
1086 * \param Storage The storage of the variable to declare.
1087 * \param VarInfo The variable's debug info descriptor.
1088 * \param Expr A complex location expression for the variable.
1089 * \param DebugLoc Debug info location.
1090 * \param Instr Instruction acting as a location for the new intrinsic.
1092 LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
1093 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1094 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1097 * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic
1098 * block. If the basic block has a terminator instruction, the intrinsic is
1099 * inserted before that terminator instruction.
1100 * \param Builder The DIBuilder.
1101 * \param Storage The storage of the variable to declare.
1102 * \param VarInfo The variable's debug info descriptor.
1103 * \param Expr A complex location expression for the variable.
1104 * \param DebugLoc Debug info location.
1105 * \param Block Basic block acting as a location for the new intrinsic.
1107 LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
1108 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1109 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1112 * Insert a new llvm.dbg.value intrinsic call before the given instruction.
1113 * \param Builder The DIBuilder.
1114 * \param Val The value of the variable.
1115 * \param VarInfo The variable's debug info descriptor.
1116 * \param Expr A complex location expression for the variable.
1117 * \param DebugLoc Debug info location.
1118 * \param Instr Instruction acting as a location for the new intrinsic.
1120 LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder,
1121 LLVMValueRef Val,
1122 LLVMMetadataRef VarInfo,
1123 LLVMMetadataRef Expr,
1124 LLVMMetadataRef DebugLoc,
1125 LLVMValueRef Instr);
1128 * Insert a new llvm.dbg.value intrinsic call at the end of the given basic
1129 * block. If the basic block has a terminator instruction, the intrinsic is
1130 * inserted before that terminator instruction.
1131 * \param Builder The DIBuilder.
1132 * \param Val The value of the variable.
1133 * \param VarInfo The variable's debug info descriptor.
1134 * \param Expr A complex location expression for the variable.
1135 * \param DebugLoc Debug info location.
1136 * \param Block Basic block acting as a location for the new intrinsic.
1138 LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder,
1139 LLVMValueRef Val,
1140 LLVMMetadataRef VarInfo,
1141 LLVMMetadataRef Expr,
1142 LLVMMetadataRef DebugLoc,
1143 LLVMBasicBlockRef Block);
1146 * Create a new descriptor for a local auto variable.
1147 * \param Builder The DIBuilder.
1148 * \param Scope The local scope the variable is declared in.
1149 * \param Name Variable name.
1150 * \param NameLen Length of variable name.
1151 * \param File File where this variable is defined.
1152 * \param LineNo Line number.
1153 * \param Ty Metadata describing the type of the variable.
1154 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1155 * \param Flags Flags.
1156 * \param AlignInBits Variable alignment.
1158 LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
1159 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1160 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1161 LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1164 * Create a new descriptor for a function parameter variable.
1165 * \param Builder The DIBuilder.
1166 * \param Scope The local scope the variable is declared in.
1167 * \param Name Variable name.
1168 * \param NameLen Length of variable name.
1169 * \param ArgNo Unique argument number for this variable; starts at 1.
1170 * \param File File where this variable is defined.
1171 * \param LineNo Line number.
1172 * \param Ty Metadata describing the type of the variable.
1173 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1174 * \param Flags Flags.
1176 LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
1177 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1178 size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1179 LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1182 * Get the metadata of the subprogram attached to a function.
1184 * @see llvm::Function::getSubprogram()
1186 LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func);
1189 * Set the subprogram attached to a function.
1191 * @see llvm::Function::setSubprogram()
1193 void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
1196 * Obtain the enumerated type of a Metadata instance.
1198 * @see llvm::Metadata::getMetadataID()
1200 LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
1202 #ifdef __cplusplus
1203 } /* end extern "C" */
1204 #endif
1206 #endif