LLVM 24.0.0git
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/ExternC.h"
20#include "llvm-c/Types.h"
21#include "llvm-c/Visibility.h"
22
24
25/**
26 * @defgroup LLVMCCoreDebugInfo Debug Information
27 * @ingroup LLVMCCore
28 *
29 * @{
30 */
31
32/**
33 * Debug info flags.
34 */
75
76/**
77 * Source languages known by DWARF.
78 */
79typedef enum {
90 // New in DWARF v3:
100 // New in DWARF v4:
102 // New in DWARF v5:
155
156 // Vendor extensions:
161
162/**
163 * The amount of debug information to emit.
164 */
170
171/**
172 * The kind of metadata nodes.
173 */
174// NOTE: New entries should always be appended instead of matching the order
175// in Metadata.def.
176enum {
218};
219typedef unsigned LLVMMetadataKind;
220
221/**
222 * The kind of checksum to emit.
223 */
225
226/**
227 * An LLVM DWARF type encoding.
228 */
229typedef unsigned LLVMDWARFTypeEncoding;
230
231/**
232 * Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro.
233 * @see llvm::dwarf::MacinfoRecordType
234 * @note Values are from DW_MACINFO_* constants in the DWARF specification.
235 */
243
244/**
245 * The current debug metadata version number.
246 */
248
249/**
250 * The version of debug metadata that's present in the provided \c Module.
251 */
253
254/**
255 * Strip debug info in the module if it exists.
256 * To do this, we remove all calls to the debugger intrinsics and any named
257 * metadata for debugging. We also remove debug locations for instructions.
258 * Return true if module is modified.
259 */
261
262/**
263 * Construct a builder for a module, and do not allow for unresolved nodes
264 * attached to the module.
265 */
268
269/**
270 * Construct a builder for a module and collect unresolved nodes attached
271 * to the module in order to resolve cycles during a call to
272 * \c LLVMDIBuilderFinalize.
273 */
275
276/**
277 * Deallocates the \c DIBuilder and everything it owns.
278 * @note You must call \c LLVMDIBuilderFinalize before this
279 */
281
282/**
283 * Construct any deferred debug info descriptors.
284 */
286
287/**
288 * Finalize a specific subprogram.
289 * No new variables may be added to this subprogram afterwards.
290 */
292 LLVMMetadataRef Subprogram);
293
294/**
295 * A CompileUnit provides an anchor for all debugging
296 * information generated during this instance of compilation.
297 * \param Lang Source programming language, eg.
298 * \c LLVMDWARFSourceLanguageC99
299 * \param FileRef File info.
300 * \param Producer Identify the producer of debugging information
301 * and code. Usually this is a compiler
302 * version string.
303 * \param ProducerLen The length of the C string passed to \c Producer.
304 * \param isOptimized A boolean flag which indicates whether optimization
305 * is enabled or not.
306 * \param Flags This string lists command line options. This
307 * string is directly embedded in debug info
308 * output which may be used by a tool
309 * analyzing generated debugging information.
310 * \param FlagsLen The length of the C string passed to \c Flags.
311 * \param RuntimeVer This indicates runtime version for languages like
312 * Objective-C.
313 * \param SplitName The name of the file that we'll split debug info
314 * out into.
315 * \param SplitNameLen The length of the C string passed to \c SplitName.
316 * \param Kind The kind of debug information to generate.
317 * \param DWOId The DWOId if this is a split skeleton compile unit.
318 * \param SplitDebugInlining Whether to emit inline debug info.
319 * \param DebugInfoForProfiling Whether to emit extra debug info for
320 * profile collection.
321 * \param SysRoot The Clang system root (value of -isysroot).
322 * \param SysRootLen The length of the C string passed to \c SysRoot.
323 * \param SDK The SDK. On Darwin, the last component of the sysroot.
324 * \param SDKLen The length of the C string passed to \c SDK.
325 */
328 LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
329 LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
330 unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
331 LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
332 LLVMBool DebugInfoForProfiling, const char *SysRoot, size_t SysRootLen,
333 const char *SDK, size_t SDKLen);
334
335/**
336 * Create a file descriptor to hold debugging information for a file.
337 * \param Builder The \c DIBuilder.
338 * \param Filename File name.
339 * \param FilenameLen The length of the C string passed to \c Filename.
340 * \param Directory Directory.
341 * \param DirectoryLen The length of the C string passed to \c Directory.
342 */
344 const char *Filename,
345 size_t FilenameLen,
346 const char *Directory,
347 size_t DirectoryLen);
348
349/**
350 * Create a file descriptor to hold debugging information for a file.
351 * \param Builder The \c DIBuilder.
352 * \param Filename File name.
353 * \param FilenameLen The length of the C string passed to \c Filename.
354 * \param Directory Directory.
355 * \param DirectoryLen The length of the C string passed to \c Directory.
356 * \param ChecksumKind The kind of checksum. eg MD5, SHA256
357 * \param Checksum The checksum.
358 * \param ChecksumLen The length of the checksum.
359 * \param Souce The embedded source.
360 * \param SourceLen The length of the source.
361 */
363 LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen,
364 const char *Directory, size_t DirectoryLen, LLVMChecksumKind ChecksumKind,
365 const char *Checksum, size_t ChecksumLen, const char *Source,
366 size_t SourceLen);
367
368/**
369 * Creates a new descriptor for a module with the specified parent scope.
370 * \param Builder The \c DIBuilder.
371 * \param ParentScope The parent scope containing this module declaration.
372 * \param Name Module name.
373 * \param NameLen The length of the C string passed to \c Name.
374 * \param ConfigMacros A space-separated shell-quoted list of -D macro
375 definitions as they would appear on a command line.
376 * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
377 * \param IncludePath The path to the module map file.
378 * \param IncludePathLen The length of the C string passed to \c IncludePath.
379 * \param APINotesFile The path to an API notes file for the module.
380 * \param APINotesFileLen The length of the C string passed to \c APINotestFile.
381 */
383 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name,
384 size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen,
385 const char *IncludePath, size_t IncludePathLen, const char *APINotesFile,
386 size_t APINotesFileLen);
387
388/**
389 * Creates a new descriptor for a namespace with the specified parent scope.
390 * \param Builder The \c DIBuilder.
391 * \param ParentScope The parent scope containing this module declaration.
392 * \param Name NameSpace name.
393 * \param NameLen The length of the C string passed to \c Name.
394 * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
395 * this is true of C++ inline namespaces.
396 */
398 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name,
399 size_t NameLen, LLVMBool ExportSymbols);
400
401/**
402 * Create a new descriptor for the specified subprogram.
403 * \param Builder The \c DIBuilder.
404 * \param Scope Function scope.
405 * \param Name Function name.
406 * \param NameLen Length of enumeration name.
407 * \param LinkageName Mangled function name.
408 * \param LinkageNameLen Length of linkage name.
409 * \param File File where this variable is defined.
410 * \param LineNo Line number.
411 * \param Ty Function type.
412 * \param IsLocalToUnit True if this function is not externally visible.
413 * \param IsDefinition True if this is a function definition.
414 * \param ScopeLine Set to the beginning of the scope this starts
415 * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
416 * used to emit dwarf attributes.
417 * \param IsOptimized True if optimization is ON.
418 */
420 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
421 size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
422 LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
423 LLVMBool IsLocalToUnit, LLVMBool IsDefinition, unsigned ScopeLine,
424 LLVMDIFlags Flags, LLVMBool IsOptimized);
425
426/**
427 * Create a descriptor for a lexical block with the specified parent context.
428 * \param Builder The \c DIBuilder.
429 * \param Scope Parent lexical block.
430 * \param File Source file.
431 * \param Line The line in the source file.
432 * \param Column The column in the source file.
433 */
436 unsigned Line, unsigned Column);
437
438/**
439 * Create a descriptor for a lexical block with a new file attached.
440 * \param Builder The \c DIBuilder.
441 * \param Scope Lexical block.
442 * \param File Source file.
443 * \param Discriminator DWARF path discriminator value.
444 */
447 unsigned Discriminator);
448
449/**
450 * Create a descriptor for an imported namespace. Suitable for e.g. C++
451 * using declarations.
452 * \param Builder The \c DIBuilder.
453 * \param Scope The scope this module is imported into
454 * \param File File where the declaration is located.
455 * \param Line Line number of the declaration.
456 */
459 LLVMMetadataRef File, unsigned Line);
460
461/**
462 * Create a descriptor for an imported module that aliases another
463 * imported entity descriptor.
464 * \param Builder The \c DIBuilder.
465 * \param Scope The scope this module is imported into
466 * \param ImportedEntity Previous imported entity to alias.
467 * \param File File where the declaration is located.
468 * \param Line Line number of the declaration.
469 * \param Elements Renamed elements.
470 * \param NumElements Number of renamed elements.
471 */
473 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
474 LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line,
475 LLVMMetadataRef *Elements, unsigned NumElements);
476
477/**
478 * Create a descriptor for an imported module.
479 * \param Builder The \c DIBuilder.
480 * \param Scope The scope this module is imported into
481 * \param M The module being imported here
482 * \param File File where the declaration is located.
483 * \param Line Line number of the declaration.
484 * \param Elements Renamed elements.
485 * \param NumElements Number of renamed elements.
486 */
489 LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements,
490 unsigned NumElements);
491
492/**
493 * Create a descriptor for an imported function, type, or variable. Suitable
494 * for e.g. FORTRAN-style USE declarations.
495 * \param Builder The DIBuilder.
496 * \param Scope The scope this module is imported into.
497 * \param Decl The declaration (or definition) of a function, type,
498 or variable.
499 * \param File File where the declaration is located.
500 * \param Line Line number of the declaration.
501 * \param Name A name that uniquely identifies this imported
502 declaration.
503 * \param NameLen The length of the C string passed to \c Name.
504 * \param Elements Renamed elements.
505 * \param NumElements Number of renamed elements.
506 */
509 LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen,
510 LLVMMetadataRef *Elements, unsigned NumElements);
511
512/**
513 * Creates a new DebugLocation that describes a source location.
514 * \param Line The line in the source file.
515 * \param Column The column in the source file.
516 * \param Scope The scope in which the location resides.
517 * \param InlinedAt The scope where this location was inlined, if at all.
518 * (optional).
519 * \note If the item to which this location is attached cannot be
520 * attributed to a source line, pass 0 for the line and column.
521 */
523 LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope,
524 LLVMMetadataRef InlinedAt);
525
526/**
527 * Get the line number of this debug location.
528 * \param Location The debug location.
529 *
530 * @see DILocation::getLine()
531 */
533
534/**
535 * Get the column number of this debug location.
536 * \param Location The debug location.
537 *
538 * @see DILocation::getColumn()
539 */
541
542/**
543 * Get the local scope associated with this debug location.
544 * \param Location The debug location.
545 *
546 * @see DILocation::getScope()
547 */
549
550/**
551 * Get the "inline at" location associated with this debug location.
552 * \param Location The debug location.
553 *
554 * @see DILocation::getInlinedAt()
555 */
557
558/**
559 * Get the metadata of the file associated with a given scope.
560 * \param Scope The scope object.
561 *
562 * @see DIScope::getFile()
563 */
565
566/**
567 * Get the directory of a given file.
568 * \param File The file object.
569 * \param Len The length of the returned string.
570 *
571 * @see DIFile::getDirectory()
572 */
574 unsigned *Len);
575
576/**
577 * Get the name of a given file.
578 * \param File The file object.
579 * \param Len The length of the returned string.
580 *
581 * @see DIFile::getFilename()
582 */
584 unsigned *Len);
585
586/**
587 * Get the source of a given file.
588 * \param File The file object.
589 * \param Len The length of the returned string.
590 *
591 * @see DIFile::getSource()
592 */
593LLVM_C_ABI const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
594
595/**
596 * Create a type array.
597 * \param Builder The DIBuilder.
598 * \param Data The type elements.
599 * \param NumElements Number of type elements.
600 */
602 LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements);
603
604/**
605 * Create subroutine type.
606 * \param Builder The DIBuilder.
607 * \param File The file in which the subroutine resides.
608 * \param ParameterTypes An array of subroutine parameter types. This
609 * includes return type at 0th index.
610 * \param NumParameterTypes The number of parameter types in \c ParameterTypes
611 * \param Flags E.g.: \c LLVMDIFlagLValueReference.
612 * These flags are used to emit dwarf attributes.
613 */
615 LLVMDIBuilderRef Builder, LLVMMetadataRef File,
616 LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes,
617 LLVMDIFlags Flags);
618
619/**
620 * Create debugging information entry for a macro.
621 * @param Builder The DIBuilder.
622 * @param ParentMacroFile Macro parent (could be NULL).
623 * @param Line Source line number where the macro is defined.
624 * @param RecordType DW_MACINFO_define or DW_MACINFO_undef.
625 * @param Name Macro name.
626 * @param NameLen Macro name length.
627 * @param Value Macro value.
628 * @param ValueLen Macro value length.
629 */
631 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line,
632 LLVMDWARFMacinfoRecordType RecordType, const char *Name, size_t NameLen,
633 const char *Value, size_t ValueLen);
634
635/**
636 * Create debugging information temporary entry for a macro file.
637 * List of macro node direct children will be calculated by DIBuilder,
638 * using the \p ParentMacroFile relationship.
639 * @param Builder The DIBuilder.
640 * @param ParentMacroFile Macro parent (could be NULL).
641 * @param Line Source line number where the macro file is included.
642 * @param File File descriptor containing the name of the macro file.
643 */
645 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line,
646 LLVMMetadataRef File);
647
648/**
649 * Create debugging information entry for an enumerator.
650 * @param Builder The DIBuilder.
651 * @param Name Enumerator name.
652 * @param NameLen Length of enumerator name.
653 * @param Value Enumerator value.
654 * @param IsUnsigned True if the value is unsigned.
655 */
657 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value,
658 LLVMBool IsUnsigned);
659
660/**
661 * Create debugging information entry for an enumerator of arbitrary precision.
662 * @param Builder The DIBuilder.
663 * @param Name Enumerator name.
664 * @param NameLen Length of enumerator name.
665 * @param SizeInBits Number of bits of the value.
666 * @param Words The words that make up the value.
667 * @param IsUnsigned True if the value is unsigned.
668 */
670 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
671 uint64_t SizeInBits, const uint64_t Words[], LLVMBool IsUnsigned);
672
673/**
674 * Create debugging information entry for an enumeration.
675 * \param Builder The DIBuilder.
676 * \param Scope Scope in which this enumeration is defined.
677 * \param Name Enumeration name.
678 * \param NameLen Length of enumeration name.
679 * \param File File where this member is defined.
680 * \param LineNumber Line number.
681 * \param SizeInBits Member size.
682 * \param AlignInBits Member alignment.
683 * \param Elements Enumeration elements.
684 * \param NumElements Number of enumeration elements.
685 * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
686 */
688 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
689 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
690 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
691 unsigned NumElements, LLVMMetadataRef ClassTy);
692
693/**
694 * Create debugging information entry for a union.
695 * \param Builder The DIBuilder.
696 * \param Scope Scope in which this union is defined.
697 * \param Name Union name.
698 * \param NameLen Length of union name.
699 * \param File File where this member is defined.
700 * \param LineNumber Line number.
701 * \param SizeInBits Member size.
702 * \param AlignInBits Member alignment.
703 * \param Flags Flags to encode member attribute, e.g. private
704 * \param Elements Union elements.
705 * \param NumElements Number of union elements.
706 * \param RunTimeLang Optional parameter, Objective-C runtime version.
707 * \param UniqueId A unique identifier for the union.
708 * \param UniqueIdLen Length of unique identifier.
709 */
711 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
712 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
713 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
714 LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
715 const char *UniqueId, size_t UniqueIdLen);
716
717/**
718 * Create debugging information entry for an array.
719 * \param Builder The DIBuilder.
720 * \param Size Array size.
721 * \param AlignInBits Alignment.
722 * \param Ty Element type.
723 * \param Subscripts Subscripts.
724 * \param NumSubscripts Number of subscripts.
725 */
727 LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits,
728 LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts);
729
730/**
731 * Create debugging information entry for a set.
732 * \param Builder The DIBuilder.
733 * \param Scope The scope in which the set is defined.
734 * \param Name A name that uniquely identifies this set.
735 * \param NameLen The length of the C string passed to \c Name.
736 * \param File File where the set is located.
737 * \param Line Line number of the declaration.
738 * \param SizeInBits Set size.
739 * \param AlignInBits Set alignment.
740 * \param BaseTy The base type of the set.
741 */
743 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
744 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
745 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef BaseTy);
746
747/**
748 * Create a descriptor for a subrange with dynamic bounds.
749 * \param Builder The DIBuilder.
750 * \param Scope The scope in which the subrange is defined.
751 * \param Name A name that uniquely identifies this subrange.
752 * \param NameLen The length of the C string passed to \c Name.
753 * \param LineNo Line number.
754 * \param File File where the subrange is located.
755 * \param SizeInBits Member size.
756 * \param AlignInBits Member alignment.
757 * \param Flags Flags.
758 * \param BaseTy The base type of the subrange. eg integer or enumeration
759 * \param LowerBound Lower bound of the subrange.
760 * \param UpperBound Upper bound of the subrange.
761 * \param Stride Stride of the subrange.
762 * \param Bias Bias of the subrange.
763 */
765 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
766 size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t SizeInBits,
767 uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef BaseTy,
768 LLVMMetadataRef LowerBound, LLVMMetadataRef UpperBound,
769 LLVMMetadataRef Stride, LLVMMetadataRef Bias);
770
771/**
772 * Create debugging information entry for a dynamic array.
773 * \param Builder The DIBuilder.
774 * \param Size Array size.
775 * \param AlignInBits Alignment.
776 * \param Ty Element type.
777 * \param Subscripts Subscripts.
778 * \param NumSubscripts Number of subscripts.
779 * \param DataLocation DataLocation. (DIVariable, DIExpression or NULL)
780 * \param Associated Associated. (DIVariable, DIExpression or NULL)
781 * \param Allocated Allocated. (DIVariable, DIExpression or NULL)
782 * \param Rank Rank. (DIVariable, DIExpression or NULL)
783 * \param BitStride BitStride.
784 */
786 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
787 size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t Size,
788 uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts,
789 unsigned NumSubscripts, LLVMMetadataRef DataLocation,
790 LLVMMetadataRef Associated, LLVMMetadataRef Allocated, LLVMMetadataRef Rank,
791 LLVMMetadataRef BitStride);
792
793/**
794 * Replace arrays.
795 *
796 * @see DIBuilder::replaceArrays()
797 */
799 LLVMMetadataRef *Elements,
800 unsigned NumElements);
801
802/**
803 * Create debugging information entry for a vector type.
804 * \param Builder The DIBuilder.
805 * \param Size Vector size.
806 * \param AlignInBits Alignment.
807 * \param Ty Element type.
808 * \param Subscripts Subscripts.
809 * \param NumSubscripts Number of subscripts.
810 */
812 LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits,
813 LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts);
814
815/**
816 * Create a DWARF unspecified type.
817 * \param Builder The DIBuilder.
818 * \param Name The unspecified type's name.
819 * \param NameLen Length of type name.
820 */
822 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen);
823
824/**
825 * Create debugging information entry for a basic
826 * type.
827 * \param Builder The DIBuilder.
828 * \param Name Type name.
829 * \param NameLen Length of type name.
830 * \param SizeInBits Size of the type.
831 * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
832 * \param Flags Flags to encode optional attribute like endianity
833 */
835 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
836 uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, LLVMDIFlags Flags);
837
838/**
839 * Create debugging information entry for a pointer.
840 * \param Builder The DIBuilder.
841 * \param PointeeTy Type pointed by this pointer.
842 * \param SizeInBits Size.
843 * \param AlignInBits Alignment. (optional, pass 0 to ignore)
844 * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
845 * \param Name Pointer type name. (optional)
846 * \param NameLen Length of pointer type name. (optional)
847 */
849 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits,
850 uint32_t AlignInBits, unsigned AddressSpace, const char *Name,
851 size_t NameLen);
852
853/**
854 * Create debugging information entry for a struct.
855 * \param Builder The DIBuilder.
856 * \param Scope Scope in which this struct is defined.
857 * \param Name Struct name.
858 * \param NameLen Struct name length.
859 * \param File File where this member is defined.
860 * \param LineNumber Line number.
861 * \param SizeInBits Member size.
862 * \param AlignInBits Member alignment.
863 * \param Flags Flags to encode member attribute, e.g. private
864 * \param Elements Struct elements.
865 * \param NumElements Number of struct elements.
866 * \param RunTimeLang Optional parameter, Objective-C runtime version.
867 * \param VTableHolder The object containing the vtable for the struct.
868 * \param UniqueId A unique identifier for the struct.
869 * \param UniqueIdLen Length of the unique identifier for the struct.
870 */
872 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
873 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
874 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
875 LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
876 unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
877 const char *UniqueId, size_t UniqueIdLen);
878
879/**
880 * Create debugging information entry for a member.
881 * \param Builder The DIBuilder.
882 * \param Scope Member scope.
883 * \param Name Member name.
884 * \param NameLen Length of member name.
885 * \param File File where this member is defined.
886 * \param LineNo Line number.
887 * \param SizeInBits Member size.
888 * \param AlignInBits Member alignment.
889 * \param OffsetInBits Member offset.
890 * \param Flags Flags to encode member attribute, e.g. private
891 * \param Ty Parent type.
892 */
894 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
895 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
896 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
897 LLVMMetadataRef Ty);
898
899/**
900 * Create debugging information entry for a
901 * C++ static data member.
902 * \param Builder The DIBuilder.
903 * \param Scope Member scope.
904 * \param Name Member name.
905 * \param NameLen Length of member name.
906 * \param File File where this member is declared.
907 * \param LineNumber Line number.
908 * \param Type Type of the static member.
909 * \param Flags Flags to encode member attribute, e.g. private.
910 * \param ConstantVal Const initializer of the member.
911 * \param AlignInBits Member alignment.
912 */
914 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
915 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
916 LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
917 uint32_t AlignInBits);
918
919/**
920 * Create debugging information entry for a pointer to member.
921 * \param Builder The DIBuilder.
922 * \param PointeeType Type pointed to by this pointer.
923 * \param ClassType Type for which this pointer points to members of.
924 * \param SizeInBits Size.
925 * \param AlignInBits Alignment.
926 * \param Flags Flags.
927 */
929 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType,
930 LLVMMetadataRef ClassType, uint64_t SizeInBits, uint32_t AlignInBits,
931 LLVMDIFlags Flags);
932/**
933 * Create debugging information entry for Objective-C instance variable.
934 * \param Builder The DIBuilder.
935 * \param Name Member name.
936 * \param NameLen The length of the C string passed to \c Name.
937 * \param File File where this member is defined.
938 * \param LineNo Line number.
939 * \param SizeInBits Member size.
940 * \param AlignInBits Member alignment.
941 * \param OffsetInBits Member offset.
942 * \param Flags Flags to encode member attribute, e.g. private
943 * \param Ty Parent type.
944 * \param PropertyNode Property associated with this ivar.
945 */
947 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
948 LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
949 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
950 LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
951
952/**
953 * Create debugging information entry for Objective-C property.
954 * \param Builder The DIBuilder.
955 * \param Name Property name.
956 * \param NameLen The length of the C string passed to \c Name.
957 * \param File File where this property is defined.
958 * \param LineNo Line number.
959 * \param GetterName Name of the Objective C property getter selector.
960 * \param GetterNameLen The length of the C string passed to \c GetterName.
961 * \param SetterName Name of the Objective C property setter selector.
962 * \param SetterNameLen The length of the C string passed to \c SetterName.
963 * \param PropertyAttributes Objective C property attributes.
964 * \param Ty Type.
965 */
967 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
968 LLVMMetadataRef File, unsigned LineNo, const char *GetterName,
969 size_t GetterNameLen, const char *SetterName, size_t SetterNameLen,
970 unsigned PropertyAttributes, LLVMMetadataRef Ty);
971
972/**
973 * Create a uniqued DIType* clone with FlagObjectPointer. If \c Implicit
974 * is true, then also set FlagArtificial.
975 * \param Builder The DIBuilder.
976 * \param Type The underlying type to which this pointer points.
977 * \param Implicit Indicates whether this pointer was implicitly generated
978 * (i.e., not spelled out in source).
979 */
981 LLVMDIBuilderRef Builder, LLVMMetadataRef Type, LLVMBool Implicit);
982
983/**
984 * Create debugging information entry for a qualified
985 * type, e.g. 'const int'.
986 * \param Builder The DIBuilder.
987 * \param Tag Tag identifying type,
988 * e.g. LLVMDWARFTypeQualifier_volatile_type
989 * \param Type Base Type.
990 */
992 LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type);
993
994/**
995 * Create debugging information entry for a c++
996 * style reference or rvalue reference type.
997 * \param Builder The DIBuilder.
998 * \param Tag Tag identifying type,
999 * \param Type Base Type.
1000 */
1002 LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type);
1003
1004/**
1005 * Create C++11 nullptr type.
1006 * \param Builder The DIBuilder.
1007 */
1010
1011/**
1012 * Create debugging information entry for a typedef.
1013 * \param Builder The DIBuilder.
1014 * \param Type Original type.
1015 * \param Name Typedef name.
1016 * \param File File where this type is defined.
1017 * \param LineNo Line number.
1018 * \param Scope The surrounding context for the typedef.
1019 */
1021 LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name,
1022 size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
1023 LLVMMetadataRef Scope, uint32_t AlignInBits);
1024
1025/**
1026 * Create debugging information entry to establish inheritance relationship
1027 * between two types.
1028 * \param Builder The DIBuilder.
1029 * \param Ty Original type.
1030 * \param BaseTy Base type. Ty is inherits from base.
1031 * \param BaseOffset Base offset.
1032 * \param VBPtrOffset Virtual base pointer offset.
1033 * \param Flags Flags to describe inheritance attribute, e.g. private
1034 */
1037 uint64_t BaseOffset, uint32_t VBPtrOffset, LLVMDIFlags Flags);
1038
1039/**
1040 * Create a permanent forward-declared type.
1041 * \param Builder The DIBuilder.
1042 * \param Tag A unique tag for this type.
1043 * \param Name Type name.
1044 * \param NameLen Length of type name.
1045 * \param Scope Type scope.
1046 * \param File File where this type is defined.
1047 * \param Line Line number where this type is defined.
1048 * \param RuntimeLang Indicates runtime version for languages like
1049 * Objective-C.
1050 * \param SizeInBits Member size.
1051 * \param AlignInBits Member alignment.
1052 * \param UniqueIdentifier A unique identifier for the type.
1053 * \param UniqueIdentifierLen Length of the unique identifier.
1054 */
1056 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen,
1057 LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
1058 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
1059 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
1060
1061/**
1062 * Create a temporary forward-declared type.
1063 * \param Builder The DIBuilder.
1064 * \param Tag A unique tag for this type.
1065 * \param Name Type name.
1066 * \param NameLen Length of type name.
1067 * \param Scope Type scope.
1068 * \param File File where this type is defined.
1069 * \param Line Line number where this type is defined.
1070 * \param RuntimeLang Indicates runtime version for languages like
1071 * Objective-C.
1072 * \param SizeInBits Member size.
1073 * \param AlignInBits Member alignment.
1074 * \param Flags Flags.
1075 * \param UniqueIdentifier A unique identifier for the type.
1076 * \param UniqueIdentifierLen Length of the unique identifier.
1077 */
1079 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen,
1080 LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
1081 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
1082 LLVMDIFlags Flags, const char *UniqueIdentifier,
1083 size_t UniqueIdentifierLen);
1084
1085/**
1086 * Create debugging information entry for a bit field member.
1087 * \param Builder The DIBuilder.
1088 * \param Scope Member scope.
1089 * \param Name Member name.
1090 * \param NameLen Length of member name.
1091 * \param File File where this member is defined.
1092 * \param LineNumber Line number.
1093 * \param SizeInBits Member size.
1094 * \param OffsetInBits Member offset.
1095 * \param StorageOffsetInBits Member storage offset.
1096 * \param Flags Flags to encode member attribute.
1097 * \param Type Parent type.
1098 */
1100 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1101 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
1102 uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits,
1103 LLVMDIFlags Flags, LLVMMetadataRef Type);
1104
1105/**
1106 * Create debugging information entry for a class.
1107 * \param Scope Scope in which this class is defined.
1108 * \param Name Class name.
1109 * \param NameLen The length of the C string passed to \c Name.
1110 * \param File File where this member is defined.
1111 * \param LineNumber Line number.
1112 * \param SizeInBits Member size.
1113 * \param AlignInBits Member alignment.
1114 * \param OffsetInBits Member offset.
1115 * \param Flags Flags to encode member attribute, e.g. private.
1116 * \param DerivedFrom Debug info of the base class of this type.
1117 * \param Elements Class members.
1118 * \param NumElements Number of class elements.
1119 * \param VTableHolder Debug info of the base class that contains vtable
1120 * for this type. This is used in
1121 * DW_AT_containing_type. See DWARF documentation
1122 * for more info.
1123 * \param TemplateParamsNode Template type parameters.
1124 * \param UniqueIdentifier A unique identifier for the type.
1125 * \param UniqueIdentifierLen Length of the unique identifier.
1126 */
1128 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1129 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
1130 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1131 LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
1132 unsigned NumElements, LLVMMetadataRef VTableHolder,
1133 LLVMMetadataRef TemplateParamsNode, const char *UniqueIdentifier,
1134 size_t UniqueIdentifierLen);
1135
1136/**
1137 * Create a uniqued DIType* clone with FlagArtificial set.
1138 * \param Builder The DIBuilder.
1139 * \param Type The underlying type.
1140 */
1142 LLVMDIBuilderRef Builder, LLVMMetadataRef Type);
1143
1144/**
1145 * Get the name of this DIType.
1146 * \param DType The DIType.
1147 * \param Length The length of the returned string.
1148 *
1149 * @see DIType::getName()
1150 */
1151LLVM_C_ABI const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
1152
1153/**
1154 * Get the size of this DIType in bits.
1155 * \param DType The DIType.
1156 *
1157 * @see DIType::getSizeInBits()
1158 */
1160
1161/**
1162 * Get the offset of this DIType in bits.
1163 * \param DType The DIType.
1164 *
1165 * @see DIType::getOffsetInBits()
1166 */
1168
1169/**
1170 * Get the alignment of this DIType in bits.
1171 * \param DType The DIType.
1172 *
1173 * @see DIType::getAlignInBits()
1174 */
1176
1177/**
1178 * Get the source line where this DIType is declared.
1179 * \param DType The DIType.
1180 *
1181 * @see DIType::getLine()
1182 */
1184
1185/**
1186 * Get the flags associated with this DIType.
1187 * \param DType The DIType.
1188 *
1189 * @see DIType::getFlags()
1190 */
1192
1193/**
1194 * Create a descriptor for a value range.
1195 * \param Builder The DIBuilder.
1196 * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
1197 * \param Count Count of elements in the subrange.
1198 */
1200 LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count);
1201
1202/**
1203 * Create an array of DI Nodes.
1204 * \param Builder The DIBuilder.
1205 * \param Data The DI Node elements.
1206 * \param NumElements Number of DI Node elements.
1207 */
1209 LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements);
1210
1211/**
1212 * Create a new descriptor for the specified variable which has a complex
1213 * address expression for its address.
1214 * \param Builder The DIBuilder.
1215 * \param Addr An array of complex address operations.
1216 * \param Length Length of the address operation array.
1217 */
1219 LLVMDIBuilderRef Builder, uint64_t *Addr, size_t Length);
1220
1221/**
1222 * Create a new descriptor for the specified variable that does not have an
1223 * address, but does have a constant value.
1224 * \param Builder The DIBuilder.
1225 * \param Value The constant value.
1226 */
1228 LLVMDIBuilderRef Builder, uint64_t Value);
1229
1230/**
1231 * Create a new descriptor for the specified variable.
1232 * \param Scope Variable scope.
1233 * \param Name Name of the variable.
1234 * \param NameLen The length of the C string passed to \c Name.
1235 * \param Linkage Mangled name of the variable.
1236 * \param LinkLen The length of the C string passed to \c Linkage.
1237 * \param File File where this variable is defined.
1238 * \param LineNo Line number.
1239 * \param Ty Variable Type.
1240 * \param LocalToUnit Boolean flag indicate whether this variable is
1241 * externally visible or not.
1242 * \param Expr The location of the global relative to the attached
1243 * GlobalVariable.
1244 * \param Decl Reference to the corresponding declaration.
1245 * variables.
1246 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1247 * specified)
1248 */
1250 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1251 size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
1252 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1253 LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
1254
1255/**
1256 * Get the dwarf::Tag of a DINode
1257 */
1259
1260/**
1261 * Retrieves the \c DIVariable associated with this global variable expression.
1262 * \param GVE The global variable expression.
1263 *
1264 * @see llvm::DIGlobalVariableExpression::getVariable()
1265 */
1268
1269/**
1270 * Retrieves the \c DIExpression associated with this global variable expression.
1271 * \param GVE The global variable expression.
1272 *
1273 * @see llvm::DIGlobalVariableExpression::getExpression()
1274 */
1277
1278/**
1279 * Get the metadata of the file associated with a given variable.
1280 * \param Var The variable object.
1281 *
1282 * @see DIVariable::getFile()
1283 */
1285
1286/**
1287 * Get the metadata of the scope associated with a given variable.
1288 * \param Var The variable object.
1289 *
1290 * @see DIVariable::getScope()
1291 */
1293
1294/**
1295 * Get the source line where this \c DIVariable is declared.
1296 * \param Var The DIVariable.
1297 *
1298 * @see DIVariable::getLine()
1299 */
1301
1302/**
1303 * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
1304 * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
1305 * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
1306 * \param Ctx The context in which to construct the temporary node.
1307 * \param Data The metadata elements.
1308 * \param NumElements Number of metadata elements.
1309 */
1311 LLVMMetadataRef *Data,
1312 size_t NumElements);
1313
1314/**
1315 * Deallocate a temporary node.
1316 *
1317 * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1318 * references will be reset.
1319 * \param TempNode The temporary metadata node.
1320 */
1322
1323/**
1324 * Replace all uses of temporary metadata.
1325 * \param TempTargetMetadata The temporary metadata node.
1326 * \param Replacement The replacement metadata node.
1327 */
1328LLVM_C_ABI void
1330 LLVMMetadataRef Replacement);
1331
1332/**
1333 * Create a new descriptor for the specified global variable that is temporary
1334 * and meant to be RAUWed.
1335 * \param Scope Variable scope.
1336 * \param Name Name of the variable.
1337 * \param NameLen The length of the C string passed to \c Name.
1338 * \param Linkage Mangled name of the variable.
1339 * \param LnkLen The length of the C string passed to \c Linkage.
1340 * \param File File where this variable is defined.
1341 * \param LineNo Line number.
1342 * \param Ty Variable Type.
1343 * \param LocalToUnit Boolean flag indicate whether this variable is
1344 * externally visible or not.
1345 * \param Decl Reference to the corresponding declaration.
1346 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1347 * specified)
1348 */
1350 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1351 size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
1352 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1353 LLVMMetadataRef Decl, uint32_t AlignInBits);
1354
1355/**
1356 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1357 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1358 *
1359 * The debug format can be switched later after inserting the records using
1360 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1361 *
1362 * Insert a Declare DbgRecord before the given instruction.
1363 * \param Builder The DIBuilder.
1364 * \param Storage The storage of the variable to declare.
1365 * \param VarInfo The variable's debug info descriptor.
1366 * \param Expr A complex location expression for the variable.
1367 * \param DebugLoc Debug info location.
1368 * \param Instr Instruction acting as a location for the new record.
1369 */
1371 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1372 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1373
1374/**
1375 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1376 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1377 *
1378 * The debug format can be switched later after inserting the records using
1379 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1380 *
1381 * Insert a Declare DbgRecord at the end of the given basic block. If the basic
1382 * block has a terminator instruction, the record is inserted before that
1383 * terminator instruction.
1384 * \param Builder The DIBuilder.
1385 * \param Storage The storage of the variable to declare.
1386 * \param VarInfo The variable's debug info descriptor.
1387 * \param Expr A complex location expression for the variable.
1388 * \param DebugLoc Debug info location.
1389 * \param Block Basic block acting as a location for the new record.
1390 */
1392 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1393 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1394
1395/**
1396 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1397 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1398 *
1399 * The debug format can be switched later after inserting the records using
1400 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1401 *
1402 * Insert a new debug record before the given instruction.
1403 * \param Builder The DIBuilder.
1404 * \param Val The value of the variable.
1405 * \param VarInfo The variable's debug info descriptor.
1406 * \param Expr A complex location expression for the variable.
1407 * \param DebugLoc Debug info location.
1408 * \param Instr Instruction acting as a location for the new record.
1409 */
1411 LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
1412 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1413
1414/**
1415 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1416 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1417 *
1418 * The debug format can be switched later after inserting the records using
1419 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1420 *
1421 * Insert a new debug record at the end of the given basic block. If the
1422 * basic block has a terminator instruction, the record is inserted before
1423 * that terminator instruction.
1424 * \param Builder The DIBuilder.
1425 * \param Val The value of the variable.
1426 * \param VarInfo The variable's debug info descriptor.
1427 * \param Expr A complex location expression for the variable.
1428 * \param DebugLoc Debug info location.
1429 * \param Block Basic block acting as a location for the new record.
1430 */
1432 LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
1433 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1434
1435/**
1436 * Create a new descriptor for a local auto variable.
1437 * \param Builder The DIBuilder.
1438 * \param Scope The local scope the variable is declared in.
1439 * \param Name Variable name.
1440 * \param NameLen Length of variable name.
1441 * \param File File where this variable is defined.
1442 * \param LineNo Line number.
1443 * \param Ty Metadata describing the type of the variable.
1444 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1445 * \param Flags Flags.
1446 * \param AlignInBits Variable alignment.
1447 */
1449 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1450 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1451 LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1452
1453/**
1454 * Create a new descriptor for a function parameter variable.
1455 * \param Builder The DIBuilder.
1456 * \param Scope The local scope the variable is declared in.
1457 * \param Name Variable name.
1458 * \param NameLen Length of variable name.
1459 * \param ArgNo Unique argument number for this variable; starts at 1.
1460 * \param File File where this variable is defined.
1461 * \param LineNo Line number.
1462 * \param Ty Metadata describing the type of the variable.
1463 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1464 * \param Flags Flags.
1465 */
1467 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1468 size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1469 LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1470
1471/**
1472 * Get the metadata of the subprogram attached to a function.
1473 *
1474 * @see llvm::Function::getSubprogram()
1475 */
1477
1478/**
1479 * Set the subprogram attached to a function.
1480 *
1481 * @see llvm::Function::setSubprogram()
1482 */
1484
1485/**
1486 * Get the line associated with a given subprogram.
1487 * \param Subprogram The subprogram object.
1488 *
1489 * @see DISubprogram::getLine()
1490 */
1492
1493/**
1494 * Replace the subprogram subroutine type.
1495 * \param Subprogram The subprogram object.
1496 * \param SubroutineType The new subroutine type.
1497 *
1498 * @see DISubprogram::replaceType()
1499 */
1501 LLVMMetadataRef SubroutineType);
1502
1503/**
1504 * Get the debug location for the given instruction.
1505 *
1506 * @see llvm::Instruction::getDebugLoc()
1507 */
1509
1510/**
1511 * Set the debug location for the given instruction.
1512 *
1513 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
1514 *
1515 * @see llvm::Instruction::setDebugLoc()
1516 */
1518 LLVMMetadataRef Loc);
1519
1520/**
1521 * Create a new descriptor for a label
1522 *
1523 * \param Builder The DIBuilder.
1524 * \param Scope The scope to create the label in.
1525 * \param Name Variable name.
1526 * \param NameLen Length of variable name.
1527 * \param File The file to create the label in.
1528 * \param LineNo Line Number.
1529 * \param AlwaysPreserve Preserve the label regardless of optimization.
1530 *
1531 * @see llvm::DIBuilder::createLabel()
1532 */
1535 const char *Name, size_t NameLen, LLVMMetadataRef File,
1536 unsigned LineNo, LLVMBool AlwaysPreserve);
1537
1538/**
1539 * Insert a new llvm.dbg.label intrinsic call
1540 *
1541 * \param Builder The DIBuilder.
1542 * \param LabelInfo The Label's debug info descriptor
1543 * \param Location The debug info location
1544 * \param InsertBefore Location for the new intrinsic.
1545 *
1546 * @see llvm::DIBuilder::insertLabel()
1547 */
1549 LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
1550 LLVMMetadataRef Location, LLVMValueRef InsertBefore);
1551
1552/**
1553 * Insert a new llvm.dbg.label intrinsic call
1554 *
1555 * \param Builder The DIBuilder.
1556 * \param LabelInfo The Label's debug info descriptor
1557 * \param Location The debug info location
1558 * \param InsertAtEnd Location for the new intrinsic.
1559 *
1560 * @see llvm::DIBuilder::insertLabel()
1561 */
1563 LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
1564 LLVMMetadataRef Location, LLVMBasicBlockRef InsertAtEnd);
1565
1566/**
1567 * Obtain the enumerated type of a Metadata instance.
1568 *
1569 * @see llvm::Metadata::getMetadataID()
1570 */
1572
1573/**
1574 * @}
1575 */
1576
1578
1579#endif
unsigned uint64_t
DXIL Finalize Linkage
dxil translate DXIL Translate Metadata
#define LLVM_C_EXTERN_C_BEGIN
Definition ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition ExternC.h:36
Machine Check Debug Module
#define T
static constexpr StringLiteral Filename
FunctionLoweringInfo::StatepointRelocationRecord RecordType
#define LLVM_C_ABI
LLVM_C_ABI is the export/visibility macro used to mark symbols declared in llvm-c as exported when bu...
Definition Visibility.h:40
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl, LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen, LLVMMetadataRef *Elements, unsigned NumElements)
Create a descriptor for an imported function, type, or variable.
LLVM_C_ABI LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location)
Get the "inline at" location associated with this debug location.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for an array.
LLVM_C_ABI unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram)
Get the line associated with a given subprogram.
LLVM_C_ABI LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location)
Get the local scope associated with this debug location.
LLVM_C_ABI unsigned LLVMDITypeGetLine(LLVMMetadataRef DType)
Get the source line where this DIType is declared.
LLVMDWARFMacinfoRecordType
Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro.
Definition DebugInfo.h:236
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value, LLVMBool IsUnsigned)
Create debugging information entry for an enumerator.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, uint64_t Value)
Create a new descriptor for the specified variable that does not have an address, but does have a con...
LLVM_C_ABI void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder)
Construct any deferred debug info descriptors.
LLVM_C_ABI void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP)
Set the subprogram attached to a function.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateSetType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef BaseTy)
Create debugging information entry for a set.
LLVM_C_ABI void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder, LLVMMetadataRef Subprogram)
Finalize a specific subprogram.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMDWARFMacinfoRecordType RecordType, const char *Name, size_t NameLen, const char *Value, size_t ValueLen)
Create debugging information entry for a macro.
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
Create a DWARF unspecified type.
LLVM_C_ABI LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M)
Construct a builder for a module, and do not allow for unresolved nodes attached to the module.
LLVM_C_ABI LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t NumElements)
Create a new temporary MDNode.
LLVM_C_ABI LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope)
Get the metadata of the file associated with a given scope.
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
LLVM_C_ABI LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M)
Construct a builder for a module and collect unresolved nodes attached to the module in order to reso...
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateLabel(LLVMDIBuilderRef Builder, LLVMMetadataRef Context, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMBool AlwaysPreserve)
Create a new descriptor for a label.
LLVM_C_ABI const char * LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len)
Get the source of a given file.
LLVM_C_ABI unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location)
Get the column number of this debug location.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, uint64_t *Addr, size_t Length)
Create a new descriptor for the specified variable which has a complex address expression for its add...
LLVM_C_ABI const char * LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len)
Get the name of a given file.
LLVM_C_ABI LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func)
Get the metadata of the subprogram attached to a function.
LLVMDWARFSourceLanguage
Source languages known by DWARF.
Definition DebugInfo.h:79
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertLabelAtEnd(LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo, LLVMMetadataRef Location, LLVMBasicBlockRef InsertAtEnd)
Insert a new llvm.dbg.label intrinsic call.
LLVM_C_ABI LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst)
Get the debug location for the given instruction.
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
LLVM_C_ABI void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder)
Deallocates the DIBuilder and everything it owns.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
LLVM_C_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE)
Retrieves the DIVariable associated with this global variable expression.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create an array of DI Nodes.
LLVM_C_ABI 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.
LLVM_C_ABI 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.
LLVM_C_ABI uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType)
Get the size of this DIType in bits.
LLVM_C_ABI void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata, LLVMMetadataRef Replacement)
Replace all uses of temporary metadata.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements)
Create a type array.
LLVM_C_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(LLVMMetadataRef GVE)
Retrieves the DIExpression associated with this global variable expression.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateFileWithChecksum(LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen, const char *Directory, size_t DirectoryLen, LLVMChecksumKind ChecksumKind, const char *Checksum, size_t ChecksumLen, const char *Source, size_t SourceLen)
Create a file descriptor to hold debugging information for a file.
LLVM_C_ABI 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.
LLVMDIFlags
Debug info flags.
Definition DebugInfo.h:35
LLVM_C_ABI 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.
LLVM_C_ABI unsigned LLVMDebugMetadataVersion(void)
The current debug metadata version number.
LLVM_C_ABI unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module)
The version of debug metadata that's present in the provided Module.
LLVM_C_ABI 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.
LLVM_C_ABI 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.
LLVM_C_ABI void LLVMDISubprogramReplaceType(LLVMMetadataRef Subprogram, LLVMMetadataRef SubroutineType)
Replace the subprogram subroutine type.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var)
Get the metadata of the scope associated with a given variable.
LLVM_C_ABI 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.
LLVM_C_ABI 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, const char *SysRoot, size_t SysRootLen, const char *SDK, size_t SDKLen)
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
LLVM_C_ABI 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.
LLVMChecksumKind
The kind of checksum to emit.
Definition DebugInfo.h:224
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements)
Create a descriptor for an imported module.
LLVM_C_ABI LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var)
Get the metadata of the file associated with a given variable.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count)
Create a descriptor for a value range.
LLVM_C_ABI unsigned LLVMDILocationGetLine(LLVMMetadataRef Location)
Get the line number of this debug location.
LLVM_C_ABI LLVMDbgRecordRef LLVMDIBuilderInsertLabelBefore(LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo, LLVMMetadataRef Location, LLVMValueRef InsertBefore)
Insert a new llvm.dbg.label intrinsic call.
LLVM_C_ABI unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var)
Get the source line where this DIVariable is declared.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a qualified type, e.g.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata)
Obtain the enumerated type of a Metadata instance.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateDynamicArrayType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts, LLVMMetadataRef DataLocation, LLVMMetadataRef Associated, LLVMMetadataRef Allocated, LLVMMetadataRef Rank, LLVMMetadataRef BitStride)
Create debugging information entry for a dynamic array.
LLVMDWARFEmissionKind
The amount of debug information to emit.
Definition DebugInfo.h:165
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateSubrangeType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef BaseTy, LLVMMetadataRef LowerBound, LLVMMetadataRef UpperBound, LLVMMetadataRef Stride, LLVMMetadataRef Bias)
Create a descriptor for a subrange with dynamic bounds.
LLVM_C_ABI 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.
LLVM_C_ABI const char * LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length)
Get the name of this DIType.
LLVM_C_ABI uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType)
Get the offset of this DIType in bits.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line, LLVMMetadataRef File)
Create debugging information temporary entry for a macro file.
LLVM_C_ABI LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType)
Get the flags associated with this DIType.
LLVM_C_ABI 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 *APINotesFile, size_t APINotesFileLen)
Creates a new descriptor for a module with the specified parent scope.
LLVM_C_ABI 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.
LLVM_C_ABI uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD)
Get the dwarf::Tag of a DINode.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, const uint64_t Words[], LLVMBool IsUnsigned)
Create debugging information entry for an enumerator of arbitrary precision.
LLVM_C_ABI void LLVMReplaceArrays(LLVMDIBuilderRef Builder, LLVMMetadataRef *T, LLVMMetadataRef *Elements, unsigned NumElements)
Replace arrays.
LLVM_C_ABI 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.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Discriminator)
Create a descriptor for a lexical block with a new file attached.
LLVM_C_ABI void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode)
Deallocate a temporary node.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, LLVMBool Implicit)
Create a uniqued DIType* clone with FlagObjectPointer.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Scope, uint32_t AlignInBits)
Create debugging information entry for a typedef.
unsigned LLVMDWARFTypeEncoding
An LLVM DWARF type encoding.
Definition DebugInfo.h:229
LLVM_C_ABI 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.
LLVM_C_ABI void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc)
Set the debug location for the given instruction.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
Create subroutine type.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for a vector type.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder)
Create C++11 nullptr type.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements, unsigned NumElements)
Create a descriptor for an imported module that aliases another imported entity descriptor.
LLVM_C_ABI 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.
unsigned LLVMMetadataKind
Definition DebugInfo.h:219
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a c++ style reference or rvalue reference type.
LLVM_C_ABI LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module)
Strip debug info in the module if it exists.
LLVM_C_ABI 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.
LLVM_C_ABI uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType)
Get the alignment of this DIType in bits.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned Column)
Create a descriptor for a lexical block with the specified parent context.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagArtificial set.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt)
Creates a new DebugLocation that describes a source location.
LLVM_C_ABI const char * LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len)
Get the directory of a given file.
LLVM_C_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported namespace.
@ LLVMGenericDINodeMetadataKind
Definition DebugInfo.h:185
@ LLVMDIFixedPointTypeMetadataKind
Definition DebugInfo.h:214
@ LLVMDISubrangeTypeMetadataKind
Definition DebugInfo.h:213
@ LLVMDIDerivedTypeMetadataKind
Definition DebugInfo.h:189
@ LLVMDIMacroMetadataKind
Definition DebugInfo.h:206
@ LLVMDILexicalBlockMetadataKind
Definition DebugInfo.h:195
@ LLVMDILayerLocListMetadataKind
Definition DebugInfo.h:217
@ LLVMDIPropertyMetadataKind
Definition DebugInfo.h:215
@ LLVMMDTupleMetadataKind
Definition DebugInfo.h:181
@ LLVMDIExpressionMetadataKind
Definition DebugInfo.h:183
@ LLVMDIGlobalVariableExpressionMetadataKind
Definition DebugInfo.h:184
@ LLVMDILayerLocMetadataKind
Definition DebugInfo.h:216
@ LLVMLocalAsMetadataMetadataKind
Definition DebugInfo.h:179
@ LLVMDILocalVariableMetadataKind
Definition DebugInfo.h:202
@ LLVMDILocationMetadataKind
Definition DebugInfo.h:182
@ LLVMDistinctMDOperandPlaceholderMetadataKind
Definition DebugInfo.h:180
@ LLVMDILexicalBlockFileMetadataKind
Definition DebugInfo.h:196
@ LLVMDIMacroFileMetadataKind
Definition DebugInfo.h:207
@ LLVMDIArgListMetadataKind
Definition DebugInfo.h:211
@ LLVMDITemplateTypeParameterMetadataKind
Definition DebugInfo.h:199
@ LLVMDIImportedEntityMetadataKind
Definition DebugInfo.h:205
@ LLVMDIGlobalVariableMetadataKind
Definition DebugInfo.h:201
@ LLVMDIAssignIDMetadataKind
Definition DebugInfo.h:212
@ LLVMDISubrangeMetadataKind
Definition DebugInfo.h:186
@ LLVMDITemplateValueParameterMetadataKind
Definition DebugInfo.h:200
@ LLVMDIObjCPropertyMetadataKind
Definition DebugInfo.h:204
@ LLVMDINamespaceMetadataKind
Definition DebugInfo.h:197
@ LLVMDIGenericSubrangeMetadataKind
Definition DebugInfo.h:210
@ LLVMDICompileUnitMetadataKind
Definition DebugInfo.h:193
@ LLVMDICompositeTypeMetadataKind
Definition DebugInfo.h:190
@ LLVMMDStringMetadataKind
Definition DebugInfo.h:177
@ LLVMDIEnumeratorMetadataKind
Definition DebugInfo.h:187
@ LLVMDIFileMetadataKind
Definition DebugInfo.h:192
@ LLVMDIModuleMetadataKind
Definition DebugInfo.h:198
@ LLVMDIBasicTypeMetadataKind
Definition DebugInfo.h:188
@ LLVMConstantAsMetadataMetadataKind
Definition DebugInfo.h:178
@ LLVMDIStringTypeMetadataKind
Definition DebugInfo.h:209
@ LLVMDICommonBlockMetadataKind
Definition DebugInfo.h:208
@ LLVMDILabelMetadataKind
Definition DebugInfo.h:203
@ LLVMDISubprogramMetadataKind
Definition DebugInfo.h:194
@ LLVMDISubroutineTypeMetadataKind
Definition DebugInfo.h:191
@ LLVMDWARFMacinfoRecordTypeStartFile
Definition DebugInfo.h:239
@ LLVMDWARFMacinfoRecordTypeVendorExt
Definition DebugInfo.h:241
@ LLVMDWARFMacinfoRecordTypeEndFile
Definition DebugInfo.h:240
@ LLVMDWARFMacinfoRecordTypeMacro
Definition DebugInfo.h:238
@ LLVMDWARFMacinfoRecordTypeDefine
Definition DebugInfo.h:237
@ LLVMDWARFSourceLanguageBLISS
Definition DebugInfo.h:119
@ LLVMDWARFSourceLanguageJava
Definition DebugInfo.h:91
@ LLVMDWARFSourceLanguageGOOGLE_RenderScript
Definition DebugInfo.h:158
@ LLVMDWARFSourceLanguageOpenCL_CPP
Definition DebugInfo.h:136
@ LLVMDWARFSourceLanguageAlgol68
Definition DebugInfo.h:149
@ LLVMDWARFSourceLanguageSwift
Definition DebugInfo.h:112
@ LLVMDWARFSourceLanguageCobol74
Definition DebugInfo.h:84
@ LLVMDWARFSourceLanguageUPC
Definition DebugInfo.h:98
@ LLVMDWARFSourceLanguageFortran03
Definition DebugInfo.h:116
@ LLVMDWARFSourceLanguageAda2005
Definition DebugInfo.h:127
@ LLVMDWARFSourceLanguageDylan
Definition DebugInfo.h:114
@ LLVMDWARFSourceLanguageGleam
Definition DebugInfo.h:153
@ LLVMDWARFSourceLanguageC_plus_plus_17
Definition DebugInfo.h:123
@ LLVMDWARFSourceLanguageC_plus_plus_14
Definition DebugInfo.h:115
@ LLVMDWARFSourceLanguageC
Definition DebugInfo.h:81
@ LLVMDWARFSourceLanguageC_plus_plus_20
Definition DebugInfo.h:124
@ LLVMDWARFSourceLanguageCPP_for_OpenCL
Definition DebugInfo.h:137
@ LLVMDWARFSourceLanguageC_plus_plus_23
Definition DebugInfo.h:143
@ LLVMDWARFSourceLanguageErlang
Definition DebugInfo.h:151
@ LLVMDWARFSourceLanguageAda95
Definition DebugInfo.h:93
@ LLVMDWARFSourceLanguageElixir
Definition DebugInfo.h:152
@ LLVMDWARFSourceLanguageD
Definition DebugInfo.h:99
@ LLVMDWARFSourceLanguageAda2012
Definition DebugInfo.h:128
@ LLVMDWARFSourceLanguageGLSL_ES
Definition DebugInfo.h:134
@ LLVMDWARFSourceLanguageMove
Definition DebugInfo.h:140
@ LLVMDWARFSourceLanguageCobol85
Definition DebugInfo.h:85
@ LLVMDWARFSourceLanguageV
Definition DebugInfo.h:148
@ LLVMDWARFSourceLanguageKotlin
Definition DebugInfo.h:120
@ LLVMDWARFSourceLanguageFortran23
Definition DebugInfo.h:147
@ LLVMDWARFSourceLanguageModula2
Definition DebugInfo.h:89
@ LLVMDWARFSourceLanguageP4
Definition DebugInfo.h:145
@ LLVMDWARFSourceLanguageC_plus_plus
Definition DebugInfo.h:83
@ LLVMDWARFSourceLanguageC99
Definition DebugInfo.h:92
@ LLVMDWARFSourceLanguageMojo
Definition DebugInfo.h:132
@ LLVMDWARFSourceLanguageOpenCL
Definition DebugInfo.h:103
@ LLVMDWARFSourceLanguageHylo
Definition DebugInfo.h:141
@ LLVMDWARFSourceLanguageRust
Definition DebugInfo.h:110
@ LLVMDWARFSourceLanguageFortran90
Definition DebugInfo.h:87
@ LLVMDWARFSourceLanguageJulia
Definition DebugInfo.h:113
@ LLVMDWARFSourceLanguageModula3
Definition DebugInfo.h:105
@ LLVMDWARFSourceLanguageGo
Definition DebugInfo.h:104
@ LLVMDWARFSourceLanguageObjC
Definition DebugInfo.h:96
@ LLVMDWARFSourceLanguageGLSL
Definition DebugInfo.h:133
@ LLVMDWARFSourceLanguageC_sharp
Definition DebugInfo.h:131
@ LLVMDWARFSourceLanguageBORLAND_Delphi
Definition DebugInfo.h:159
@ LLVMDWARFSourceLanguageFortran77
Definition DebugInfo.h:86
@ LLVMDWARFSourceLanguageC23
Definition DebugInfo.h:146
@ LLVMDWARFSourceLanguageMips_Assembler
Definition DebugInfo.h:157
@ LLVMDWARFSourceLanguageRuby
Definition DebugInfo.h:139
@ LLVMDWARFSourceLanguageHIP
Definition DebugInfo.h:129
@ LLVMDWARFSourceLanguageObjC_plus_plus
Definition DebugInfo.h:97
@ LLVMDWARFSourceLanguageFortran08
Definition DebugInfo.h:117
@ LLVMDWARFSourceLanguagePascal83
Definition DebugInfo.h:88
@ LLVMDWARFSourceLanguagePLI
Definition DebugInfo.h:95
@ LLVMDWARFSourceLanguageC17
Definition DebugInfo.h:125
@ LLVMDWARFSourceLanguageC11
Definition DebugInfo.h:111
@ LLVMDWARFSourceLanguageMetal
Definition DebugInfo.h:142
@ LLVMDWARFSourceLanguageFortran95
Definition DebugInfo.h:94
@ LLVMDWARFSourceLanguageNim
Definition DebugInfo.h:150
@ LLVMDWARFSourceLanguageC_plus_plus_03
Definition DebugInfo.h:107
@ LLVMDWARFSourceLanguageFortran18
Definition DebugInfo.h:126
@ LLVMDWARFSourceLanguageC89
Definition DebugInfo.h:80
@ LLVMDWARFSourceLanguagePython
Definition DebugInfo.h:101
@ LLVMDWARFSourceLanguageRenderScript
Definition DebugInfo.h:118
@ LLVMDWARFSourceLanguageAssembly
Definition DebugInfo.h:130
@ LLVMDWARFSourceLanguageSYCL
Definition DebugInfo.h:138
@ LLVMDWARFSourceLanguageRoc
Definition DebugInfo.h:154
@ LLVMDWARFSourceLanguageCrystal
Definition DebugInfo.h:122
@ LLVMDWARFSourceLanguageOCaml
Definition DebugInfo.h:109
@ LLVMDWARFSourceLanguageZig
Definition DebugInfo.h:121
@ LLVMDWARFSourceLanguageOdin
Definition DebugInfo.h:144
@ LLVMDWARFSourceLanguageHaskell
Definition DebugInfo.h:106
@ LLVMDWARFSourceLanguageC_plus_plus_11
Definition DebugInfo.h:108
@ LLVMDWARFSourceLanguageHLSL
Definition DebugInfo.h:135
@ LLVMDWARFSourceLanguageAda83
Definition DebugInfo.h:82
@ LLVMDIFlagBigEndian
Definition DebugInfo.h:66
@ LLVMDIFlagPrivate
Definition DebugInfo.h:37
@ LLVMDIFlagPrototyped
Definition DebugInfo.h:46
@ LLVMDIFlagBitField
Definition DebugInfo.h:58
@ LLVMDIFlagObjcClassComplete
Definition DebugInfo.h:47
@ LLVMDIFlagAccessibility
Definition DebugInfo.h:69
@ LLVMDIFlagRValueReference
Definition DebugInfo.h:52
@ LLVMDIFlagProtected
Definition DebugInfo.h:38
@ LLVMDIFlagIntroducedVirtual
Definition DebugInfo.h:57
@ LLVMDIFlagAppleBlock
Definition DebugInfo.h:41
@ LLVMDIFlagTypePassByReference
Definition DebugInfo.h:61
@ LLVMDIFlagFixedEnum
Definition DebugInfo.h:63
@ LLVMDIFlagNoReturn
Definition DebugInfo.h:59
@ LLVMDIFlagExplicit
Definition DebugInfo.h:45
@ LLVMDIFlagMultipleInheritance
Definition DebugInfo.h:55
@ LLVMDIFlagThunk
Definition DebugInfo.h:64
@ LLVMDIFlagIndirectVirtualBase
Definition DebugInfo.h:68
@ LLVMDIFlagLittleEndian
Definition DebugInfo.h:67
@ LLVMDIFlagReservedBit4
Definition DebugInfo.h:42
@ LLVMDIFlagArtificial
Definition DebugInfo.h:44
@ LLVMDIFlagPublic
Definition DebugInfo.h:39
@ LLVMDIFlagStaticMember
Definition DebugInfo.h:50
@ LLVMDIFlagVector
Definition DebugInfo.h:49
@ LLVMDIFlagPtrToMemberRep
Definition DebugInfo.h:71
@ LLVMDIFlagVirtual
Definition DebugInfo.h:43
@ LLVMDIFlagSingleInheritance
Definition DebugInfo.h:54
@ LLVMDIFlagVirtualInheritance
Definition DebugInfo.h:56
@ LLVMDIFlagReserved
Definition DebugInfo.h:53
@ LLVMDIFlagTypePassByValue
Definition DebugInfo.h:60
@ LLVMDIFlagEnumClass
Definition DebugInfo.h:62
@ LLVMDIFlagFwdDecl
Definition DebugInfo.h:40
@ LLVMDIFlagLValueReference
Definition DebugInfo.h:51
@ LLVMDIFlagObjectPointer
Definition DebugInfo.h:48
@ LLVMDIFlagNonTrivial
Definition DebugInfo.h:65
@ LLVMDIFlagZero
Definition DebugInfo.h:36
@ CSK_SHA1
Definition DebugInfo.h:224
@ CSK_SHA256
Definition DebugInfo.h:224
@ CSK_MD5
Definition DebugInfo.h:224
@ LLVMDWARFEmissionLineTablesOnly
Definition DebugInfo.h:168
@ LLVMDWARFEmissionFull
Definition DebugInfo.h:167
@ LLVMDWARFEmissionNone
Definition DebugInfo.h:166
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition Types.h:75
int LLVMBool
Definition Types.h:28
struct LLVMOpaqueDbgRecord * LLVMDbgRecordRef
Definition Types.h:175
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition Types.h:53
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition Types.h:82
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition Types.h:89
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition Types.h:61
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition Types.h:117