LLVM  8.0.1
DebugInfo.h
Go to the documentation of this file.
1 //===------------ DebugInfo.h - LLVM C API Debug Info API -----------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// This file declares the C API endpoints for generating DWARF Debug Info
11 ///
12 /// Note: This interface is experimental. It is *NOT* stable, and may be
13 /// changed without warning.
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_C_DEBUGINFO_H
18 #define LLVM_C_DEBUGINFO_H
19 
20 #include "llvm-c/Core.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /**
27  * Debug info flags.
28  */
29 typedef enum {
43  LLVMDIFlagVector = 1 << 11,
47  LLVMDIFlagReserved = 1 << 15,
52  LLVMDIFlagBitField = 1 << 19,
53  LLVMDIFlagNoReturn = 1 << 20,
59  LLVMDIFlagThunk = 1 << 25,
60  LLVMDIFlagTrivial = 1 << 26,
63  LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
69 } LLVMDIFlags;
70 
71 /**
72  * Source languages known by DWARF.
73  */
74 typedef enum {
85  // New in DWARF v3:
95  // New in DWARF v4:
97  // New in DWARF v5:
115  // Vendor extensions:
120 
121 /**
122  * The amount of debug information to emit.
123  */
124 typedef enum {
129 
130 /**
131  * The kind of metadata nodes.
132  */
133 enum {
165 };
166 typedef unsigned LLVMMetadataKind;
167 
168 /**
169  * An LLVM DWARF type encoding.
170  */
171 typedef unsigned LLVMDWARFTypeEncoding;
172 
173 /**
174  * The current debug metadata version number.
175  */
176 unsigned LLVMDebugMetadataVersion(void);
177 
178 /**
179  * The version of debug metadata that's present in the provided \c Module.
180  */
182 
183 /**
184  * Strip debug info in the module if it exists.
185  * To do this, we remove all calls to the debugger intrinsics and any named
186  * metadata for debugging. We also remove debug locations for instructions.
187  * Return true if module is modified.
188  */
190 
191 /**
192  * Construct a builder for a module, and do not allow for unresolved nodes
193  * attached to the module.
194  */
196 
197 /**
198  * Construct a builder for a module and collect unresolved nodes attached
199  * to the module in order to resolve cycles during a call to
200  * \c LLVMDIBuilderFinalize.
201  */
203 
204 /**
205  * Deallocates the \c DIBuilder and everything it owns.
206  * @note You must call \c LLVMDIBuilderFinalize before this
207  */
209 
210 /**
211  * Construct any deferred debug info descriptors.
212  */
214 
215 /**
216  * A CompileUnit provides an anchor for all debugging
217  * information generated during this instance of compilation.
218  * \param Lang Source programming language, eg.
219  * \c LLVMDWARFSourceLanguageC99
220  * \param FileRef File info.
221  * \param Producer Identify the producer of debugging information
222  * and code. Usually this is a compiler
223  * version string.
224  * \param ProducerLen The length of the C string passed to \c Producer.
225  * \param isOptimized A boolean flag which indicates whether optimization
226  * is enabled or not.
227  * \param Flags This string lists command line options. This
228  * string is directly embedded in debug info
229  * output which may be used by a tool
230  * analyzing generated debugging information.
231  * \param FlagsLen The length of the C string passed to \c Flags.
232  * \param RuntimeVer This indicates runtime version for languages like
233  * Objective-C.
234  * \param SplitName The name of the file that we'll split debug info
235  * out into.
236  * \param SplitNameLen The length of the C string passed to \c SplitName.
237  * \param Kind The kind of debug information to generate.
238  * \param DWOId The DWOId if this is a split skeleton compile unit.
239  * \param SplitDebugInlining Whether to emit inline debug info.
240  * \param DebugInfoForProfiling Whether to emit extra debug info for
241  * profile collection.
242  */
244  LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
245  LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
246  LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
247  unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
248  LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
249  LLVMBool DebugInfoForProfiling);
250 
251 /**
252  * Create a file descriptor to hold debugging information for a file.
253  * \param Builder The \c DIBuilder.
254  * \param Filename File name.
255  * \param FilenameLen The length of the C string passed to \c Filename.
256  * \param Directory Directory.
257  * \param DirectoryLen The length of the C string passed to \c Directory.
258  */
260 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
261  size_t FilenameLen, const char *Directory,
262  size_t DirectoryLen);
263 
264 /**
265  * Creates a new descriptor for a module with the specified parent scope.
266  * \param Builder The \c DIBuilder.
267  * \param ParentScope The parent scope containing this module declaration.
268  * \param Name Module name.
269  * \param NameLen The length of the C string passed to \c Name.
270  * \param ConfigMacros A space-separated shell-quoted list of -D macro
271  definitions as they would appear on a command line.
272  * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
273  * \param IncludePath The path to the module map file.
274  * \param IncludePathLen The length of the C string passed to \c IncludePath.
275  * \param ISysRoot The Clang system root (value of -isysroot).
276  * \param ISysRootLen The length of the C string passed to \c ISysRoot.
277  */
280  const char *Name, size_t NameLen,
281  const char *ConfigMacros, size_t ConfigMacrosLen,
282  const char *IncludePath, size_t IncludePathLen,
283  const char *ISysRoot, size_t ISysRootLen);
284 
285 /**
286  * Creates a new descriptor for a namespace with the specified parent scope.
287  * \param Builder The \c DIBuilder.
288  * \param ParentScope The parent scope containing this module declaration.
289  * \param Name NameSpace name.
290  * \param NameLen The length of the C string passed to \c Name.
291  * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
292  * this is true of C++ inline namespaces.
293  */
296  LLVMMetadataRef ParentScope,
297  const char *Name, size_t NameLen,
298  LLVMBool ExportSymbols);
299 
300 /**
301  * Create a new descriptor for the specified subprogram.
302  * \param Builder The \c DIBuilder.
303  * \param Scope Function scope.
304  * \param Name Function name.
305  * \param NameLen Length of enumeration name.
306  * \param LinkageName Mangled function name.
307  * \param LinkageNameLen Length of linkage name.
308  * \param File File where this variable is defined.
309  * \param LineNo Line number.
310  * \param Ty Function type.
311  * \param IsLocalToUnit True if this function is not externally visible.
312  * \param IsDefinition True if this is a function definition.
313  * \param ScopeLine Set to the beginning of the scope this starts
314  * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
315  * used to emit dwarf attributes.
316  * \param IsOptimized True if optimization is ON.
317  */
319  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
320  size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
321  LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
322  LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
323  unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized);
324 
325 /**
326  * Create a descriptor for a lexical block with the specified parent context.
327  * \param Builder The \c DIBuilder.
328  * \param Scope Parent lexical block.
329  * \param File Source file.
330  * \param Line The line in the source file.
331  * \param Column The column in the source file.
332  */
334  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
335  LLVMMetadataRef File, unsigned Line, unsigned Column);
336 
337 /**
338  * Create a descriptor for a lexical block with a new file attached.
339  * \param Builder The \c DIBuilder.
340  * \param Scope Lexical block.
341  * \param File Source file.
342  * \param Discriminator DWARF path discriminator value.
343  */
346  LLVMMetadataRef Scope,
348  unsigned Discriminator);
349 
350 /**
351  * Create a descriptor for an imported namespace. Suitable for e.g. C++
352  * using declarations.
353  * \param Builder The \c DIBuilder.
354  * \param Scope The scope this module is imported into
355  * \param File File where the declaration is located.
356  * \param Line Line number of the declaration.
357  */
360  LLVMMetadataRef Scope,
361  LLVMMetadataRef NS,
363  unsigned Line);
364 
365 /**
366  * Create a descriptor for an imported module that aliases another
367  * imported entity descriptor.
368  * \param Builder The \c DIBuilder.
369  * \param Scope The scope this module is imported into
370  * \param ImportedEntity Previous imported entity to alias.
371  * \param File File where the declaration is located.
372  * \param Line Line number of the declaration.
373  */
376  LLVMMetadataRef Scope,
377  LLVMMetadataRef ImportedEntity,
379  unsigned Line);
380 
381 /**
382  * Create a descriptor for an imported module.
383  * \param Builder The \c DIBuilder.
384  * \param Scope The scope this module is imported into
385  * \param M The module being imported here
386  * \param File File where the declaration is located.
387  * \param Line Line number of the declaration.
388  */
391  LLVMMetadataRef Scope,
392  LLVMMetadataRef M,
394  unsigned Line);
395 
396 /**
397  * Create a descriptor for an imported function, type, or variable. Suitable
398  * for e.g. FORTRAN-style USE declarations.
399  * \param Builder The DIBuilder.
400  * \param Scope The scope this module is imported into.
401  * \param Decl The declaration (or definition) of a function, type,
402  or variable.
403  * \param File File where the declaration is located.
404  * \param Line Line number of the declaration.
405  * \param Name A name that uniquely identifies this imported declaration.
406  * \param NameLen The length of the C string passed to \c Name.
407  */
410  LLVMMetadataRef Scope,
411  LLVMMetadataRef Decl,
413  unsigned Line,
414  const char *Name, size_t NameLen);
415 
416 /**
417  * Creates a new DebugLocation that describes a source location.
418  * \param Line The line in the source file.
419  * \param Column The column in the source file.
420  * \param Scope The scope in which the location resides.
421  * \param InlinedAt The scope where this location was inlined, if at all.
422  * (optional).
423  * \note If the item to which this location is attached cannot be
424  * attributed to a source line, pass 0 for the line and column.
425  */
428  unsigned Column, LLVMMetadataRef Scope,
429  LLVMMetadataRef InlinedAt);
430 
431 /**
432  * Get the line number of this debug location.
433  * \param Location The debug location.
434  *
435  * @see DILocation::getLine()
436  */
437 unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
438 
439 /**
440  * Get the column number of this debug location.
441  * \param Location The debug location.
442  *
443  * @see DILocation::getColumn()
444  */
445 unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
446 
447 /**
448  * Get the local scope associated with this debug location.
449  * \param Location The debug location.
450  *
451  * @see DILocation::getScope()
452  */
454 
455 /**
456  * Create a type array.
457  * \param Builder The DIBuilder.
458  * \param Data The type elements.
459  * \param NumElements Number of type elements.
460  */
463  size_t NumElements);
464 
465 /**
466  * Create subroutine type.
467  * \param Builder The DIBuilder.
468  * \param File The file in which the subroutine resides.
469  * \param ParameterTypes An array of subroutine parameter types. This
470  * includes return type at 0th index.
471  * \param NumParameterTypes The number of parameter types in \c ParameterTypes
472  * \param Flags E.g.: \c LLVMDIFlagLValueReference.
473  * These flags are used to emit dwarf attributes.
474  */
478  LLVMMetadataRef *ParameterTypes,
479  unsigned NumParameterTypes,
480  LLVMDIFlags Flags);
481 
482 /**
483  * Create debugging information entry for an enumeration.
484  * \param Builder The DIBuilder.
485  * \param Scope Scope in which this enumeration is defined.
486  * \param Name Enumeration name.
487  * \param NameLen Length of enumeration name.
488  * \param File File where this member is defined.
489  * \param LineNumber Line number.
490  * \param SizeInBits Member size.
491  * \param AlignInBits Member alignment.
492  * \param Elements Enumeration elements.
493  * \param NumElements Number of enumeration elements.
494  * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
495  */
497  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
498  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
499  uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
500  unsigned NumElements, LLVMMetadataRef ClassTy);
501 
502 /**
503  * Create debugging information entry for a union.
504  * \param Builder The DIBuilder.
505  * \param Scope Scope in which this union is defined.
506  * \param Name Union name.
507  * \param NameLen Length of union name.
508  * \param File File where this member is defined.
509  * \param LineNumber Line number.
510  * \param SizeInBits Member size.
511  * \param AlignInBits Member alignment.
512  * \param Flags Flags to encode member attribute, e.g. private
513  * \param Elements Union elements.
514  * \param NumElements Number of union elements.
515  * \param RunTimeLang Optional parameter, Objective-C runtime version.
516  * \param UniqueId A unique identifier for the union.
517  * \param UniqueIdLen Length of unique identifier.
518  */
520  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
521  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
522  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
523  LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
524  const char *UniqueId, size_t UniqueIdLen);
525 
526 
527 /**
528  * Create debugging information entry for an array.
529  * \param Builder The DIBuilder.
530  * \param Size Array size.
531  * \param AlignInBits Alignment.
532  * \param Ty Element type.
533  * \param Subscripts Subscripts.
534  * \param NumSubscripts Number of subscripts.
535  */
538  uint32_t AlignInBits, LLVMMetadataRef Ty,
539  LLVMMetadataRef *Subscripts,
540  unsigned NumSubscripts);
541 
542 /**
543  * Create debugging information entry for a vector type.
544  * \param Builder The DIBuilder.
545  * \param Size Vector size.
546  * \param AlignInBits Alignment.
547  * \param Ty Element type.
548  * \param Subscripts Subscripts.
549  * \param NumSubscripts Number of subscripts.
550  */
553  uint32_t AlignInBits, LLVMMetadataRef Ty,
554  LLVMMetadataRef *Subscripts,
555  unsigned NumSubscripts);
556 
557 /**
558  * Create a DWARF unspecified type.
559  * \param Builder The DIBuilder.
560  * \param Name The unspecified type's name.
561  * \param NameLen Length of type name.
562  */
565  size_t NameLen);
566 
567 /**
568  * Create debugging information entry for a basic
569  * type.
570  * \param Builder The DIBuilder.
571  * \param Name Type name.
572  * \param NameLen Length of type name.
573  * \param SizeInBits Size of the type.
574  * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
575  * \param Flags Flags to encode optional attribute like endianity
576  */
579  size_t NameLen, uint64_t SizeInBits,
580  LLVMDWARFTypeEncoding Encoding,
581  LLVMDIFlags Flags);
582 
583 /**
584  * Create debugging information entry for a pointer.
585  * \param Builder The DIBuilder.
586  * \param PointeeTy Type pointed by this pointer.
587  * \param SizeInBits Size.
588  * \param AlignInBits Alignment. (optional, pass 0 to ignore)
589  * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
590  * \param Name Pointer type name. (optional)
591  * \param NameLen Length of pointer type name. (optional)
592  */
594  LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
595  uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
596  const char *Name, size_t NameLen);
597 
598 /**
599  * Create debugging information entry for a struct.
600  * \param Builder The DIBuilder.
601  * \param Scope Scope in which this struct is defined.
602  * \param Name Struct name.
603  * \param NameLen Struct name length.
604  * \param File File where this member is defined.
605  * \param LineNumber Line number.
606  * \param SizeInBits Member size.
607  * \param AlignInBits Member alignment.
608  * \param Flags Flags to encode member attribute, e.g. private
609  * \param Elements Struct elements.
610  * \param NumElements Number of struct elements.
611  * \param RunTimeLang Optional parameter, Objective-C runtime version.
612  * \param VTableHolder The object containing the vtable for the struct.
613  * \param UniqueId A unique identifier for the struct.
614  * \param UniqueIdLen Length of the unique identifier for the struct.
615  */
617  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
618  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
619  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
620  LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
621  unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
622  const char *UniqueId, size_t UniqueIdLen);
623 
624 /**
625  * Create debugging information entry for a member.
626  * \param Builder The DIBuilder.
627  * \param Scope Member scope.
628  * \param Name Member name.
629  * \param NameLen Length of member name.
630  * \param File File where this member is defined.
631  * \param LineNo Line number.
632  * \param SizeInBits Member size.
633  * \param AlignInBits Member alignment.
634  * \param OffsetInBits Member offset.
635  * \param Flags Flags to encode member attribute, e.g. private
636  * \param Ty Parent type.
637  */
639  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
640  size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
641  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
642  LLVMDIFlags Flags, LLVMMetadataRef Ty);
643 
644 /**
645  * Create debugging information entry for a
646  * C++ static data member.
647  * \param Builder The DIBuilder.
648  * \param Scope Member scope.
649  * \param Name Member name.
650  * \param NameLen Length of member name.
651  * \param File File where this member is declared.
652  * \param LineNumber Line number.
653  * \param Type Type of the static member.
654  * \param Flags Flags to encode member attribute, e.g. private.
655  * \param ConstantVal Const initializer of the member.
656  * \param AlignInBits Member alignment.
657  */
660  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
661  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
662  LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
663  uint32_t AlignInBits);
664 
665 /**
666  * Create debugging information entry for a pointer to member.
667  * \param Builder The DIBuilder.
668  * \param PointeeType Type pointed to by this pointer.
669  * \param ClassType Type for which this pointer points to members of.
670  * \param SizeInBits Size.
671  * \param AlignInBits Alignment.
672  * \param Flags Flags.
673  */
676  LLVMMetadataRef PointeeType,
677  LLVMMetadataRef ClassType,
678  uint64_t SizeInBits,
679  uint32_t AlignInBits,
680  LLVMDIFlags Flags);
681 /**
682  * Create debugging information entry for Objective-C instance variable.
683  * \param Builder The DIBuilder.
684  * \param Name Member name.
685  * \param NameLen The length of the C string passed to \c Name.
686  * \param File File where this member is defined.
687  * \param LineNo Line number.
688  * \param SizeInBits Member size.
689  * \param AlignInBits Member alignment.
690  * \param OffsetInBits Member offset.
691  * \param Flags Flags to encode member attribute, e.g. private
692  * \param Ty Parent type.
693  * \param PropertyNode Property associated with this ivar.
694  */
697  const char *Name, size_t NameLen,
698  LLVMMetadataRef File, unsigned LineNo,
699  uint64_t SizeInBits, uint32_t AlignInBits,
700  uint64_t OffsetInBits, LLVMDIFlags Flags,
701  LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
702 
703 /**
704  * Create debugging information entry for Objective-C property.
705  * \param Builder The DIBuilder.
706  * \param Name Property name.
707  * \param NameLen The length of the C string passed to \c Name.
708  * \param File File where this property is defined.
709  * \param LineNo Line number.
710  * \param GetterName Name of the Objective C property getter selector.
711  * \param GetterNameLen The length of the C string passed to \c GetterName.
712  * \param SetterName Name of the Objective C property setter selector.
713  * \param SetterNameLen The length of the C string passed to \c SetterName.
714  * \param PropertyAttributes Objective C property attributes.
715  * \param Ty Type.
716  */
719  const char *Name, size_t NameLen,
720  LLVMMetadataRef File, unsigned LineNo,
721  const char *GetterName, size_t GetterNameLen,
722  const char *SetterName, size_t SetterNameLen,
723  unsigned PropertyAttributes,
724  LLVMMetadataRef Ty);
725 
726 /**
727  * Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
728  * \param Builder The DIBuilder.
729  * \param Type The underlying type to which this pointer points.
730  */
734 
735 /**
736  * Create debugging information entry for a qualified
737  * type, e.g. 'const int'.
738  * \param Builder The DIBuilder.
739  * \param Tag Tag identifying type,
740  * e.g. LLVMDWARFTypeQualifier_volatile_type
741  * \param Type Base Type.
742  */
746 
747 /**
748  * Create debugging information entry for a c++
749  * style reference or rvalue reference type.
750  * \param Builder The DIBuilder.
751  * \param Tag Tag identifying type,
752  * \param Type Base Type.
753  */
757 
758 /**
759  * Create C++11 nullptr type.
760  * \param Builder The DIBuilder.
761  */
764 
765 /**
766  * Create debugging information entry for a typedef.
767  * \param Builder The DIBuilder.
768  * \param Type Original type.
769  * \param Name Typedef name.
770  * \param File File where this type is defined.
771  * \param LineNo Line number.
772  * \param Scope The surrounding context for the typedef.
773  */
776  const char *Name, size_t NameLen,
777  LLVMMetadataRef File, unsigned LineNo,
778  LLVMMetadataRef Scope);
779 
780 /**
781  * Create debugging information entry to establish inheritance relationship
782  * between two types.
783  * \param Builder The DIBuilder.
784  * \param Ty Original type.
785  * \param BaseTy Base type. Ty is inherits from base.
786  * \param BaseOffset Base offset.
787  * \param VBPtrOffset Virtual base pointer offset.
788  * \param Flags Flags to describe inheritance attribute, e.g. private
789  */
792  LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
793  uint64_t BaseOffset, uint32_t VBPtrOffset,
794  LLVMDIFlags Flags);
795 
796 /**
797  * Create a permanent forward-declared type.
798  * \param Builder The DIBuilder.
799  * \param Tag A unique tag for this type.
800  * \param Name Type name.
801  * \param NameLen Length of type name.
802  * \param Scope Type scope.
803  * \param File File where this type is defined.
804  * \param Line Line number where this type is defined.
805  * \param RuntimeLang Indicates runtime version for languages like
806  * Objective-C.
807  * \param SizeInBits Member size.
808  * \param AlignInBits Member alignment.
809  * \param UniqueIdentifier A unique identifier for the type.
810  * \param UniqueIdentifierLen Length of the unique identifier.
811  */
813  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
814  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
815  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
816  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
817 
818 /**
819  * Create a temporary forward-declared type.
820  * \param Builder The DIBuilder.
821  * \param Tag A unique tag for this type.
822  * \param Name Type name.
823  * \param NameLen Length of type name.
824  * \param Scope Type scope.
825  * \param File File where this type is defined.
826  * \param Line Line number where this type is defined.
827  * \param RuntimeLang Indicates runtime version for languages like
828  * Objective-C.
829  * \param SizeInBits Member size.
830  * \param AlignInBits Member alignment.
831  * \param Flags Flags.
832  * \param UniqueIdentifier A unique identifier for the type.
833  * \param UniqueIdentifierLen Length of the unique identifier.
834  */
837  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
838  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
839  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
840  LLVMDIFlags Flags, const char *UniqueIdentifier,
841  size_t UniqueIdentifierLen);
842 
843 /**
844  * Create debugging information entry for a bit field member.
845  * \param Builder The DIBuilder.
846  * \param Scope Member scope.
847  * \param Name Member name.
848  * \param NameLen Length of member name.
849  * \param File File where this member is defined.
850  * \param LineNumber Line number.
851  * \param SizeInBits Member size.
852  * \param OffsetInBits Member offset.
853  * \param StorageOffsetInBits Member storage offset.
854  * \param Flags Flags to encode member attribute.
855  * \param Type Parent type.
856  */
859  LLVMMetadataRef Scope,
860  const char *Name, size_t NameLen,
861  LLVMMetadataRef File, unsigned LineNumber,
862  uint64_t SizeInBits,
863  uint64_t OffsetInBits,
864  uint64_t StorageOffsetInBits,
865  LLVMDIFlags Flags, LLVMMetadataRef Type);
866 
867 /**
868  * Create debugging information entry for a class.
869  * \param Scope Scope in which this class is defined.
870  * \param Name Class name.
871  * \param NameLen The length of the C string passed to \c Name.
872  * \param File File where this member is defined.
873  * \param LineNumber Line number.
874  * \param SizeInBits Member size.
875  * \param AlignInBits Member alignment.
876  * \param OffsetInBits Member offset.
877  * \param Flags Flags to encode member attribute, e.g. private.
878  * \param DerivedFrom Debug info of the base class of this type.
879  * \param Elements Class members.
880  * \param NumElements Number of class elements.
881  * \param VTableHolder Debug info of the base class that contains vtable
882  * for this type. This is used in
883  * DW_AT_containing_type. See DWARF documentation
884  * for more info.
885  * \param TemplateParamsNode Template type parameters.
886  * \param UniqueIdentifier A unique identifier for the type.
887  * \param UniqueIdentifierLen Length of the unique identifier.
888  */
890  LLVMMetadataRef Scope, const char *Name, size_t NameLen,
891  LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
892  uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
893  LLVMMetadataRef DerivedFrom,
894  LLVMMetadataRef *Elements, unsigned NumElements,
895  LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
896  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
897 
898 /**
899  * Create a uniqued DIType* clone with FlagArtificial set.
900  * \param Builder The DIBuilder.
901  * \param Type The underlying type.
902  */
906 
907 /**
908  * Get the name of this DIType.
909  * \param DType The DIType.
910  * \param Length The length of the returned string.
911  *
912  * @see DIType::getName()
913  */
914 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
915 
916 /**
917  * Get the size of this DIType in bits.
918  * \param DType The DIType.
919  *
920  * @see DIType::getSizeInBits()
921  */
923 
924 /**
925  * Get the offset of this DIType in bits.
926  * \param DType The DIType.
927  *
928  * @see DIType::getOffsetInBits()
929  */
931 
932 /**
933  * Get the alignment of this DIType in bits.
934  * \param DType The DIType.
935  *
936  * @see DIType::getAlignInBits()
937  */
939 
940 /**
941  * Get the source line where this DIType is declared.
942  * \param DType The DIType.
943  *
944  * @see DIType::getLine()
945  */
946 unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
947 
948 /**
949  * Get the flags associated with this DIType.
950  * \param DType The DIType.
951  *
952  * @see DIType::getFlags()
953  */
954 LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
955 
956 /**
957  * Create a descriptor for a value range.
958  * \param Builder The DIBuilder.
959  * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
960  * \param Count Count of elements in the subrange.
961  */
963  int64_t LowerBound,
964  int64_t Count);
965 
966 /**
967  * Create an array of DI Nodes.
968  * \param Builder The DIBuilder.
969  * \param Data The DI Node elements.
970  * \param NumElements Number of DI Node elements.
971  */
974  size_t NumElements);
975 
976 /**
977  * Create a new descriptor for the specified variable which has a complex
978  * address expression for its address.
979  * \param Builder The DIBuilder.
980  * \param Addr An array of complex address operations.
981  * \param Length Length of the address operation array.
982  */
984  int64_t *Addr, size_t Length);
985 
986 /**
987  * Create a new descriptor for the specified variable that does not have an
988  * address, but does have a constant value.
989  * \param Builder The DIBuilder.
990  * \param Value The constant value.
991  */
994  int64_t Value);
995 
996 /**
997  * Create a new descriptor for the specified variable.
998  * \param Scope Variable scope.
999  * \param Name Name of the variable.
1000  * \param NameLen The length of the C string passed to \c Name.
1001  * \param Linkage Mangled name of the variable.
1002  * \param LinkLen The length of the C string passed to \c Linkage.
1003  * \param File File where this variable is defined.
1004  * \param LineNo Line number.
1005  * \param Ty Variable Type.
1006  * \param LocalToUnit Boolean flag indicate whether this variable is
1007  * externally visible or not.
1008  * \param Expr The location of the global relative to the attached
1009  * GlobalVariable.
1010  * \param Decl Reference to the corresponding declaration.
1011  * variables.
1012  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1013  * specified)
1014  */
1016  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1017  size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
1018  unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1019  LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
1020 /**
1021  * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
1022  * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
1023  * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
1024  * \param Ctx The context in which to construct the temporary node.
1025  * \param Data The metadata elements.
1026  * \param NumElements Number of metadata elements.
1027  */
1029  size_t NumElements);
1030 
1031 /**
1032  * Deallocate a temporary node.
1033  *
1034  * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1035  * references will be reset.
1036  * \param TempNode The temporary metadata node.
1037  */
1039 
1040 /**
1041  * Replace all uses of temporary metadata.
1042  * \param TempTargetMetadata The temporary metadata node.
1043  * \param Replacement The replacement metadata node.
1044  */
1045 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
1046  LLVMMetadataRef Replacement);
1047 
1048 /**
1049  * Create a new descriptor for the specified global variable that is temporary
1050  * and meant to be RAUWed.
1051  * \param Scope Variable scope.
1052  * \param Name Name of the variable.
1053  * \param NameLen The length of the C string passed to \c Name.
1054  * \param Linkage Mangled name of the variable.
1055  * \param LnkLen The length of the C string passed to \c Linkage.
1056  * \param File File where this variable is defined.
1057  * \param LineNo Line number.
1058  * \param Ty Variable Type.
1059  * \param LocalToUnit Boolean flag indicate whether this variable is
1060  * externally visible or not.
1061  * \param Decl Reference to the corresponding declaration.
1062  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1063  * specified)
1064  */
1066  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1067  size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
1068  unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1069  LLVMMetadataRef Decl, uint32_t AlignInBits);
1070 
1071 /**
1072  * Insert a new llvm.dbg.declare intrinsic call before the given instruction.
1073  * \param Builder The DIBuilder.
1074  * \param Storage The storage of the variable to declare.
1075  * \param VarInfo The variable's debug info descriptor.
1076  * \param Expr A complex location expression for the variable.
1077  * \param DebugLoc Debug info location.
1078  * \param Instr Instruction acting as a location for the new intrinsic.
1079  */
1081  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1082  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1083 
1084 /**
1085  * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic
1086  * block. If the basic block has a terminator instruction, the intrinsic is
1087  * inserted before that terminator instruction.
1088  * \param Builder The DIBuilder.
1089  * \param Storage The storage of the variable to declare.
1090  * \param VarInfo The variable's debug info descriptor.
1091  * \param Expr A complex location expression for the variable.
1092  * \param DebugLoc Debug info location.
1093  * \param Block Basic block acting as a location for the new intrinsic.
1094  */
1096  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1097  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1098 
1099 /**
1100  * Insert a new llvm.dbg.value intrinsic call before the given instruction.
1101  * \param Builder The DIBuilder.
1102  * \param Val The value of the variable.
1103  * \param VarInfo The variable's debug info descriptor.
1104  * \param Expr A complex location expression for the variable.
1105  * \param DebugLoc Debug info location.
1106  * \param Instr Instruction acting as a location for the new intrinsic.
1107  */
1109  LLVMValueRef Val,
1110  LLVMMetadataRef VarInfo,
1111  LLVMMetadataRef Expr,
1112  LLVMMetadataRef DebugLoc,
1113  LLVMValueRef Instr);
1114 
1115 /**
1116  * Insert a new llvm.dbg.value intrinsic call at the end of the given basic
1117  * block. If the basic block has a terminator instruction, the intrinsic is
1118  * inserted before that terminator instruction.
1119  * \param Builder The DIBuilder.
1120  * \param Val The value of the variable.
1121  * \param VarInfo The variable's debug info descriptor.
1122  * \param Expr A complex location expression for the variable.
1123  * \param DebugLoc Debug info location.
1124  * \param Block Basic block acting as a location for the new intrinsic.
1125  */
1127  LLVMValueRef Val,
1128  LLVMMetadataRef VarInfo,
1129  LLVMMetadataRef Expr,
1130  LLVMMetadataRef DebugLoc,
1131  LLVMBasicBlockRef Block);
1132 
1133 /**
1134  * Create a new descriptor for a local auto variable.
1135  * \param Builder The DIBuilder.
1136  * \param Scope The local scope the variable is declared in.
1137  * \param Name Variable name.
1138  * \param NameLen Length of variable name.
1139  * \param File File where this variable is defined.
1140  * \param LineNo Line number.
1141  * \param Ty Metadata describing the type of the variable.
1142  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1143  * \param Flags Flags.
1144  * \param AlignInBits Variable alignment.
1145  */
1147  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1148  size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1149  LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1150 
1151 /**
1152  * Create a new descriptor for a function parameter variable.
1153  * \param Builder The DIBuilder.
1154  * \param Scope The local scope the variable is declared in.
1155  * \param Name Variable name.
1156  * \param NameLen Length of variable name.
1157  * \param ArgNo Unique argument number for this variable; starts at 1.
1158  * \param File File where this variable is defined.
1159  * \param LineNo Line number.
1160  * \param Ty Metadata describing the type of the variable.
1161  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1162  * \param Flags Flags.
1163  */
1165  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1166  size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1167  LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1168 
1169 /**
1170  * Get the metadata of the subprogram attached to a function.
1171  *
1172  * @see llvm::Function::getSubprogram()
1173  */
1175 
1176 /**
1177  * Set the subprogram attached to a function.
1178  *
1179  * @see llvm::Function::setSubprogram()
1180  */
1182 
1183 /**
1184  * Obtain the enumerated type of a Metadata instance.
1185  *
1186  * @see llvm::Metadata::getMetadataID()
1187  */
1188 LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
1189 
1190 #ifdef __cplusplus
1191 } /* end extern "C" */
1192 #endif
1193 
1194 #endif
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
Definition: MsgPackReader.h:49
LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create a type array.
Definition: DebugInfo.cpp:1197
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:931
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:987
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:1287
void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode)
Deallocate a temporary node.
Definition: DebugInfo.cpp:1246
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:1240
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create an array of DI Nodes.
Definition: DebugInfo.cpp:1336
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:1311
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
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:1299
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:1343
uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType)
Get the size of this DIType in bits.
Definition: DebugInfo.cpp:1177
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:1321
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:1257
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:1062
LLVMDWARFEmissionKind
The amount of debug information to emit.
Definition: DebugInfo.h:124
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:1051
amdgpu Simplify well known AMD library false Value Value const Twine & Name
unsigned LLVMDWARFTypeEncoding
An LLVM DWARF type encoding.
Definition: DebugInfo.h:171
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count)
Create a descriptor for a value range.
Definition: DebugInfo.cpp:1331
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:1130
LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
Create subroutine type.
Definition: DebugInfo.cpp:1205
LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType)
Get the flags associated with this DIType.
Definition: DebugInfo.cpp:1193
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:1004
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:1072
LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata)
Obtain the enumerated type of a Metadata instance.
Definition: DebugInfo.cpp:1351
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:1105
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:903
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
unsigned LLVMDebugMetadataVersion(void)
The current debug metadata version number.
Definition: DebugInfo.cpp:726
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:1216
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:1031
LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagArtificial set.
Definition: DebugInfo.cpp:1166
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:1278
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:962
const char * LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length)
Get the name of this DIType.
Definition: DebugInfo.cpp:1171
LLVMDWARFSourceLanguage
Source languages known by DWARF.
Definition: DebugInfo.h:74
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:1112
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:1223
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:971
uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType)
Get the alignment of this DIType in bits.
Definition: DebugInfo.cpp:1185
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:1117
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:915
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:1228
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:1084
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:942
void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP)
Set the subprogram attached to a function.
Definition: DebugInfo.cpp:1347
LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
Create a DWARF unspecified type.
Definition: DebugInfo.cpp:998
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:1045
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:953
uint32_t Size
Definition: Profile.cpp:47
LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a qualified type, e.g.
Definition: DebugInfo.cpp:1098
LLVMDIFlags
This file declares the C API endpoints for generating DWARF Debug Info.
Definition: DebugInfo.h:29
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:1250
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
const unsigned Kind
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:1017
unsigned LLVMDITypeGetLine(LLVMMetadataRef DType)
Get the source line where this DIType is declared.
Definition: DebugInfo.cpp:1189
uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType)
Get the offset of this DIType in bits.
Definition: DebugInfo.cpp:1181
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:1269
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:41
unsigned LLVMMetadataKind
Definition: DebugInfo.h:166
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
std::vector< uint32_t > Metadata
PAL metadata represented as a vector.
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:1145
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