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