LLVM  10.0.0svn
DebugInfo.h
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_C_DEBUGINFO_H
17 #define LLVM_C_DEBUGINFO_H
18 
19 #include "llvm-c/Core.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /**
26  * Debug info flags.
27  */
28 typedef enum {
42  LLVMDIFlagVector = 1 << 11,
46  LLVMDIFlagReserved = 1 << 15,
51  LLVMDIFlagBitField = 1 << 19,
52  LLVMDIFlagNoReturn = 1 << 20,
57  LLVMDIFlagThunk = 1 << 25,
61  LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
67 } LLVMDIFlags;
68 
69 /**
70  * Source languages known by DWARF.
71  */
72 typedef enum {
83  // New in DWARF v3:
93  // New in DWARF v4:
95  // New in DWARF v5:
113  // Vendor extensions:
118 
119 /**
120  * The amount of debug information to emit.
121  */
122 typedef enum {
127 
128 /**
129  * The kind of metadata nodes.
130  */
131 enum {
164 };
165 typedef unsigned LLVMMetadataKind;
166 
167 /**
168  * An LLVM DWARF type encoding.
169  */
170 typedef unsigned LLVMDWARFTypeEncoding;
171 
172 /**
173  * Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro.
174  * @see llvm::dwarf::MacinfoRecordType
175  * @note Values are from DW_MACINFO_* constants in the DWARF specification.
176  */
177 typedef enum {
184 
185 /**
186  * The current debug metadata version number.
187  */
188 unsigned LLVMDebugMetadataVersion(void);
189 
190 /**
191  * The version of debug metadata that's present in the provided \c Module.
192  */
194 
195 /**
196  * Strip debug info in the module if it exists.
197  * To do this, we remove all calls to the debugger intrinsics and any named
198  * metadata for debugging. We also remove debug locations for instructions.
199  * Return true if module is modified.
200  */
202 
203 /**
204  * Construct a builder for a module, and do not allow for unresolved nodes
205  * attached to the module.
206  */
208 
209 /**
210  * Construct a builder for a module and collect unresolved nodes attached
211  * to the module in order to resolve cycles during a call to
212  * \c LLVMDIBuilderFinalize.
213  */
215 
216 /**
217  * Deallocates the \c DIBuilder and everything it owns.
218  * @note You must call \c LLVMDIBuilderFinalize before this
219  */
221 
222 /**
223  * Construct any deferred debug info descriptors.
224  */
226 
227 /**
228  * A CompileUnit provides an anchor for all debugging
229  * information generated during this instance of compilation.
230  * \param Lang Source programming language, eg.
231  * \c LLVMDWARFSourceLanguageC99
232  * \param FileRef File info.
233  * \param Producer Identify the producer of debugging information
234  * and code. Usually this is a compiler
235  * version string.
236  * \param ProducerLen The length of the C string passed to \c Producer.
237  * \param isOptimized A boolean flag which indicates whether optimization
238  * is enabled or not.
239  * \param Flags This string lists command line options. This
240  * string is directly embedded in debug info
241  * output which may be used by a tool
242  * analyzing generated debugging information.
243  * \param FlagsLen The length of the C string passed to \c Flags.
244  * \param RuntimeVer This indicates runtime version for languages like
245  * Objective-C.
246  * \param SplitName The name of the file that we'll split debug info
247  * out into.
248  * \param SplitNameLen The length of the C string passed to \c SplitName.
249  * \param Kind The kind of debug information to generate.
250  * \param DWOId The DWOId if this is a split skeleton compile unit.
251  * \param SplitDebugInlining Whether to emit inline debug info.
252  * \param DebugInfoForProfiling Whether to emit extra debug info for
253  * profile collection.
254  */
256  LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
257  LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
258  LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
259  unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
260  LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
261  LLVMBool DebugInfoForProfiling);
262 
263 /**
264  * Create a file descriptor to hold debugging information for a file.
265  * \param Builder The \c DIBuilder.
266  * \param Filename File name.
267  * \param FilenameLen The length of the C string passed to \c Filename.
268  * \param Directory Directory.
269  * \param DirectoryLen The length of the C string passed to \c Directory.
270  */
272 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
273  size_t FilenameLen, const char *Directory,
274  size_t DirectoryLen);
275 
276 /**
277  * Creates a new descriptor for a module with the specified parent scope.
278  * \param Builder The \c DIBuilder.
279  * \param ParentScope The parent scope containing this module declaration.
280  * \param Name Module name.
281  * \param NameLen The length of the C string passed to \c Name.
282  * \param ConfigMacros A space-separated shell-quoted list of -D macro
283  definitions as they would appear on a command line.
284  * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
285  * \param IncludePath The path to the module map file.
286  * \param IncludePathLen The length of the C string passed to \c IncludePath.
287  * \param ISysRoot The Clang system root (value of -isysroot).
288  * \param ISysRootLen The length of the C string passed to \c ISysRoot.
289  */
292  const char *Name, size_t NameLen,
293  const char *ConfigMacros, size_t ConfigMacrosLen,
294  const char *IncludePath, size_t IncludePathLen,
295  const char *ISysRoot, size_t ISysRootLen);
296 
297 /**
298  * Creates a new descriptor for a namespace with the specified parent scope.
299  * \param Builder The \c DIBuilder.
300  * \param ParentScope The parent scope containing this module declaration.
301  * \param Name NameSpace name.
302  * \param NameLen The length of the C string passed to \c Name.
303  * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
304  * this is true of C++ inline namespaces.
305  */
308  LLVMMetadataRef ParentScope,
309  const char *Name, size_t NameLen,
310  LLVMBool ExportSymbols);
311 
312 /**
313  * Create a new descriptor for the specified subprogram.
314  * \param Builder The \c DIBuilder.
315  * \param Scope Function scope.
316  * \param Name Function name.
317  * \param NameLen Length of enumeration name.
318  * \param LinkageName Mangled function name.
319  * \param LinkageNameLen Length of linkage name.
320  * \param File File where this variable is defined.
321  * \param LineNo Line number.
322  * \param Ty Function type.
323  * \param IsLocalToUnit True if this function is not externally visible.
324  * \param IsDefinition True if this is a function definition.
325  * \param ScopeLine Set to the beginning of the scope this starts
326  * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
327  * used to emit dwarf attributes.
328  * \param IsOptimized True if optimization is ON.
329  */
331  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
332  size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
333  LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
334  LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
335  unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized);
336 
337 /**
338  * Create a descriptor for a lexical block with the specified parent context.
339  * \param Builder The \c DIBuilder.
340  * \param Scope Parent lexical block.
341  * \param File Source file.
342  * \param Line The line in the source file.
343  * \param Column The column in the source file.
344  */
347  LLVMMetadataRef File, unsigned Line, unsigned Column);
348 
349 /**
350  * Create a descriptor for a lexical block with a new file attached.
351  * \param Builder The \c DIBuilder.
352  * \param Scope Lexical block.
353  * \param File Source file.
354  * \param Discriminator DWARF path discriminator value.
355  */
360  unsigned Discriminator);
361 
362 /**
363  * Create a descriptor for an imported namespace. Suitable for e.g. C++
364  * using declarations.
365  * \param Builder The \c DIBuilder.
366  * \param Scope The scope this module is imported into
367  * \param File File where the declaration is located.
368  * \param Line Line number of the declaration.
369  */
373  LLVMMetadataRef NS,
375  unsigned Line);
376 
377 /**
378  * Create a descriptor for an imported module that aliases another
379  * imported entity descriptor.
380  * \param Builder The \c DIBuilder.
381  * \param Scope The scope this module is imported into
382  * \param ImportedEntity Previous imported entity to alias.
383  * \param File File where the declaration is located.
384  * \param Line Line number of the declaration.
385  */
389  LLVMMetadataRef ImportedEntity,
391  unsigned Line);
392 
393 /**
394  * Create a descriptor for an imported module.
395  * \param Builder The \c DIBuilder.
396  * \param Scope The scope this module is imported into
397  * \param M The module being imported here
398  * \param File File where the declaration is located.
399  * \param Line Line number of the declaration.
400  */
404  LLVMMetadataRef M,
406  unsigned Line);
407 
408 /**
409  * Create a descriptor for an imported function, type, or variable. Suitable
410  * for e.g. FORTRAN-style USE declarations.
411  * \param Builder The DIBuilder.
412  * \param Scope The scope this module is imported into.
413  * \param Decl The declaration (or definition) of a function, type,
414  or variable.
415  * \param File File where the declaration is located.
416  * \param Line Line number of the declaration.
417  * \param Name A name that uniquely identifies this imported declaration.
418  * \param NameLen The length of the C string passed to \c Name.
419  */
423  LLVMMetadataRef Decl,
425  unsigned Line,
426  const char *Name, size_t NameLen);
427 
428 /**
429  * Creates a new DebugLocation that describes a source location.
430  * \param Line The line in the source file.
431  * \param Column The column in the source file.
432  * \param Scope The scope in which the location resides.
433  * \param InlinedAt The scope where this location was inlined, if at all.
434  * (optional).
435  * \note If the item to which this location is attached cannot be
436  * attributed to a source line, pass 0 for the line and column.
437  */
440  unsigned Column, LLVMMetadataRef Scope,
441  LLVMMetadataRef InlinedAt);
442 
443 /**
444  * Get the line number of this debug location.
445  * \param Location The debug location.
446  *
447  * @see DILocation::getLine()
448  */
449 unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
450 
451 /**
452  * Get the column number of this debug location.
453  * \param Location The debug location.
454  *
455  * @see DILocation::getColumn()
456  */
457 unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
458 
459 /**
460  * Get the local scope associated with this debug location.
461  * \param Location The debug location.
462  *
463  * @see DILocation::getScope()
464  */
466 
467 /**
468  * Get the "inline at" location associated with this debug location.
469  * \param Location The debug location.
470  *
471  * @see DILocation::getInlinedAt()
472  */
474 
475 /**
476  * Get the metadata of the file associated with a given scope.
477  * \param Scope The scope object.
478  *
479  * @see DIScope::getFile()
480  */
482 
483 /**
484  * Get the directory of a given file.
485  * \param File The file object.
486  * \param Len The length of the returned string.
487  *
488  * @see DIFile::getDirectory()
489  */
490 const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len);
491 
492 /**
493  * Get the name of a given file.
494  * \param File The file object.
495  * \param Len The length of the returned string.
496  *
497  * @see DIFile::getFilename()
498  */
499 const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len);
500 
501 /**
502  * Get the source of a given file.
503  * \param File The file object.
504  * \param Len The length of the returned string.
505  *
506  * @see DIFile::getSource()
507  */
508 const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
509 
510 /**
511  * Create a type array.
512  * \param Builder The DIBuilder.
513  * \param Data The type elements.
514  * \param NumElements Number of type elements.
515  */
518  size_t NumElements);
519 
520 /**
521  * Create subroutine type.
522  * \param Builder The DIBuilder.
523  * \param File The file in which the subroutine resides.
524  * \param ParameterTypes An array of subroutine parameter types. This
525  * includes return type at 0th index.
526  * \param NumParameterTypes The number of parameter types in \c ParameterTypes
527  * \param Flags E.g.: \c LLVMDIFlagLValueReference.
528  * These flags are used to emit dwarf attributes.
529  */
533  LLVMMetadataRef *ParameterTypes,
534  unsigned NumParameterTypes,
535  LLVMDIFlags Flags);
536 
537 /**
538  * Create debugging information entry for a macro.
539  * @param Builder The DIBuilder.
540  * @param ParentMacroFile Macro parent (could be NULL).
541  * @param Line Source line number where the macro is defined.
542  * @param RecordType DW_MACINFO_define or DW_MACINFO_undef.
543  * @param Name Macro name.
544  * @param NameLen Macro name length.
545  * @param Value Macro value.
546  * @param ValueLen Macro value length.
547  */
549  LLVMMetadataRef ParentMacroFile,
550  unsigned Line,
551  LLVMDWARFMacinfoRecordType RecordType,
552  const char *Name, size_t NameLen,
553  const char *Value, size_t ValueLen);
554 
555 /**
556  * Create debugging information temporary entry for a macro file.
557  * List of macro node direct children will be calculated by DIBuilder,
558  * using the \p ParentMacroFile relationship.
559  * @param Builder The DIBuilder.
560  * @param ParentMacroFile Macro parent (could be NULL).
561  * @param Line Source line number where the macro file is included.
562  * @param File File descriptor containing the name of the macro file.
563  */
566  LLVMMetadataRef ParentMacroFile, unsigned Line,
568 
569 /**
570  * Create debugging information entry for an enumerator.
571  * @param Builder The DIBuilder.
572  * @param Name Enumerator name.
573  * @param NameLen Length of enumerator name.
574  * @param Value Enumerator value.
575  * @param IsUnsigned True if the value is unsigned.
576  */
578  const char *Name, size_t NameLen,
579  int64_t Value,
580  LLVMBool IsUnsigned);
581 
582 /**
583  * Create debugging information entry for an enumeration.
584  * \param Builder The DIBuilder.
585  * \param Scope Scope in which this enumeration is defined.
586  * \param Name Enumeration name.
587  * \param NameLen Length of enumeration name.
588  * \param File File where this member is defined.
589  * \param LineNumber Line number.
590  * \param SizeInBits Member size.
591  * \param AlignInBits Member alignment.
592  * \param Elements Enumeration elements.
593  * \param NumElements Number of enumeration elements.
594  * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
595  */
597  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
598  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
599  uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
600  unsigned NumElements, LLVMMetadataRef ClassTy);
601 
602 /**
603  * Create debugging information entry for a union.
604  * \param Builder The DIBuilder.
605  * \param Scope Scope in which this union is defined.
606  * \param Name Union name.
607  * \param NameLen Length of union name.
608  * \param File File where this member is defined.
609  * \param LineNumber Line number.
610  * \param SizeInBits Member size.
611  * \param AlignInBits Member alignment.
612  * \param Flags Flags to encode member attribute, e.g. private
613  * \param Elements Union elements.
614  * \param NumElements Number of union elements.
615  * \param RunTimeLang Optional parameter, Objective-C runtime version.
616  * \param UniqueId A unique identifier for the union.
617  * \param UniqueIdLen Length of unique identifier.
618  */
620  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
621  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
622  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
623  LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
624  const char *UniqueId, size_t UniqueIdLen);
625 
626 
627 /**
628  * Create debugging information entry for an array.
629  * \param Builder The DIBuilder.
630  * \param Size Array size.
631  * \param AlignInBits Alignment.
632  * \param Ty Element type.
633  * \param Subscripts Subscripts.
634  * \param NumSubscripts Number of subscripts.
635  */
638  uint32_t AlignInBits, LLVMMetadataRef Ty,
639  LLVMMetadataRef *Subscripts,
640  unsigned NumSubscripts);
641 
642 /**
643  * Create debugging information entry for a vector type.
644  * \param Builder The DIBuilder.
645  * \param Size Vector size.
646  * \param AlignInBits Alignment.
647  * \param Ty Element type.
648  * \param Subscripts Subscripts.
649  * \param NumSubscripts Number of subscripts.
650  */
653  uint32_t AlignInBits, LLVMMetadataRef Ty,
654  LLVMMetadataRef *Subscripts,
655  unsigned NumSubscripts);
656 
657 /**
658  * Create a DWARF unspecified type.
659  * \param Builder The DIBuilder.
660  * \param Name The unspecified type's name.
661  * \param NameLen Length of type name.
662  */
665  size_t NameLen);
666 
667 /**
668  * Create debugging information entry for a basic
669  * type.
670  * \param Builder The DIBuilder.
671  * \param Name Type name.
672  * \param NameLen Length of type name.
673  * \param SizeInBits Size of the type.
674  * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
675  * \param Flags Flags to encode optional attribute like endianity
676  */
679  size_t NameLen, uint64_t SizeInBits,
680  LLVMDWARFTypeEncoding Encoding,
681  LLVMDIFlags Flags);
682 
683 /**
684  * Create debugging information entry for a pointer.
685  * \param Builder The DIBuilder.
686  * \param PointeeTy Type pointed by this pointer.
687  * \param SizeInBits Size.
688  * \param AlignInBits Alignment. (optional, pass 0 to ignore)
689  * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
690  * \param Name Pointer type name. (optional)
691  * \param NameLen Length of pointer type name. (optional)
692  */
694  LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
695  uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
696  const char *Name, size_t NameLen);
697 
698 /**
699  * Create debugging information entry for a struct.
700  * \param Builder The DIBuilder.
701  * \param Scope Scope in which this struct is defined.
702  * \param Name Struct name.
703  * \param NameLen Struct name length.
704  * \param File File where this member is defined.
705  * \param LineNumber Line number.
706  * \param SizeInBits Member size.
707  * \param AlignInBits Member alignment.
708  * \param Flags Flags to encode member attribute, e.g. private
709  * \param Elements Struct elements.
710  * \param NumElements Number of struct elements.
711  * \param RunTimeLang Optional parameter, Objective-C runtime version.
712  * \param VTableHolder The object containing the vtable for the struct.
713  * \param UniqueId A unique identifier for the struct.
714  * \param UniqueIdLen Length of the unique identifier for the struct.
715  */
717  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
718  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
719  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
720  LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
721  unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
722  const char *UniqueId, size_t UniqueIdLen);
723 
724 /**
725  * Create debugging information entry for a member.
726  * \param Builder The DIBuilder.
727  * \param Scope Member scope.
728  * \param Name Member name.
729  * \param NameLen Length of member name.
730  * \param File File where this member is defined.
731  * \param LineNo Line number.
732  * \param SizeInBits Member size.
733  * \param AlignInBits Member alignment.
734  * \param OffsetInBits Member offset.
735  * \param Flags Flags to encode member attribute, e.g. private
736  * \param Ty Parent type.
737  */
739  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
740  size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
741  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
742  LLVMDIFlags Flags, LLVMMetadataRef Ty);
743 
744 /**
745  * Create debugging information entry for a
746  * C++ static data member.
747  * \param Builder The DIBuilder.
748  * \param Scope Member scope.
749  * \param Name Member name.
750  * \param NameLen Length of member name.
751  * \param File File where this member is declared.
752  * \param LineNumber Line number.
753  * \param Type Type of the static member.
754  * \param Flags Flags to encode member attribute, e.g. private.
755  * \param ConstantVal Const initializer of the member.
756  * \param AlignInBits Member alignment.
757  */
760  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
761  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
762  LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
763  uint32_t AlignInBits);
764 
765 /**
766  * Create debugging information entry for a pointer to member.
767  * \param Builder The DIBuilder.
768  * \param PointeeType Type pointed to by this pointer.
769  * \param ClassType Type for which this pointer points to members of.
770  * \param SizeInBits Size.
771  * \param AlignInBits Alignment.
772  * \param Flags Flags.
773  */
776  LLVMMetadataRef PointeeType,
777  LLVMMetadataRef ClassType,
778  uint64_t SizeInBits,
779  uint32_t AlignInBits,
780  LLVMDIFlags Flags);
781 /**
782  * Create debugging information entry for Objective-C instance variable.
783  * \param Builder The DIBuilder.
784  * \param Name Member name.
785  * \param NameLen The length of the C string passed to \c Name.
786  * \param File File where this member is defined.
787  * \param LineNo Line number.
788  * \param SizeInBits Member size.
789  * \param AlignInBits Member alignment.
790  * \param OffsetInBits Member offset.
791  * \param Flags Flags to encode member attribute, e.g. private
792  * \param Ty Parent type.
793  * \param PropertyNode Property associated with this ivar.
794  */
797  const char *Name, size_t NameLen,
798  LLVMMetadataRef File, unsigned LineNo,
799  uint64_t SizeInBits, uint32_t AlignInBits,
800  uint64_t OffsetInBits, LLVMDIFlags Flags,
801  LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
802 
803 /**
804  * Create debugging information entry for Objective-C property.
805  * \param Builder The DIBuilder.
806  * \param Name Property name.
807  * \param NameLen The length of the C string passed to \c Name.
808  * \param File File where this property is defined.
809  * \param LineNo Line number.
810  * \param GetterName Name of the Objective C property getter selector.
811  * \param GetterNameLen The length of the C string passed to \c GetterName.
812  * \param SetterName Name of the Objective C property setter selector.
813  * \param SetterNameLen The length of the C string passed to \c SetterName.
814  * \param PropertyAttributes Objective C property attributes.
815  * \param Ty Type.
816  */
819  const char *Name, size_t NameLen,
820  LLVMMetadataRef File, unsigned LineNo,
821  const char *GetterName, size_t GetterNameLen,
822  const char *SetterName, size_t SetterNameLen,
823  unsigned PropertyAttributes,
824  LLVMMetadataRef Ty);
825 
826 /**
827  * Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
828  * \param Builder The DIBuilder.
829  * \param Type The underlying type to which this pointer points.
830  */
834 
835 /**
836  * Create debugging information entry for a qualified
837  * type, e.g. 'const int'.
838  * \param Builder The DIBuilder.
839  * \param Tag Tag identifying type,
840  * e.g. LLVMDWARFTypeQualifier_volatile_type
841  * \param Type Base Type.
842  */
846 
847 /**
848  * Create debugging information entry for a c++
849  * style reference or rvalue reference type.
850  * \param Builder The DIBuilder.
851  * \param Tag Tag identifying type,
852  * \param Type Base Type.
853  */
857 
858 /**
859  * Create C++11 nullptr type.
860  * \param Builder The DIBuilder.
861  */
864 
865 /**
866  * Create debugging information entry for a typedef.
867  * \param Builder The DIBuilder.
868  * \param Type Original type.
869  * \param Name Typedef name.
870  * \param File File where this type is defined.
871  * \param LineNo Line number.
872  * \param Scope The surrounding context for the typedef.
873  */
876  const char *Name, size_t NameLen,
877  LLVMMetadataRef File, unsigned LineNo,
879 
880 /**
881  * Create debugging information entry to establish inheritance relationship
882  * between two types.
883  * \param Builder The DIBuilder.
884  * \param Ty Original type.
885  * \param BaseTy Base type. Ty is inherits from base.
886  * \param BaseOffset Base offset.
887  * \param VBPtrOffset Virtual base pointer offset.
888  * \param Flags Flags to describe inheritance attribute, e.g. private
889  */
892  LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
893  uint64_t BaseOffset, uint32_t VBPtrOffset,
894  LLVMDIFlags Flags);
895 
896 /**
897  * Create a permanent forward-declared type.
898  * \param Builder The DIBuilder.
899  * \param Tag A unique tag for this type.
900  * \param Name Type name.
901  * \param NameLen Length of type name.
902  * \param Scope Type scope.
903  * \param File File where this type is defined.
904  * \param Line Line number where this type is defined.
905  * \param RuntimeLang Indicates runtime version for languages like
906  * Objective-C.
907  * \param SizeInBits Member size.
908  * \param AlignInBits Member alignment.
909  * \param UniqueIdentifier A unique identifier for the type.
910  * \param UniqueIdentifierLen Length of the unique identifier.
911  */
913  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
914  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
915  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
916  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
917 
918 /**
919  * Create a temporary forward-declared type.
920  * \param Builder The DIBuilder.
921  * \param Tag A unique tag for this type.
922  * \param Name Type name.
923  * \param NameLen Length of type name.
924  * \param Scope Type scope.
925  * \param File File where this type is defined.
926  * \param Line Line number where this type is defined.
927  * \param RuntimeLang Indicates runtime version for languages like
928  * Objective-C.
929  * \param SizeInBits Member size.
930  * \param AlignInBits Member alignment.
931  * \param Flags Flags.
932  * \param UniqueIdentifier A unique identifier for the type.
933  * \param UniqueIdentifierLen Length of the unique identifier.
934  */
937  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
938  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
939  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
940  LLVMDIFlags Flags, const char *UniqueIdentifier,
941  size_t UniqueIdentifierLen);
942 
943 /**
944  * Create debugging information entry for a bit field member.
945  * \param Builder The DIBuilder.
946  * \param Scope Member scope.
947  * \param Name Member name.
948  * \param NameLen Length of member name.
949  * \param File File where this member is defined.
950  * \param LineNumber Line number.
951  * \param SizeInBits Member size.
952  * \param OffsetInBits Member offset.
953  * \param StorageOffsetInBits Member storage offset.
954  * \param Flags Flags to encode member attribute.
955  * \param Type Parent type.
956  */
960  const char *Name, size_t NameLen,
961  LLVMMetadataRef File, unsigned LineNumber,
962  uint64_t SizeInBits,
963  uint64_t OffsetInBits,
964  uint64_t StorageOffsetInBits,
965  LLVMDIFlags Flags, LLVMMetadataRef Type);
966 
967 /**
968  * Create debugging information entry for a class.
969  * \param Scope Scope in which this class is defined.
970  * \param Name Class name.
971  * \param NameLen The length of the C string passed to \c Name.
972  * \param File File where this member is defined.
973  * \param LineNumber Line number.
974  * \param SizeInBits Member size.
975  * \param AlignInBits Member alignment.
976  * \param OffsetInBits Member offset.
977  * \param Flags Flags to encode member attribute, e.g. private.
978  * \param DerivedFrom Debug info of the base class of this type.
979  * \param Elements Class members.
980  * \param NumElements Number of class elements.
981  * \param VTableHolder Debug info of the base class that contains vtable
982  * for this type. This is used in
983  * DW_AT_containing_type. See DWARF documentation
984  * for more info.
985  * \param TemplateParamsNode Template type parameters.
986  * \param UniqueIdentifier A unique identifier for the type.
987  * \param UniqueIdentifierLen Length of the unique identifier.
988  */
990  LLVMMetadataRef Scope, const char *Name, size_t NameLen,
991  LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
992  uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
993  LLVMMetadataRef DerivedFrom,
994  LLVMMetadataRef *Elements, unsigned NumElements,
995  LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
996  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
997 
998 /**
999  * Create a uniqued DIType* clone with FlagArtificial set.
1000  * \param Builder The DIBuilder.
1001  * \param Type The underlying type.
1002  */
1006 
1007 /**
1008  * Get the name of this DIType.
1009  * \param DType The DIType.
1010  * \param Length The length of the returned string.
1011  *
1012  * @see DIType::getName()
1013  */
1014 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
1015 
1016 /**
1017  * Get the size of this DIType in bits.
1018  * \param DType The DIType.
1019  *
1020  * @see DIType::getSizeInBits()
1021  */
1023 
1024 /**
1025  * Get the offset of this DIType in bits.
1026  * \param DType The DIType.
1027  *
1028  * @see DIType::getOffsetInBits()
1029  */
1031 
1032 /**
1033  * Get the alignment of this DIType in bits.
1034  * \param DType The DIType.
1035  *
1036  * @see DIType::getAlignInBits()
1037  */
1039 
1040 /**
1041  * Get the source line where this DIType is declared.
1042  * \param DType The DIType.
1043  *
1044  * @see DIType::getLine()
1045  */
1046 unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
1047 
1048 /**
1049  * Get the flags associated with this DIType.
1050  * \param DType The DIType.
1051  *
1052  * @see DIType::getFlags()
1053  */
1054 LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
1055 
1056 /**
1057  * Create a descriptor for a value range.
1058  * \param Builder The DIBuilder.
1059  * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
1060  * \param Count Count of elements in the subrange.
1061  */
1063  int64_t LowerBound,
1064  int64_t Count);
1065 
1066 /**
1067  * Create an array of DI Nodes.
1068  * \param Builder The DIBuilder.
1069  * \param Data The DI Node elements.
1070  * \param NumElements Number of DI Node elements.
1071  */
1074  size_t NumElements);
1075 
1076 /**
1077  * Create a new descriptor for the specified variable which has a complex
1078  * address expression for its address.
1079  * \param Builder The DIBuilder.
1080  * \param Addr An array of complex address operations.
1081  * \param Length Length of the address operation array.
1082  */
1084  int64_t *Addr, size_t Length);
1085 
1086 /**
1087  * Create a new descriptor for the specified variable that does not have an
1088  * address, but does have a constant value.
1089  * \param Builder The DIBuilder.
1090  * \param Value The constant value.
1091  */
1094  int64_t Value);
1095 
1096 /**
1097  * Create a new descriptor for the specified variable.
1098  * \param Scope Variable scope.
1099  * \param Name Name of the variable.
1100  * \param NameLen The length of the C string passed to \c Name.
1101  * \param Linkage Mangled name of the variable.
1102  * \param LinkLen The length of the C string passed to \c Linkage.
1103  * \param File File where this variable is defined.
1104  * \param LineNo Line number.
1105  * \param Ty Variable Type.
1106  * \param LocalToUnit Boolean flag indicate whether this variable is
1107  * externally visible or not.
1108  * \param Expr The location of the global relative to the attached
1109  * GlobalVariable.
1110  * \param Decl Reference to the corresponding declaration.
1111  * variables.
1112  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1113  * specified)
1114  */
1116  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1117  size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
1118  unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1119  LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
1120 
1121 /**
1122  * Retrieves the \c DIVariable associated with this global variable expression.
1123  * \param GVE The global variable expression.
1124  *
1125  * @see llvm::DIGlobalVariableExpression::getVariable()
1126  */
1128 
1129 /**
1130  * Retrieves the \c DIExpression associated with this global variable expression.
1131  * \param GVE The global variable expression.
1132  *
1133  * @see llvm::DIGlobalVariableExpression::getExpression()
1134  */
1136  LLVMMetadataRef GVE);
1137 
1138 /**
1139  * Get the metadata of the file associated with a given variable.
1140  * \param Var The variable object.
1141  *
1142  * @see DIVariable::getFile()
1143  */
1145 
1146 /**
1147  * Get the metadata of the scope associated with a given variable.
1148  * \param Var The variable object.
1149  *
1150  * @see DIVariable::getScope()
1151  */
1153 
1154 /**
1155  * Get the source line where this \c DIVariable is declared.
1156  * \param Var The DIVariable.
1157  *
1158  * @see DIVariable::getLine()
1159  */
1161 
1162 /**
1163  * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
1164  * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
1165  * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
1166  * \param Ctx The context in which to construct the temporary node.
1167  * \param Data The metadata elements.
1168  * \param NumElements Number of metadata elements.
1169  */
1171  size_t NumElements);
1172 
1173 /**
1174  * Deallocate a temporary node.
1175  *
1176  * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1177  * references will be reset.
1178  * \param TempNode The temporary metadata node.
1179  */
1181 
1182 /**
1183  * Replace all uses of temporary metadata.
1184  * \param TempTargetMetadata The temporary metadata node.
1185  * \param Replacement The replacement metadata node.
1186  */
1187 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
1188  LLVMMetadataRef Replacement);
1189 
1190 /**
1191  * Create a new descriptor for the specified global variable that is temporary
1192  * and meant to be RAUWed.
1193  * \param Scope Variable scope.
1194  * \param Name Name of the variable.
1195  * \param NameLen The length of the C string passed to \c Name.
1196  * \param Linkage Mangled name of the variable.
1197  * \param LnkLen The length of the C string passed to \c Linkage.
1198  * \param File File where this variable is defined.
1199  * \param LineNo Line number.
1200  * \param Ty Variable Type.
1201  * \param LocalToUnit Boolean flag indicate whether this variable is
1202  * externally visible or not.
1203  * \param Decl Reference to the corresponding declaration.
1204  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1205  * specified)
1206  */
1208  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1209  size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
1210  unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1211  LLVMMetadataRef Decl, uint32_t AlignInBits);
1212 
1213 /**
1214  * Insert a new llvm.dbg.declare intrinsic call before the given instruction.
1215  * \param Builder The DIBuilder.
1216  * \param Storage The storage of the variable to declare.
1217  * \param VarInfo The variable's debug info descriptor.
1218  * \param Expr A complex location expression for the variable.
1219  * \param DebugLoc Debug info location.
1220  * \param Instr Instruction acting as a location for the new intrinsic.
1221  */
1223  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1224  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1225 
1226 /**
1227  * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic
1228  * block. If the basic block has a terminator instruction, the intrinsic is
1229  * inserted before that terminator instruction.
1230  * \param Builder The DIBuilder.
1231  * \param Storage The storage of the variable to declare.
1232  * \param VarInfo The variable's debug info descriptor.
1233  * \param Expr A complex location expression for the variable.
1234  * \param DebugLoc Debug info location.
1235  * \param Block Basic block acting as a location for the new intrinsic.
1236  */
1238  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1239  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1240 
1241 /**
1242  * Insert a new llvm.dbg.value intrinsic call before the given instruction.
1243  * \param Builder The DIBuilder.
1244  * \param Val The value of the variable.
1245  * \param VarInfo The variable's debug info descriptor.
1246  * \param Expr A complex location expression for the variable.
1247  * \param DebugLoc Debug info location.
1248  * \param Instr Instruction acting as a location for the new intrinsic.
1249  */
1251  LLVMValueRef Val,
1252  LLVMMetadataRef VarInfo,
1253  LLVMMetadataRef Expr,
1254  LLVMMetadataRef DebugLoc,
1255  LLVMValueRef Instr);
1256 
1257 /**
1258  * Insert a new llvm.dbg.value intrinsic call at the end of the given basic
1259  * block. If the basic block has a terminator instruction, the intrinsic is
1260  * inserted before that terminator instruction.
1261  * \param Builder The DIBuilder.
1262  * \param Val The value of the variable.
1263  * \param VarInfo The variable's debug info descriptor.
1264  * \param Expr A complex location expression for the variable.
1265  * \param DebugLoc Debug info location.
1266  * \param Block Basic block acting as a location for the new intrinsic.
1267  */
1269  LLVMValueRef Val,
1270  LLVMMetadataRef VarInfo,
1271  LLVMMetadataRef Expr,
1272  LLVMMetadataRef DebugLoc,
1273  LLVMBasicBlockRef Block);
1274 
1275 /**
1276  * Create a new descriptor for a local auto variable.
1277  * \param Builder The DIBuilder.
1278  * \param Scope The local scope the variable is declared in.
1279  * \param Name Variable name.
1280  * \param NameLen Length of variable name.
1281  * \param File File where this variable is defined.
1282  * \param LineNo Line number.
1283  * \param Ty Metadata describing the type of the variable.
1284  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1285  * \param Flags Flags.
1286  * \param AlignInBits Variable alignment.
1287  */
1289  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1290  size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1291  LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1292 
1293 /**
1294  * Create a new descriptor for a function parameter variable.
1295  * \param Builder The DIBuilder.
1296  * \param Scope The local scope the variable is declared in.
1297  * \param Name Variable name.
1298  * \param NameLen Length of variable name.
1299  * \param ArgNo Unique argument number for this variable; starts at 1.
1300  * \param File File where this variable is defined.
1301  * \param LineNo Line number.
1302  * \param Ty Metadata describing the type of the variable.
1303  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1304  * \param Flags Flags.
1305  */
1307  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1308  size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1309  LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1310 
1311 /**
1312  * Get the metadata of the subprogram attached to a function.
1313  *
1314  * @see llvm::Function::getSubprogram()
1315  */
1317 
1318 /**
1319  * Set the subprogram attached to a function.
1320  *
1321  * @see llvm::Function::setSubprogram()
1322  */
1324 
1325 /**
1326  * Get the line associated with a given subprogram.
1327  * \param Subprogram The subprogram object.
1328  *
1329  * @see DISubprogram::getLine()
1330  */
1331 unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram);
1332 
1333 /**
1334  * Get the debug location for the given instruction.
1335  *
1336  * @see llvm::Instruction::getDebugLoc()
1337  */
1339 
1340 /**
1341  * Set the debug location for the given instruction.
1342  *
1343  * To clear the location metadata of the given instruction, pass NULL to \p Loc.
1344  *
1345  * @see llvm::Instruction::setDebugLoc()
1346  */
1348 
1349 /**
1350  * Obtain the enumerated type of a Metadata instance.
1351  *
1352  * @see llvm::Metadata::getMetadataID()
1353  */
1354 LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
1355 
1356 #ifdef __cplusplus
1357 } /* end extern "C" */
1358 #endif
1359 
1360 #endif
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
Definition: MsgPackReader.h:48
LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create a type array.
Definition: DebugInfo.cpp:1254
LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for an array.
Definition: DebugInfo.cpp:988
LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE)
Retrieves the DIVariable associated with this global variable expression.
Definition: DebugInfo.cpp:1297
LLVMMetadataRef LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty)
Create debugging information entry for a member.
Definition: DebugInfo.cpp:1044
LLVMDWARFMacinfoRecordType
Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro.
Definition: DebugInfo.h:177
LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
Insert a new llvm.dbg.value intrinsic call before the given instruction.
Definition: DebugInfo.cpp:1365
void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode)
Deallocate a temporary node.
Definition: DebugInfo.cpp:1324
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:62
LLVMMetadataRef LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, LLVMBool ExportSymbols)
Creates a new descriptor for a namespace with the specified parent scope.
Definition: DebugInfo.cpp:793
LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t NumElements)
Create a new temporary MDNode.
Definition: DebugInfo.cpp:1318
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create an array of DI Nodes.
Definition: DebugInfo.cpp:1414
LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location)
Get the local scope associated with this debug location.
Definition: DebugInfo.cpp:899
LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits)
Create a new descriptor for a local auto variable.
Definition: DebugInfo.cpp:1389
LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt)
Creates a new DebugLocation that describes a source location.
Definition: DebugInfo.cpp:884
LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope)
Get the metadata of the file associated with a given scope.
Definition: DebugInfo.cpp:907
LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M)
Construct a builder for a module and collect unresolved nodes attached to the module in order to reso...
Definition: DebugInfo.cpp:734
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported module that aliases another imported entity descriptor.
Definition: DebugInfo.cpp:847
LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
Insert a new llvm.dbg.value intrinsic call at the end of the given basic block.
Definition: DebugInfo.cpp:1377
LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMDWARFMacinfoRecordType RecordType, const char *Name, size_t NameLen, const char *Value, size_t ValueLen)
Create debugging information entry for a macro.
Definition: DebugInfo.cpp:932
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition: Types.h:118
LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func)
Get the metadata of the subprogram attached to a function.
Definition: DebugInfo.cpp:1421
LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var)
Get the metadata of the file associated with a given variable.
Definition: DebugInfo.cpp:1306
uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType)
Get the size of this DIType in bits.
Definition: DebugInfo.cpp:1234
LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags)
Create a new descriptor for a function parameter variable.
Definition: DebugInfo.cpp:1399
LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Decl, uint32_t AlignInBits)
Create a new descriptor for the specified global variable that is temporary and meant to be RAUWed...
Definition: DebugInfo.cpp:1335
LLVMMetadataRef LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, LLVMDIFlags Flags)
Create debugging information entry to establish inheritance relationship between two types...
Definition: DebugInfo.cpp:1119
LLVMDWARFEmissionKind
The amount of debug information to emit.
Definition: DebugInfo.h:122
LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Scope)
Create debugging information entry for a typedef.
Definition: DebugInfo.cpp:1108
unsigned LLVMDWARFTypeEncoding
An LLVM DWARF type encoding.
Definition: DebugInfo.h:170
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count)
Create a descriptor for a value range.
Definition: DebugInfo.cpp:1409
LLVMMetadataRef LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Type)
Create debugging information entry for a bit field member.
Definition: DebugInfo.cpp:1187
LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
Create subroutine type.
Definition: DebugInfo.cpp:1262
LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType)
Get the flags associated with this DIType.
Definition: DebugInfo.cpp:1250
LLVMMetadataRef LLVMDIBuilderCreateStaticMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal, uint32_t AlignInBits)
Create debugging information entry for a C++ static data member.
Definition: DebugInfo.cpp:1061
unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module)
The version of debug metadata that&#39;s present in the provided Module.
Definition: DebugInfo.cpp:738
LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create a permanent forward-declared type.
Definition: DebugInfo.cpp:1129
LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata)
Obtain the enumerated type of a Metadata instance.
Definition: DebugInfo.cpp:1444
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:54
LLVMMetadataRef LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a c++ style reference or rvalue reference type.
Definition: DebugInfo.cpp:1162
LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang, LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen, LLVMBool isOptimized, const char *Flags, size_t FlagsLen, unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen, LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining, LLVMBool DebugInfoForProfiling)
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
Definition: DebugInfo.cpp:754
LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef ClassTy)
Create debugging information entry for an enumeration.
Definition: DebugInfo.cpp:960
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned Column)
Create a descriptor for a lexical block with the specified parent context.
Definition: DebugInfo.cpp:816
const char * LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len)
Get the source of a given file.
Definition: DebugInfo.cpp:923
unsigned LLVMDebugMetadataVersion(void)
The current debug metadata version number.
Definition: DebugInfo.cpp:726
LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value, LLVMBool IsUnsigned)
Create debugging information entry for an enumerator.
Definition: DebugInfo.cpp:952
LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, int64_t *Addr, size_t Length)
Create a new descriptor for the specified variable which has a complex address expression for its add...
Definition: DebugInfo.cpp:1273
Instrumentation for Order File
LLVMMetadataRef LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, const char *GetterName, size_t GetterNameLen, const char *SetterName, size_t SetterNameLen, unsigned PropertyAttributes, LLVMMetadataRef Ty)
Create debugging information entry for Objective-C property.
Definition: DebugInfo.cpp:1088
LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagArtificial set.
Definition: DebugInfo.cpp:1223
LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
Insert a new llvm.dbg.declare intrinsic call at the end of the given basic block. ...
Definition: DebugInfo.cpp:1356
LLVMMetadataRef LLVMDIBuilderCreatePointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace, const char *Name, size_t NameLen)
Create debugging information entry for a pointer.
Definition: DebugInfo.cpp:1019
const char * LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length)
Get the name of this DIType.
Definition: DebugInfo.cpp:1228
LLVMDWARFSourceLanguage
Source languages known by DWARF.
Definition: DebugInfo.h:72
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported module.
Definition: DebugInfo.cpp:859
LLVMMetadataRef LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder)
Create C++11 nullptr type.
Definition: DebugInfo.cpp:1169
LLVMMetadataRef LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, int64_t Value)
Create a new descriptor for the specified variable that does not have an address, but does have a con...
Definition: DebugInfo.cpp:1280
const char * LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len)
Get the name of a given file.
Definition: DebugInfo.cpp:917
int LLVMBool
Definition: Types.h:29
LLVMMetadataRef LLVMDIBuilderCreateStructType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder, const char *UniqueId, size_t UniqueIdLen)
Create debugging information entry for a struct.
Definition: DebugInfo.cpp:1028
uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType)
Get the alignment of this DIType in bits.
Definition: DebugInfo.cpp:1242
LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location)
Get the "inline at" location associated with this debug location.
Definition: DebugInfo.cpp:903
void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder)
Construct any deferred debug info descriptors.
Definition: DebugInfo.cpp:750
LLVMMetadataRef LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType, LLVMMetadataRef ClassType, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags)
Create debugging information entry for a pointer to member.
Definition: DebugInfo.cpp:1174
LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(LLVMMetadataRef GVE)
Retrieves the DIExpression associated with this global variable expression.
Definition: DebugInfo.cpp:1301
unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram)
Get the line associated with a given subprogram.
Definition: DebugInfo.cpp:1429
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition: Types.h:83
unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location)
Get the column number of this debug location.
Definition: DebugInfo.cpp:895
LLVMMetadataRef LLVMDIBuilderCreateFunction(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *LinkageName, size_t LinkageNameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool IsLocalToUnit, LLVMBool IsDefinition, unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized)
Create a new descriptor for the specified subprogram.
Definition: DebugInfo.cpp:801
LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen, const char *Directory, size_t DirectoryLen)
Create a file descriptor to hold debugging information for a file.
Definition: DebugInfo.cpp:773
LLVMMetadataRef LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen, const char *IncludePath, size_t IncludePathLen, const char *ISysRoot, size_t ISysRootLen)
Creates a new descriptor for a module with the specified parent scope.
Definition: DebugInfo.cpp:781
LLVMMetadataRef LLVMDIBuilderCreateUnionType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, const char *UniqueId, size_t UniqueIdLen)
Create debugging information entry for a union.
Definition: DebugInfo.cpp:972
void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc)
Set the debug location for the given instruction.
Definition: DebugInfo.cpp:1437
LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits)
Create a new descriptor for the specified variable.
Definition: DebugInfo.cpp:1285
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create a temporary forward-declared type.
Definition: DebugInfo.cpp:1141
const char * LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len)
Get the directory of a given file.
Definition: DebugInfo.cpp:911
LLVMMetadataRef LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for a vector type.
Definition: DebugInfo.cpp:999
void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP)
Set the subprogram attached to a function.
Definition: DebugInfo.cpp:1425
LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
Create a DWARF unspecified type.
Definition: DebugInfo.cpp:1055
LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst)
Get the debug location for the given instruction.
Definition: DebugInfo.cpp:1433
unsigned LLVMDILocationGetLine(LLVMMetadataRef Location)
Get the line number of this debug location.
Definition: DebugInfo.cpp:891
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
Definition: DebugInfo.cpp:1102
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, LLVMDIFlags Flags)
Create debugging information entry for a basic type.
Definition: DebugInfo.cpp:1010
uint32_t Size
Definition: Profile.cpp:46
LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a qualified type, e.g.
Definition: DebugInfo.cpp:1155
LLVMDIFlags
This file declares the C API endpoints for generating DWARF Debug Info.
Definition: DebugInfo.h:28
void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder)
Deallocates the DIBuilder and everything it owns.
Definition: DebugInfo.cpp:746
void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, LLVMMetadataRef Replacement)
Replace all uses of temporary metadata.
Definition: DebugInfo.cpp:1328
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Discriminator)
Create a descriptor for a lexical block with a new file attached.
Definition: DebugInfo.cpp:825
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition: Types.h:90
LLVMMetadataRef LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode)
Create debugging information entry for Objective-C instance variable.
Definition: DebugInfo.cpp:1074
unsigned LLVMDITypeGetLine(LLVMMetadataRef DType)
Get the source line where this DIType is declared.
Definition: DebugInfo.cpp:1246
uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType)
Get the offset of this DIType in bits.
Definition: DebugInfo.cpp:1238
LLVMValueRef LLVMDIBuilderInsertDeclareBefore(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
Insert a new llvm.dbg.declare intrinsic call before the given instruction.
Definition: DebugInfo.cpp:1347
unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var)
Get the source line where this DIVariable is declared.
Definition: DebugInfo.cpp:1314
LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl, LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen)
Create a descriptor for an imported function, type, or variable.
Definition: DebugInfo.cpp:871
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:40
LLVMMetadataRef LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMMetadataRef File)
Create debugging information temporary entry for a macro file.
Definition: DebugInfo.cpp:945
unsigned LLVMMetadataKind
Definition: DebugInfo.h:165
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported namespace.
Definition: DebugInfo.cpp:835
LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module)
Strip debug info in the module if it exists.
Definition: DebugInfo.cpp:742
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:76
LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var)
Get the metadata of the scope associated with a given variable.
Definition: DebugInfo.cpp:1310
LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create debugging information entry for a class.
Definition: DebugInfo.cpp:1202
LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M)
Construct a builder for a module, and do not allow for unresolved nodes attached to the module...
Definition: DebugInfo.cpp:730