LLVM  7.0.0
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,
58  LLVMDIFlagThunk = 1 << 25,
59  LLVMDIFlagTrivial = 1 << 26,
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  * An LLVM DWARF type encoding.
129  */
130 typedef unsigned LLVMDWARFTypeEncoding;
131 
132 /**
133  * The current debug metadata version number.
134  */
135 unsigned LLVMDebugMetadataVersion(void);
136 
137 /**
138  * The version of debug metadata that's present in the provided \c Module.
139  */
141 
142 /**
143  * Strip debug info in the module if it exists.
144  * To do this, we remove all calls to the debugger intrinsics and any named
145  * metadata for debugging. We also remove debug locations for instructions.
146  * Return true if module is modified.
147  */
149 
150 /**
151  * Construct a builder for a module, and do not allow for unresolved nodes
152  * attached to the module.
153  */
155 
156 /**
157  * Construct a builder for a module and collect unresolved nodes attached
158  * to the module in order to resolve cycles during a call to
159  * \c LLVMDIBuilderFinalize.
160  */
162 
163 /**
164  * Deallocates the \c DIBuilder and everything it owns.
165  * @note You must call \c LLVMDIBuilderFinalize before this
166  */
168 
169 /**
170  * Construct any deferred debug info descriptors.
171  */
173 
174 /**
175  * A CompileUnit provides an anchor for all debugging
176  * information generated during this instance of compilation.
177  * \param Lang Source programming language, eg.
178  * \c LLVMDWARFSourceLanguageC99
179  * \param FileRef File info.
180  * \param Producer Identify the producer of debugging information
181  * and code. Usually this is a compiler
182  * version string.
183  * \param ProducerLen The length of the C string passed to \c Producer.
184  * \param isOptimized A boolean flag which indicates whether optimization
185  * is enabled or not.
186  * \param Flags This string lists command line options. This
187  * string is directly embedded in debug info
188  * output which may be used by a tool
189  * analyzing generated debugging information.
190  * \param FlagsLen The length of the C string passed to \c Flags.
191  * \param RuntimeVer This indicates runtime version for languages like
192  * Objective-C.
193  * \param SplitName The name of the file that we'll split debug info
194  * out into.
195  * \param SplitNameLen The length of the C string passed to \c SplitName.
196  * \param Kind The kind of debug information to generate.
197  * \param DWOId The DWOId if this is a split skeleton compile unit.
198  * \param SplitDebugInlining Whether to emit inline debug info.
199  * \param DebugInfoForProfiling Whether to emit extra debug info for
200  * profile collection.
201  */
203  LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
204  LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
205  LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
206  unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
207  LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
208  LLVMBool DebugInfoForProfiling);
209 
210 /**
211  * Create a file descriptor to hold debugging information for a file.
212  * \param Builder The \c DIBuilder.
213  * \param Filename File name.
214  * \param FilenameLen The length of the C string passed to \c Filename.
215  * \param Directory Directory.
216  * \param DirectoryLen The length of the C string passed to \c Directory.
217  */
219 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
220  size_t FilenameLen, const char *Directory,
221  size_t DirectoryLen);
222 
223 /**
224  * Creates a new descriptor for a module with the specified parent scope.
225  * \param Builder The \c DIBuilder.
226  * \param ParentScope The parent scope containing this module declaration.
227  * \param Name Module name.
228  * \param NameLen The length of the C string passed to \c Name.
229  * \param ConfigMacros A space-separated shell-quoted list of -D macro
230  definitions as they would appear on a command line.
231  * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
232  * \param IncludePath The path to the module map file.
233  * \param IncludePathLen The length of the C string passed to \c IncludePath.
234  * \param ISysRoot The Clang system root (value of -isysroot).
235  * \param ISysRootLen The length of the C string passed to \c ISysRoot.
236  */
239  const char *Name, size_t NameLen,
240  const char *ConfigMacros, size_t ConfigMacrosLen,
241  const char *IncludePath, size_t IncludePathLen,
242  const char *ISysRoot, size_t ISysRootLen);
243 
244 /**
245  * Creates a new descriptor for a namespace with the specified parent scope.
246  * \param Builder The \c DIBuilder.
247  * \param ParentScope The parent scope containing this module declaration.
248  * \param Name NameSpace name.
249  * \param NameLen The length of the C string passed to \c Name.
250  * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
251  * this is true of C++ inline namespaces.
252  */
255  LLVMMetadataRef ParentScope,
256  const char *Name, size_t NameLen,
257  LLVMBool ExportSymbols);
258 
259 /**
260  * Create a new descriptor for the specified subprogram.
261  * \param Builder The \c DIBuilder.
262  * \param Scope Function scope.
263  * \param Name Function name.
264  * \param NameLen Length of enumeration name.
265  * \param LinkageName Mangled function name.
266  * \param LinkageNameLen Length of linkage name.
267  * \param File File where this variable is defined.
268  * \param LineNo Line number.
269  * \param Ty Function type.
270  * \param IsLocalToUnit True if this function is not externally visible.
271  * \param IsDefinition True if this is a function definition.
272  * \param ScopeLine Set to the beginning of the scope this starts
273  * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
274  * used to emit dwarf attributes.
275  * \param IsOptimized True if optimization is ON.
276  */
278  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
279  size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
280  LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
281  LLVMBool IsLocalToUnit, LLVMBool IsDefinition,
282  unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized);
283 
284 /**
285  * Create a descriptor for a lexical block with the specified parent context.
286  * \param Builder The \c DIBuilder.
287  * \param Scope Parent lexical block.
288  * \param File Source file.
289  * \param Line The line in the source file.
290  * \param Column The column in the source file.
291  */
293  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
294  LLVMMetadataRef File, unsigned Line, unsigned Column);
295 
296 /**
297  * Create a descriptor for a lexical block with a new file attached.
298  * \param Builder The \c DIBuilder.
299  * \param Scope Lexical block.
300  * \param File Source file.
301  * \param Discriminator DWARF path discriminator value.
302  */
305  LLVMMetadataRef Scope,
307  unsigned Discriminator);
308 
309 /**
310  * Create a descriptor for an imported namespace. Suitable for e.g. C++
311  * using declarations.
312  * \param Builder The \c DIBuilder.
313  * \param Scope The scope this module is imported into
314  * \param File File where the declaration is located.
315  * \param Line Line number of the declaration.
316  */
319  LLVMMetadataRef Scope,
320  LLVMMetadataRef NS,
322  unsigned Line);
323 
324 /**
325  * Create a descriptor for an imported module that aliases another
326  * imported entity descriptor.
327  * \param Builder The \c DIBuilder.
328  * \param Scope The scope this module is imported into
329  * \param ImportedEntity Previous imported entity to alias.
330  * \param File File where the declaration is located.
331  * \param Line Line number of the declaration.
332  */
335  LLVMMetadataRef Scope,
336  LLVMMetadataRef ImportedEntity,
338  unsigned Line);
339 
340 /**
341  * Create a descriptor for an imported module.
342  * \param Builder The \c DIBuilder.
343  * \param Scope The scope this module is imported into
344  * \param M The module being imported here
345  * \param File File where the declaration is located.
346  * \param Line Line number of the declaration.
347  */
350  LLVMMetadataRef Scope,
351  LLVMMetadataRef M,
353  unsigned Line);
354 
355 /**
356  * Create a descriptor for an imported function, type, or variable. Suitable
357  * for e.g. FORTRAN-style USE declarations.
358  * \param Builder The DIBuilder.
359  * \param Scope The scope this module is imported into.
360  * \param Decl The declaration (or definition) of a function, type,
361  or variable.
362  * \param File File where the declaration is located.
363  * \param Line Line number of the declaration.
364  * \param Name A name that uniquely identifies this imported declaration.
365  * \param NameLen The length of the C string passed to \c Name.
366  */
369  LLVMMetadataRef Scope,
370  LLVMMetadataRef Decl,
372  unsigned Line,
373  const char *Name, size_t NameLen);
374 
375 /**
376  * Creates a new DebugLocation that describes a source location.
377  * \param Line The line in the source file.
378  * \param Column The column in the source file.
379  * \param Scope The scope in which the location resides.
380  * \param InlinedAt The scope where this location was inlined, if at all.
381  * (optional).
382  * \note If the item to which this location is attached cannot be
383  * attributed to a source line, pass 0 for the line and column.
384  */
387  unsigned Column, LLVMMetadataRef Scope,
388  LLVMMetadataRef InlinedAt);
389 
390 /**
391  * Get the line number of this debug location.
392  * \param Location The debug location.
393  *
394  * @see DILocation::getLine()
395  */
396 unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
397 
398 /**
399  * Get the column number of this debug location.
400  * \param Location The debug location.
401  *
402  * @see DILocation::getColumn()
403  */
404 unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
405 
406 /**
407  * Get the local scope associated with this debug location.
408  * \param Location The debug location.
409  *
410  * @see DILocation::getScope()
411  */
413 
414 /**
415  * Create a type array.
416  * \param Builder The DIBuilder.
417  * \param Data The type elements.
418  * \param NumElements Number of type elements.
419  */
422  size_t NumElements);
423 
424 /**
425  * Create subroutine type.
426  * \param Builder The DIBuilder.
427  * \param File The file in which the subroutine resides.
428  * \param ParameterTypes An array of subroutine parameter types. This
429  * includes return type at 0th index.
430  * \param NumParameterTypes The number of parameter types in \c ParameterTypes
431  * \param Flags E.g.: \c LLVMDIFlagLValueReference.
432  * These flags are used to emit dwarf attributes.
433  */
437  LLVMMetadataRef *ParameterTypes,
438  unsigned NumParameterTypes,
439  LLVMDIFlags Flags);
440 
441 /**
442  * Create debugging information entry for an enumeration.
443  * \param Builder The DIBuilder.
444  * \param Scope Scope in which this enumeration is defined.
445  * \param Name Enumeration name.
446  * \param NameLen Length of enumeration name.
447  * \param File File where this member is defined.
448  * \param LineNumber Line number.
449  * \param SizeInBits Member size.
450  * \param AlignInBits Member alignment.
451  * \param Elements Enumeration elements.
452  * \param NumElements Number of enumeration elements.
453  * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
454  */
456  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
457  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
458  uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
459  unsigned NumElements, LLVMMetadataRef ClassTy);
460 
461 /**
462  * Create debugging information entry for a union.
463  * \param Builder The DIBuilder.
464  * \param Scope Scope in which this union is defined.
465  * \param Name Union name.
466  * \param NameLen Length of union name.
467  * \param File File where this member is defined.
468  * \param LineNumber Line number.
469  * \param SizeInBits Member size.
470  * \param AlignInBits Member alignment.
471  * \param Flags Flags to encode member attribute, e.g. private
472  * \param Elements Union elements.
473  * \param NumElements Number of union elements.
474  * \param RunTimeLang Optional parameter, Objective-C runtime version.
475  * \param UniqueId A unique identifier for the union.
476  * \param UniqueIdLen Length of unique identifier.
477  */
479  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
480  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
481  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
482  LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
483  const char *UniqueId, size_t UniqueIdLen);
484 
485 
486 /**
487  * Create debugging information entry for an array.
488  * \param Builder The DIBuilder.
489  * \param Size Array size.
490  * \param AlignInBits Alignment.
491  * \param Ty Element type.
492  * \param Subscripts Subscripts.
493  * \param NumSubscripts Number of subscripts.
494  */
497  uint32_t AlignInBits, LLVMMetadataRef Ty,
498  LLVMMetadataRef *Subscripts,
499  unsigned NumSubscripts);
500 
501 /**
502  * Create debugging information entry for a vector type.
503  * \param Builder The DIBuilder.
504  * \param Size Vector size.
505  * \param AlignInBits Alignment.
506  * \param Ty Element type.
507  * \param Subscripts Subscripts.
508  * \param NumSubscripts Number of subscripts.
509  */
512  uint32_t AlignInBits, LLVMMetadataRef Ty,
513  LLVMMetadataRef *Subscripts,
514  unsigned NumSubscripts);
515 
516 /**
517  * Create a DWARF unspecified type.
518  * \param Builder The DIBuilder.
519  * \param Name The unspecified type's name.
520  * \param NameLen Length of type name.
521  */
524  size_t NameLen);
525 
526 /**
527  * Create debugging information entry for a basic
528  * type.
529  * \param Builder The DIBuilder.
530  * \param Name Type name.
531  * \param NameLen Length of type name.
532  * \param SizeInBits Size of the type.
533  * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
534  */
537  size_t NameLen, uint64_t SizeInBits,
538  LLVMDWARFTypeEncoding Encoding);
539 
540 /**
541  * Create debugging information entry for a pointer.
542  * \param Builder The DIBuilder.
543  * \param PointeeTy Type pointed by this pointer.
544  * \param SizeInBits Size.
545  * \param AlignInBits Alignment. (optional, pass 0 to ignore)
546  * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
547  * \param Name Pointer type name. (optional)
548  * \param NameLen Length of pointer type name. (optional)
549  */
551  LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
552  uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
553  const char *Name, size_t NameLen);
554 
555 /**
556  * Create debugging information entry for a struct.
557  * \param Builder The DIBuilder.
558  * \param Scope Scope in which this struct is defined.
559  * \param Name Struct name.
560  * \param NameLen Struct name length.
561  * \param File File where this member is defined.
562  * \param LineNumber Line number.
563  * \param SizeInBits Member size.
564  * \param AlignInBits Member alignment.
565  * \param Flags Flags to encode member attribute, e.g. private
566  * \param Elements Struct elements.
567  * \param NumElements Number of struct elements.
568  * \param RunTimeLang Optional parameter, Objective-C runtime version.
569  * \param VTableHolder The object containing the vtable for the struct.
570  * \param UniqueId A unique identifier for the struct.
571  * \param UniqueIdLen Length of the unique identifier for the struct.
572  */
574  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
575  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
576  uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
577  LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
578  unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
579  const char *UniqueId, size_t UniqueIdLen);
580 
581 /**
582  * Create debugging information entry for a member.
583  * \param Builder The DIBuilder.
584  * \param Scope Member scope.
585  * \param Name Member name.
586  * \param NameLen Length of member name.
587  * \param File File where this member is defined.
588  * \param LineNo Line number.
589  * \param SizeInBits Member size.
590  * \param AlignInBits Member alignment.
591  * \param OffsetInBits Member offset.
592  * \param Flags Flags to encode member attribute, e.g. private
593  * \param Ty Parent type.
594  */
596  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
597  size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
598  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
599  LLVMDIFlags Flags, LLVMMetadataRef Ty);
600 
601 /**
602  * Create debugging information entry for a
603  * C++ static data member.
604  * \param Builder The DIBuilder.
605  * \param Scope Member scope.
606  * \param Name Member name.
607  * \param NameLen Length of member name.
608  * \param File File where this member is declared.
609  * \param LineNumber Line number.
610  * \param Type Type of the static member.
611  * \param Flags Flags to encode member attribute, e.g. private.
612  * \param ConstantVal Const initializer of the member.
613  * \param AlignInBits Member alignment.
614  */
617  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
618  size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
619  LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
620  uint32_t AlignInBits);
621 
622 /**
623  * Create debugging information entry for a pointer to member.
624  * \param Builder The DIBuilder.
625  * \param PointeeType Type pointed to by this pointer.
626  * \param ClassType Type for which this pointer points to members of.
627  * \param SizeInBits Size.
628  * \param AlignInBits Alignment.
629  * \param Flags Flags.
630  */
633  LLVMMetadataRef PointeeType,
634  LLVMMetadataRef ClassType,
635  uint64_t SizeInBits,
636  uint32_t AlignInBits,
637  LLVMDIFlags Flags);
638 /**
639  * Create debugging information entry for Objective-C instance variable.
640  * \param Builder The DIBuilder.
641  * \param Name Member name.
642  * \param NameLen The length of the C string passed to \c Name.
643  * \param File File where this member is defined.
644  * \param LineNo Line number.
645  * \param SizeInBits Member size.
646  * \param AlignInBits Member alignment.
647  * \param OffsetInBits Member offset.
648  * \param Flags Flags to encode member attribute, e.g. private
649  * \param Ty Parent type.
650  * \param PropertyNode Property associated with this ivar.
651  */
654  const char *Name, size_t NameLen,
655  LLVMMetadataRef File, unsigned LineNo,
656  uint64_t SizeInBits, uint32_t AlignInBits,
657  uint64_t OffsetInBits, LLVMDIFlags Flags,
658  LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
659 
660 /**
661  * Create debugging information entry for Objective-C property.
662  * \param Builder The DIBuilder.
663  * \param Name Property name.
664  * \param NameLen The length of the C string passed to \c Name.
665  * \param File File where this property is defined.
666  * \param LineNo Line number.
667  * \param GetterName Name of the Objective C property getter selector.
668  * \param GetterNameLen The length of the C string passed to \c GetterName.
669  * \param SetterName Name of the Objective C property setter selector.
670  * \param SetterNameLen The length of the C string passed to \c SetterName.
671  * \param PropertyAttributes Objective C property attributes.
672  * \param Ty Type.
673  */
676  const char *Name, size_t NameLen,
677  LLVMMetadataRef File, unsigned LineNo,
678  const char *GetterName, size_t GetterNameLen,
679  const char *SetterName, size_t SetterNameLen,
680  unsigned PropertyAttributes,
681  LLVMMetadataRef Ty);
682 
683 /**
684  * Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
685  * \param Builder The DIBuilder.
686  * \param Type The underlying type to which this pointer points.
687  */
691 
692 /**
693  * Create debugging information entry for a qualified
694  * type, e.g. 'const int'.
695  * \param Builder The DIBuilder.
696  * \param Tag Tag identifying type,
697  * e.g. LLVMDWARFTypeQualifier_volatile_type
698  * \param Type Base Type.
699  */
703 
704 /**
705  * Create debugging information entry for a c++
706  * style reference or rvalue reference type.
707  * \param Builder The DIBuilder.
708  * \param Tag Tag identifying type,
709  * \param Type Base Type.
710  */
714 
715 /**
716  * Create C++11 nullptr type.
717  * \param Builder The DIBuilder.
718  */
721 
722 /**
723  * Create debugging information entry for a typedef.
724  * \param Builder The DIBuilder.
725  * \param Type Original type.
726  * \param Name Typedef name.
727  * \param File File where this type is defined.
728  * \param LineNo Line number.
729  * \param Scope The surrounding context for the typedef.
730  */
733  const char *Name, size_t NameLen,
734  LLVMMetadataRef File, unsigned LineNo,
735  LLVMMetadataRef Scope);
736 
737 /**
738  * Create debugging information entry to establish inheritance relationship
739  * between two types.
740  * \param Builder The DIBuilder.
741  * \param Ty Original type.
742  * \param BaseTy Base type. Ty is inherits from base.
743  * \param BaseOffset Base offset.
744  * \param VBPtrOffset Virtual base pointer offset.
745  * \param Flags Flags to describe inheritance attribute, e.g. private
746  */
749  LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
750  uint64_t BaseOffset, uint32_t VBPtrOffset,
751  LLVMDIFlags Flags);
752 
753 /**
754  * Create a permanent forward-declared type.
755  * \param Builder The DIBuilder.
756  * \param Tag A unique tag for this type.
757  * \param Name Type name.
758  * \param NameLen Length of type name.
759  * \param Scope Type scope.
760  * \param File File where this type is defined.
761  * \param Line Line number where this type is defined.
762  * \param RuntimeLang Indicates runtime version for languages like
763  * Objective-C.
764  * \param SizeInBits Member size.
765  * \param AlignInBits Member alignment.
766  * \param UniqueIdentifier A unique identifier for the type.
767  * \param UniqueIdentifierLen Length of the unique identifier.
768  */
770  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
771  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
772  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
773  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
774 
775 /**
776  * Create a temporary forward-declared type.
777  * \param Builder The DIBuilder.
778  * \param Tag A unique tag for this type.
779  * \param Name Type name.
780  * \param NameLen Length of type name.
781  * \param Scope Type scope.
782  * \param File File where this type is defined.
783  * \param Line Line number where this type is defined.
784  * \param RuntimeLang Indicates runtime version for languages like
785  * Objective-C.
786  * \param SizeInBits Member size.
787  * \param AlignInBits Member alignment.
788  * \param Flags Flags.
789  * \param UniqueIdentifier A unique identifier for the type.
790  * \param UniqueIdentifierLen Length of the unique identifier.
791  */
794  LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
795  size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
796  unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
797  LLVMDIFlags Flags, const char *UniqueIdentifier,
798  size_t UniqueIdentifierLen);
799 
800 /**
801  * Create debugging information entry for a bit field member.
802  * \param Builder The DIBuilder.
803  * \param Scope Member scope.
804  * \param Name Member name.
805  * \param NameLen Length of member name.
806  * \param File File where this member is defined.
807  * \param LineNumber Line number.
808  * \param SizeInBits Member size.
809  * \param OffsetInBits Member offset.
810  * \param StorageOffsetInBits Member storage offset.
811  * \param Flags Flags to encode member attribute.
812  * \param Type Parent type.
813  */
816  LLVMMetadataRef Scope,
817  const char *Name, size_t NameLen,
818  LLVMMetadataRef File, unsigned LineNumber,
819  uint64_t SizeInBits,
820  uint64_t OffsetInBits,
821  uint64_t StorageOffsetInBits,
822  LLVMDIFlags Flags, LLVMMetadataRef Type);
823 
824 /**
825  * Create debugging information entry for a class.
826  * \param Scope Scope in which this class is defined.
827  * \param Name Class name.
828  * \param NameLen The length of the C string passed to \c Name.
829  * \param File File where this member is defined.
830  * \param LineNumber Line number.
831  * \param SizeInBits Member size.
832  * \param AlignInBits Member alignment.
833  * \param OffsetInBits Member offset.
834  * \param Flags Flags to encode member attribute, e.g. private.
835  * \param DerivedFrom Debug info of the base class of this type.
836  * \param Elements Class members.
837  * \param NumElements Number of class elements.
838  * \param VTableHolder Debug info of the base class that contains vtable
839  * for this type. This is used in
840  * DW_AT_containing_type. See DWARF documentation
841  * for more info.
842  * \param TemplateParamsNode Template type parameters.
843  * \param UniqueIdentifier A unique identifier for the type.
844  * \param UniqueIdentifierLen Length of the unique identifier.
845  */
847  LLVMMetadataRef Scope, const char *Name, size_t NameLen,
848  LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
849  uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
850  LLVMMetadataRef DerivedFrom,
851  LLVMMetadataRef *Elements, unsigned NumElements,
852  LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
853  const char *UniqueIdentifier, size_t UniqueIdentifierLen);
854 
855 /**
856  * Create a uniqued DIType* clone with FlagArtificial set.
857  * \param Builder The DIBuilder.
858  * \param Type The underlying type.
859  */
863 
864 /**
865  * Get the name of this DIType.
866  * \param DType The DIType.
867  * \param Length The length of the returned string.
868  *
869  * @see DIType::getName()
870  */
871 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
872 
873 /**
874  * Get the size of this DIType in bits.
875  * \param DType The DIType.
876  *
877  * @see DIType::getSizeInBits()
878  */
880 
881 /**
882  * Get the offset of this DIType in bits.
883  * \param DType The DIType.
884  *
885  * @see DIType::getOffsetInBits()
886  */
888 
889 /**
890  * Get the alignment of this DIType in bits.
891  * \param DType The DIType.
892  *
893  * @see DIType::getAlignInBits()
894  */
896 
897 /**
898  * Get the source line where this DIType is declared.
899  * \param DType The DIType.
900  *
901  * @see DIType::getLine()
902  */
903 unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
904 
905 /**
906  * Get the flags associated with this DIType.
907  * \param DType The DIType.
908  *
909  * @see DIType::getFlags()
910  */
911 LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
912 
913 /**
914  * Create a descriptor for a value range.
915  * \param Builder The DIBuilder.
916  * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
917  * \param Count Count of elements in the subrange.
918  */
920  int64_t LowerBound,
921  int64_t Count);
922 
923 /**
924  * Create an array of DI Nodes.
925  * \param Builder The DIBuilder.
926  * \param Data The DI Node elements.
927  * \param NumElements Number of DI Node elements.
928  */
931  size_t NumElements);
932 
933 /**
934  * Create a new descriptor for the specified variable which has a complex
935  * address expression for its address.
936  * \param Builder The DIBuilder.
937  * \param Addr An array of complex address operations.
938  * \param Length Length of the address operation array.
939  */
941  int64_t *Addr, size_t Length);
942 
943 /**
944  * Create a new descriptor for the specified variable that does not have an
945  * address, but does have a constant value.
946  * \param Builder The DIBuilder.
947  * \param Value The constant value.
948  */
951  int64_t Value);
952 
953 /**
954  * Create a new descriptor for the specified variable.
955  * \param Scope Variable scope.
956  * \param Name Name of the variable.
957  * \param NameLen The length of the C string passed to \c Name.
958  * \param Linkage Mangled name of the variable.
959  * \param LinkLen The length of the C string passed to \c Linkage.
960  * \param File File where this variable is defined.
961  * \param LineNo Line number.
962  * \param Ty Variable Type.
963  * \param LocalToUnit Boolean flag indicate whether this variable is
964  * externally visible or not.
965  * \param Expr The location of the global relative to the attached
966  * GlobalVariable.
967  * \param Decl Reference to the corresponding declaration.
968  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
969  * specified)
970  */
973  LLVMMetadataRef Scope,
974  const char *Name, size_t NameLen,
975  const char *Linkage, size_t LinkLen,
977  unsigned LineNo,
978  LLVMMetadataRef Ty,
979  LLVMBool LocalToUnit,
980  LLVMMetadataRef Expr,
981  LLVMMetadataRef Decl,
982  uint32_t AlignInBits);
983 /**
984  * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
985  * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
986  * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
987  * \param Ctx The context in which to construct the temporary node.
988  * \param Data The metadata elements.
989  * \param NumElements Number of metadata elements.
990  */
992  size_t NumElements);
993 
994 /**
995  * Deallocate a temporary node.
996  *
997  * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
998  * references will be reset.
999  * \param TempNode The temporary metadata node.
1000  */
1002 
1003 /**
1004  * Replace all uses of temporary metadata.
1005  * \param TempTargetMetadata The temporary metadata node.
1006  * \param Replacement The replacement metadata node.
1007  */
1008 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
1009  LLVMMetadataRef Replacement);
1010 
1011 /**
1012  * Create a new descriptor for the specified global variable that is temporary
1013  * and meant to be RAUWed.
1014  * \param Scope Variable scope.
1015  * \param Name Name of the variable.
1016  * \param NameLen The length of the C string passed to \c Name.
1017  * \param Linkage Mangled name of the variable.
1018  * \param LnkLen The length of the C string passed to \c Linkage.
1019  * \param File File where this variable is defined.
1020  * \param LineNo Line number.
1021  * \param Ty Variable Type.
1022  * \param LocalToUnit Boolean flag indicate whether this variable is
1023  * externally visible or not.
1024  * \param Decl Reference to the corresponding declaration.
1025  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1026  * specified)
1027  */
1030  LLVMMetadataRef Scope,
1031  const char *Name, size_t NameLen,
1032  const char *Linkage, size_t LnkLen,
1034  unsigned LineNo,
1035  LLVMMetadataRef Ty,
1036  LLVMBool LocalToUnit,
1037  LLVMMetadataRef Decl,
1038  uint32_t AlignInBits);
1039 
1040 /**
1041  * Insert a new llvm.dbg.declare intrinsic call before the given instruction.
1042  * \param Builder The DIBuilder.
1043  * \param Storage The storage of the variable to declare.
1044  * \param VarInfo The variable's debug info descriptor.
1045  * \param Expr A complex location expression for the variable.
1046  * \param DebugLoc Debug info location.
1047  * \param Instr Instruction acting as a location for the new intrinsic.
1048  */
1050  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1051  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1052 
1053 /**
1054  * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic
1055  * block. If the basic block has a terminator instruction, the intrinsic is
1056  * inserted before that terminator instruction.
1057  * \param Builder The DIBuilder.
1058  * \param Storage The storage of the variable to declare.
1059  * \param VarInfo The variable's debug info descriptor.
1060  * \param Expr A complex location expression for the variable.
1061  * \param DebugLoc Debug info location.
1062  * \param Block Basic block acting as a location for the new intrinsic.
1063  */
1065  LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1066  LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1067 
1068 /**
1069  * Insert a new llvm.dbg.value intrinsic call before the given instruction.
1070  * \param Builder The DIBuilder.
1071  * \param Val The value of the variable.
1072  * \param VarInfo The variable's debug info descriptor.
1073  * \param Expr A complex location expression for the variable.
1074  * \param DebugLoc Debug info location.
1075  * \param Instr Instruction acting as a location for the new intrinsic.
1076  */
1078  LLVMValueRef Val,
1079  LLVMMetadataRef VarInfo,
1080  LLVMMetadataRef Expr,
1081  LLVMMetadataRef DebugLoc,
1082  LLVMValueRef Instr);
1083 
1084 /**
1085  * Insert a new llvm.dbg.value 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 Val The value of the variable.
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  LLVMValueRef Val,
1097  LLVMMetadataRef VarInfo,
1098  LLVMMetadataRef Expr,
1099  LLVMMetadataRef DebugLoc,
1100  LLVMBasicBlockRef Block);
1101 
1102 /**
1103  * Create a new descriptor for a local auto variable.
1104  * \param Builder The DIBuilder.
1105  * \param Scope The local scope the variable is declared in.
1106  * \param Name Variable name.
1107  * \param NameLen Length of variable name.
1108  * \param File File where this variable is defined.
1109  * \param LineNo Line number.
1110  * \param Ty Metadata describing the type of the variable.
1111  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1112  * \param Flags Flags.
1113  * \param AlignInBits Variable alignment.
1114  */
1116  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1117  size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1118  LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1119 
1120 /**
1121  * Create a new descriptor for a function parameter variable.
1122  * \param Builder The DIBuilder.
1123  * \param Scope The local scope the variable is declared in.
1124  * \param Name Variable name.
1125  * \param NameLen Length of variable name.
1126  * \param ArgNo Unique argument number for this variable; starts at 1.
1127  * \param File File where this variable is defined.
1128  * \param LineNo Line number.
1129  * \param Ty Metadata describing the type of the variable.
1130  * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1131  * \param Flags Flags.
1132  */
1134  LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1135  size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1136  LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1137 
1138 /**
1139  * Get the metadata of the subprogram attached to a function.
1140  *
1141  * @see llvm::Function::getSubprogram()
1142  */
1144 
1145 /**
1146  * Set the subprogram attached to a function.
1147  *
1148  * @see llvm::Function::setSubprogram()
1149  */
1151 
1152 #ifdef __cplusplus
1153 } /* end extern "C" */
1154 #endif
1155 
1156 #endif
LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create a type array.
Definition: DebugInfo.cpp:1191
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:927
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:981
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:1293
void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode)
Deallocate a temporary node.
Definition: DebugInfo.cpp:1247
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:790
LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t NumElements)
Create a new temporary MDNode.
Definition: DebugInfo.cpp:1241
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create an array of DI Nodes.
Definition: DebugInfo.cpp:1342
LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location)
Get the local scope associated with this debug location.
Definition: DebugInfo.cpp:895
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:1317
LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt)
Creates a new DebugLocation that describes a source location.
Definition: DebugInfo.cpp:880
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:731
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:843
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:1305
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition: Types.h:104
LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func)
Get the metadata of the subprogram attached to a function.
Definition: DebugInfo.cpp:1349
uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType)
Get the size of this DIType in bits.
Definition: DebugInfo.cpp:1171
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:1327
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:1259
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:1056
LLVMDWARFEmissionKind
The amount of debug information to emit.
Definition: DebugInfo.h:121
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:1045
unsigned LLVMDWARFTypeEncoding
An LLVM DWARF type encoding.
Definition: DebugInfo.h:130
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count)
Create a descriptor for a value range.
Definition: DebugInfo.cpp:1337
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:1124
LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
Create subroutine type.
Definition: DebugInfo.cpp:1199
LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType)
Get the flags associated with this DIType.
Definition: DebugInfo.cpp:1187
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:998
unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module)
The version of debug metadata that&#39;s present in the provided Module.
Definition: DebugInfo.cpp:735
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:1066
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:1099
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:751
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:899
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:812
unsigned LLVMDebugMetadataVersion(void)
The current debug metadata version number.
Definition: DebugInfo.cpp:723
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding)
Create debugging information entry for a basic type.
Definition: DebugInfo.cpp:949
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:1210
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:1025
LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagArtificial set.
Definition: DebugInfo.cpp:1160
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:1284
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:956
const char * LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length)
Get the name of this DIType.
Definition: DebugInfo.cpp:1165
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:855
LLVMMetadataRef LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder)
Create C++11 nullptr type.
Definition: DebugInfo.cpp:1106
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:1217
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:965
uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType)
Get the alignment of this DIType in bits.
Definition: DebugInfo.cpp:1179
void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder)
Construct any deferred debug info descriptors.
Definition: DebugInfo.cpp:747
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:1111
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:891
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:798
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:770
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:778
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:911
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:1223
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:1078
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:938
void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP)
Set the subprogram attached to a function.
Definition: DebugInfo.cpp:1353
LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
Create a DWARF unspecified type.
Definition: DebugInfo.cpp:992
unsigned LLVMDILocationGetLine(LLVMMetadataRef Location)
Get the line number of this debug location.
Definition: DebugInfo.cpp:887
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
Definition: DebugInfo.cpp:1039
LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a qualified type, e.g.
Definition: DebugInfo.cpp:1092
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:743
void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, LLVMMetadataRef Replacement)
Replace all uses of temporary metadata.
Definition: DebugInfo.cpp:1251
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:821
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:1011
unsigned LLVMDITypeGetLine(LLVMMetadataRef DType)
Get the source line where this DIType is declared.
Definition: DebugInfo.cpp:1183
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType)
Get the offset of this DIType in bits.
Definition: DebugInfo.cpp:1175
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:1275
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:867
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:41
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported namespace.
Definition: DebugInfo.cpp:831
LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module)
Strip debug info in the module if it exists.
Definition: DebugInfo.cpp:739
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:76
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:1139
LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M)
Construct a builder for a module, and do not allow for unresolved nodes attached to the module...
Definition: DebugInfo.cpp:727