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