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:
154
155 // Vendor extensions:
160
161/**
162 * The amount of debug information to emit.
163 */
169
170/**
171 * The kind of metadata nodes.
172 */
173// NOTE: New entries should always be appended instead of matching the order
174// in Metadata.def.
175enum {
214};
215typedef unsigned LLVMMetadataKind;
216
217/**
218 * The kind of checksum to emit.
219 */
221
222/**
223 * An LLVM DWARF type encoding.
224 */
225typedef unsigned LLVMDWARFTypeEncoding;
226
227/**
228 * Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro.
229 * @see llvm::dwarf::MacinfoRecordType
230 * @note Values are from DW_MACINFO_* constants in the DWARF specification.
231 */
239
240/**
241 * The current debug metadata version number.
242 */
244
245/**
246 * The version of debug metadata that's present in the provided \c Module.
247 */
249
250/**
251 * Strip debug info in the module if it exists.
252 * To do this, we remove all calls to the debugger intrinsics and any named
253 * metadata for debugging. We also remove debug locations for instructions.
254 * Return true if module is modified.
255 */
257
258/**
259 * Construct a builder for a module, and do not allow for unresolved nodes
260 * attached to the module.
261 */
264
265/**
266 * Construct a builder for a module and collect unresolved nodes attached
267 * to the module in order to resolve cycles during a call to
268 * \c LLVMDIBuilderFinalize.
269 */
271
272/**
273 * Deallocates the \c DIBuilder and everything it owns.
274 * @note You must call \c LLVMDIBuilderFinalize before this
275 */
277
278/**
279 * Construct any deferred debug info descriptors.
280 */
282
283/**
284 * Finalize a specific subprogram.
285 * No new variables may be added to this subprogram afterwards.
286 */
288 LLVMMetadataRef Subprogram);
289
290/**
291 * A CompileUnit provides an anchor for all debugging
292 * information generated during this instance of compilation.
293 * \param Lang Source programming language, eg.
294 * \c LLVMDWARFSourceLanguageC99
295 * \param FileRef File info.
296 * \param Producer Identify the producer of debugging information
297 * and code. Usually this is a compiler
298 * version string.
299 * \param ProducerLen The length of the C string passed to \c Producer.
300 * \param isOptimized A boolean flag which indicates whether optimization
301 * is enabled or not.
302 * \param Flags This string lists command line options. This
303 * string is directly embedded in debug info
304 * output which may be used by a tool
305 * analyzing generated debugging information.
306 * \param FlagsLen The length of the C string passed to \c Flags.
307 * \param RuntimeVer This indicates runtime version for languages like
308 * Objective-C.
309 * \param SplitName The name of the file that we'll split debug info
310 * out into.
311 * \param SplitNameLen The length of the C string passed to \c SplitName.
312 * \param Kind The kind of debug information to generate.
313 * \param DWOId The DWOId if this is a split skeleton compile unit.
314 * \param SplitDebugInlining Whether to emit inline debug info.
315 * \param DebugInfoForProfiling Whether to emit extra debug info for
316 * profile collection.
317 * \param SysRoot The Clang system root (value of -isysroot).
318 * \param SysRootLen The length of the C string passed to \c SysRoot.
319 * \param SDK The SDK. On Darwin, the last component of the sysroot.
320 * \param SDKLen The length of the C string passed to \c SDK.
321 */
324 LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
325 LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
326 unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen,
327 LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining,
328 LLVMBool DebugInfoForProfiling, const char *SysRoot, size_t SysRootLen,
329 const char *SDK, size_t SDKLen);
330
331/**
332 * Create a file descriptor to hold debugging information for a file.
333 * \param Builder The \c DIBuilder.
334 * \param Filename File name.
335 * \param FilenameLen The length of the C string passed to \c Filename.
336 * \param Directory Directory.
337 * \param DirectoryLen The length of the C string passed to \c Directory.
338 */
340 const char *Filename,
341 size_t FilenameLen,
342 const char *Directory,
343 size_t DirectoryLen);
344
345/**
346 * Create a file descriptor to hold debugging information for a file.
347 * \param Builder The \c DIBuilder.
348 * \param Filename File name.
349 * \param FilenameLen The length of the C string passed to \c Filename.
350 * \param Directory Directory.
351 * \param DirectoryLen The length of the C string passed to \c Directory.
352 * \param ChecksumKind The kind of checksum. eg MD5, SHA256
353 * \param Checksum The checksum.
354 * \param ChecksumLen The length of the checksum.
355 * \param Souce The embedded source.
356 * \param SourceLen The length of the source.
357 */
359 LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen,
360 const char *Directory, size_t DirectoryLen, LLVMChecksumKind ChecksumKind,
361 const char *Checksum, size_t ChecksumLen, const char *Source,
362 size_t SourceLen);
363
364/**
365 * Creates a new descriptor for a module with the specified parent scope.
366 * \param Builder The \c DIBuilder.
367 * \param ParentScope The parent scope containing this module declaration.
368 * \param Name Module name.
369 * \param NameLen The length of the C string passed to \c Name.
370 * \param ConfigMacros A space-separated shell-quoted list of -D macro
371 definitions as they would appear on a command line.
372 * \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
373 * \param IncludePath The path to the module map file.
374 * \param IncludePathLen The length of the C string passed to \c IncludePath.
375 * \param APINotesFile The path to an API notes file for the module.
376 * \param APINotesFileLen The length of the C string passed to \c APINotestFile.
377 */
379 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name,
380 size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen,
381 const char *IncludePath, size_t IncludePathLen, const char *APINotesFile,
382 size_t APINotesFileLen);
383
384/**
385 * Creates a new descriptor for a namespace with the specified parent scope.
386 * \param Builder The \c DIBuilder.
387 * \param ParentScope The parent scope containing this module declaration.
388 * \param Name NameSpace name.
389 * \param NameLen The length of the C string passed to \c Name.
390 * \param ExportSymbols Whether or not the namespace exports symbols, e.g.
391 * this is true of C++ inline namespaces.
392 */
394 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name,
395 size_t NameLen, LLVMBool ExportSymbols);
396
397/**
398 * Create a new descriptor for the specified subprogram.
399 * \param Builder The \c DIBuilder.
400 * \param Scope Function scope.
401 * \param Name Function name.
402 * \param NameLen Length of enumeration name.
403 * \param LinkageName Mangled function name.
404 * \param LinkageNameLen Length of linkage name.
405 * \param File File where this variable is defined.
406 * \param LineNo Line number.
407 * \param Ty Function type.
408 * \param IsLocalToUnit True if this function is not externally visible.
409 * \param IsDefinition True if this is a function definition.
410 * \param ScopeLine Set to the beginning of the scope this starts
411 * \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are
412 * used to emit dwarf attributes.
413 * \param IsOptimized True if optimization is ON.
414 */
416 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
417 size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
418 LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
419 LLVMBool IsLocalToUnit, LLVMBool IsDefinition, unsigned ScopeLine,
420 LLVMDIFlags Flags, LLVMBool IsOptimized);
421
422/**
423 * Create a descriptor for a lexical block with the specified parent context.
424 * \param Builder The \c DIBuilder.
425 * \param Scope Parent lexical block.
426 * \param File Source file.
427 * \param Line The line in the source file.
428 * \param Column The column in the source file.
429 */
432 unsigned Line, unsigned Column);
433
434/**
435 * Create a descriptor for a lexical block with a new file attached.
436 * \param Builder The \c DIBuilder.
437 * \param Scope Lexical block.
438 * \param File Source file.
439 * \param Discriminator DWARF path discriminator value.
440 */
443 unsigned Discriminator);
444
445/**
446 * Create a descriptor for an imported namespace. Suitable for e.g. C++
447 * using declarations.
448 * \param Builder The \c DIBuilder.
449 * \param Scope The scope this module is imported into
450 * \param File File where the declaration is located.
451 * \param Line Line number of the declaration.
452 */
455 LLVMMetadataRef File, unsigned Line);
456
457/**
458 * Create a descriptor for an imported module that aliases another
459 * imported entity descriptor.
460 * \param Builder The \c DIBuilder.
461 * \param Scope The scope this module is imported into
462 * \param ImportedEntity Previous imported entity to alias.
463 * \param File File where the declaration is located.
464 * \param Line Line number of the declaration.
465 * \param Elements Renamed elements.
466 * \param NumElements Number of renamed elements.
467 */
469 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
470 LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line,
471 LLVMMetadataRef *Elements, unsigned NumElements);
472
473/**
474 * Create a descriptor for an imported module.
475 * \param Builder The \c DIBuilder.
476 * \param Scope The scope this module is imported into
477 * \param M The module being imported here
478 * \param File File where the declaration is located.
479 * \param Line Line number of the declaration.
480 * \param Elements Renamed elements.
481 * \param NumElements Number of renamed elements.
482 */
485 LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements,
486 unsigned NumElements);
487
488/**
489 * Create a descriptor for an imported function, type, or variable. Suitable
490 * for e.g. FORTRAN-style USE declarations.
491 * \param Builder The DIBuilder.
492 * \param Scope The scope this module is imported into.
493 * \param Decl The declaration (or definition) of a function, type,
494 or variable.
495 * \param File File where the declaration is located.
496 * \param Line Line number of the declaration.
497 * \param Name A name that uniquely identifies this imported
498 declaration.
499 * \param NameLen The length of the C string passed to \c Name.
500 * \param Elements Renamed elements.
501 * \param NumElements Number of renamed elements.
502 */
505 LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen,
506 LLVMMetadataRef *Elements, unsigned NumElements);
507
508/**
509 * Creates a new DebugLocation that describes a source location.
510 * \param Line The line in the source file.
511 * \param Column The column in the source file.
512 * \param Scope The scope in which the location resides.
513 * \param InlinedAt The scope where this location was inlined, if at all.
514 * (optional).
515 * \note If the item to which this location is attached cannot be
516 * attributed to a source line, pass 0 for the line and column.
517 */
519 LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope,
520 LLVMMetadataRef InlinedAt);
521
522/**
523 * Get the line number of this debug location.
524 * \param Location The debug location.
525 *
526 * @see DILocation::getLine()
527 */
529
530/**
531 * Get the column number of this debug location.
532 * \param Location The debug location.
533 *
534 * @see DILocation::getColumn()
535 */
537
538/**
539 * Get the local scope associated with this debug location.
540 * \param Location The debug location.
541 *
542 * @see DILocation::getScope()
543 */
545
546/**
547 * Get the "inline at" location associated with this debug location.
548 * \param Location The debug location.
549 *
550 * @see DILocation::getInlinedAt()
551 */
553
554/**
555 * Get the metadata of the file associated with a given scope.
556 * \param Scope The scope object.
557 *
558 * @see DIScope::getFile()
559 */
561
562/**
563 * Get the directory of a given file.
564 * \param File The file object.
565 * \param Len The length of the returned string.
566 *
567 * @see DIFile::getDirectory()
568 */
570 unsigned *Len);
571
572/**
573 * Get the name of a given file.
574 * \param File The file object.
575 * \param Len The length of the returned string.
576 *
577 * @see DIFile::getFilename()
578 */
580 unsigned *Len);
581
582/**
583 * Get the source of a given file.
584 * \param File The file object.
585 * \param Len The length of the returned string.
586 *
587 * @see DIFile::getSource()
588 */
589LLVM_C_ABI const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
590
591/**
592 * Create a type array.
593 * \param Builder The DIBuilder.
594 * \param Data The type elements.
595 * \param NumElements Number of type elements.
596 */
598 LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements);
599
600/**
601 * Create subroutine type.
602 * \param Builder The DIBuilder.
603 * \param File The file in which the subroutine resides.
604 * \param ParameterTypes An array of subroutine parameter types. This
605 * includes return type at 0th index.
606 * \param NumParameterTypes The number of parameter types in \c ParameterTypes
607 * \param Flags E.g.: \c LLVMDIFlagLValueReference.
608 * These flags are used to emit dwarf attributes.
609 */
611 LLVMDIBuilderRef Builder, LLVMMetadataRef File,
612 LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes,
613 LLVMDIFlags Flags);
614
615/**
616 * Create debugging information entry for a macro.
617 * @param Builder The DIBuilder.
618 * @param ParentMacroFile Macro parent (could be NULL).
619 * @param Line Source line number where the macro is defined.
620 * @param RecordType DW_MACINFO_define or DW_MACINFO_undef.
621 * @param Name Macro name.
622 * @param NameLen Macro name length.
623 * @param Value Macro value.
624 * @param ValueLen Macro value length.
625 */
627 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line,
628 LLVMDWARFMacinfoRecordType RecordType, const char *Name, size_t NameLen,
629 const char *Value, size_t ValueLen);
630
631/**
632 * Create debugging information temporary entry for a macro file.
633 * List of macro node direct children will be calculated by DIBuilder,
634 * using the \p ParentMacroFile relationship.
635 * @param Builder The DIBuilder.
636 * @param ParentMacroFile Macro parent (could be NULL).
637 * @param Line Source line number where the macro file is included.
638 * @param File File descriptor containing the name of the macro file.
639 */
641 LLVMDIBuilderRef Builder, LLVMMetadataRef ParentMacroFile, unsigned Line,
642 LLVMMetadataRef File);
643
644/**
645 * Create debugging information entry for an enumerator.
646 * @param Builder The DIBuilder.
647 * @param Name Enumerator name.
648 * @param NameLen Length of enumerator name.
649 * @param Value Enumerator value.
650 * @param IsUnsigned True if the value is unsigned.
651 */
653 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, int64_t Value,
654 LLVMBool IsUnsigned);
655
656/**
657 * Create debugging information entry for an enumerator of arbitrary precision.
658 * @param Builder The DIBuilder.
659 * @param Name Enumerator name.
660 * @param NameLen Length of enumerator name.
661 * @param SizeInBits Number of bits of the value.
662 * @param Words The words that make up the value.
663 * @param IsUnsigned True if the value is unsigned.
664 */
666 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
667 uint64_t SizeInBits, const uint64_t Words[], LLVMBool IsUnsigned);
668
669/**
670 * Create debugging information entry for an enumeration.
671 * \param Builder The DIBuilder.
672 * \param Scope Scope in which this enumeration is defined.
673 * \param Name Enumeration name.
674 * \param NameLen Length of enumeration name.
675 * \param File File where this member is defined.
676 * \param LineNumber Line number.
677 * \param SizeInBits Member size.
678 * \param AlignInBits Member alignment.
679 * \param Elements Enumeration elements.
680 * \param NumElements Number of enumeration elements.
681 * \param ClassTy Underlying type of a C++11/ObjC fixed enum.
682 */
684 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
685 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
686 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
687 unsigned NumElements, LLVMMetadataRef ClassTy);
688
689/**
690 * Create debugging information entry for a union.
691 * \param Builder The DIBuilder.
692 * \param Scope Scope in which this union is defined.
693 * \param Name Union name.
694 * \param NameLen Length of union name.
695 * \param File File where this member is defined.
696 * \param LineNumber Line number.
697 * \param SizeInBits Member size.
698 * \param AlignInBits Member alignment.
699 * \param Flags Flags to encode member attribute, e.g. private
700 * \param Elements Union elements.
701 * \param NumElements Number of union elements.
702 * \param RunTimeLang Optional parameter, Objective-C runtime version.
703 * \param UniqueId A unique identifier for the union.
704 * \param UniqueIdLen Length of unique identifier.
705 */
707 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
708 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
709 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
710 LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
711 const char *UniqueId, size_t UniqueIdLen);
712
713/**
714 * Create debugging information entry for an array.
715 * \param Builder The DIBuilder.
716 * \param Size Array size.
717 * \param AlignInBits Alignment.
718 * \param Ty Element type.
719 * \param Subscripts Subscripts.
720 * \param NumSubscripts Number of subscripts.
721 */
723 LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits,
724 LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts);
725
726/**
727 * Create debugging information entry for a set.
728 * \param Builder The DIBuilder.
729 * \param Scope The scope in which the set is defined.
730 * \param Name A name that uniquely identifies this set.
731 * \param NameLen The length of the C string passed to \c Name.
732 * \param File File where the set is located.
733 * \param Line Line number of the declaration.
734 * \param SizeInBits Set size.
735 * \param AlignInBits Set alignment.
736 * \param BaseTy The base type of the set.
737 */
739 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
740 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
741 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef BaseTy);
742
743/**
744 * Create a descriptor for a subrange with dynamic bounds.
745 * \param Builder The DIBuilder.
746 * \param Scope The scope in which the subrange is defined.
747 * \param Name A name that uniquely identifies this subrange.
748 * \param NameLen The length of the C string passed to \c Name.
749 * \param LineNo Line number.
750 * \param File File where the subrange is located.
751 * \param SizeInBits Member size.
752 * \param AlignInBits Member alignment.
753 * \param Flags Flags.
754 * \param BaseTy The base type of the subrange. eg integer or enumeration
755 * \param LowerBound Lower bound of the subrange.
756 * \param UpperBound Upper bound of the subrange.
757 * \param Stride Stride of the subrange.
758 * \param Bias Bias of the subrange.
759 */
761 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
762 size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t SizeInBits,
763 uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef BaseTy,
764 LLVMMetadataRef LowerBound, LLVMMetadataRef UpperBound,
765 LLVMMetadataRef Stride, LLVMMetadataRef Bias);
766
767/**
768 * Create debugging information entry for a dynamic array.
769 * \param Builder The DIBuilder.
770 * \param Size Array size.
771 * \param AlignInBits Alignment.
772 * \param Ty Element type.
773 * \param Subscripts Subscripts.
774 * \param NumSubscripts Number of subscripts.
775 * \param DataLocation DataLocation. (DIVariable, DIExpression or NULL)
776 * \param Associated Associated. (DIVariable, DIExpression or NULL)
777 * \param Allocated Allocated. (DIVariable, DIExpression or NULL)
778 * \param Rank Rank. (DIVariable, DIExpression or NULL)
779 * \param BitStride BitStride.
780 */
782 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
783 size_t NameLen, unsigned LineNo, LLVMMetadataRef File, uint64_t Size,
784 uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts,
785 unsigned NumSubscripts, LLVMMetadataRef DataLocation,
786 LLVMMetadataRef Associated, LLVMMetadataRef Allocated, LLVMMetadataRef Rank,
787 LLVMMetadataRef BitStride);
788
789/**
790 * Replace arrays.
791 *
792 * @see DIBuilder::replaceArrays()
793 */
795 LLVMMetadataRef *Elements,
796 unsigned NumElements);
797
798/**
799 * Create debugging information entry for a vector type.
800 * \param Builder The DIBuilder.
801 * \param Size Vector size.
802 * \param AlignInBits Alignment.
803 * \param Ty Element type.
804 * \param Subscripts Subscripts.
805 * \param NumSubscripts Number of subscripts.
806 */
808 LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits,
809 LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts);
810
811/**
812 * Create a DWARF unspecified type.
813 * \param Builder The DIBuilder.
814 * \param Name The unspecified type's name.
815 * \param NameLen Length of type name.
816 */
818 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen);
819
820/**
821 * Create debugging information entry for a basic
822 * type.
823 * \param Builder The DIBuilder.
824 * \param Name Type name.
825 * \param NameLen Length of type name.
826 * \param SizeInBits Size of the type.
827 * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
828 * \param Flags Flags to encode optional attribute like endianity
829 */
831 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
832 uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, LLVMDIFlags Flags);
833
834/**
835 * Create debugging information entry for a pointer.
836 * \param Builder The DIBuilder.
837 * \param PointeeTy Type pointed by this pointer.
838 * \param SizeInBits Size.
839 * \param AlignInBits Alignment. (optional, pass 0 to ignore)
840 * \param AddressSpace DWARF address space. (optional, pass 0 to ignore)
841 * \param Name Pointer type name. (optional)
842 * \param NameLen Length of pointer type name. (optional)
843 */
845 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits,
846 uint32_t AlignInBits, unsigned AddressSpace, const char *Name,
847 size_t NameLen);
848
849/**
850 * Create debugging information entry for a struct.
851 * \param Builder The DIBuilder.
852 * \param Scope Scope in which this struct is defined.
853 * \param Name Struct name.
854 * \param NameLen Struct name length.
855 * \param File File where this member is defined.
856 * \param LineNumber Line number.
857 * \param SizeInBits Member size.
858 * \param AlignInBits Member alignment.
859 * \param Flags Flags to encode member attribute, e.g. private
860 * \param Elements Struct elements.
861 * \param NumElements Number of struct elements.
862 * \param RunTimeLang Optional parameter, Objective-C runtime version.
863 * \param VTableHolder The object containing the vtable for the struct.
864 * \param UniqueId A unique identifier for the struct.
865 * \param UniqueIdLen Length of the unique identifier for the struct.
866 */
868 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
869 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
870 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
871 LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
872 unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
873 const char *UniqueId, size_t UniqueIdLen);
874
875/**
876 * Create debugging information entry for a member.
877 * \param Builder The DIBuilder.
878 * \param Scope Member scope.
879 * \param Name Member name.
880 * \param NameLen Length of member name.
881 * \param File File where this member is defined.
882 * \param LineNo Line number.
883 * \param SizeInBits Member size.
884 * \param AlignInBits Member alignment.
885 * \param OffsetInBits Member offset.
886 * \param Flags Flags to encode member attribute, e.g. private
887 * \param Ty Parent type.
888 */
890 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
891 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
892 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
893 LLVMMetadataRef Ty);
894
895/**
896 * Create debugging information entry for a
897 * C++ static data member.
898 * \param Builder The DIBuilder.
899 * \param Scope Member scope.
900 * \param Name Member name.
901 * \param NameLen Length of member name.
902 * \param File File where this member is declared.
903 * \param LineNumber Line number.
904 * \param Type Type of the static member.
905 * \param Flags Flags to encode member attribute, e.g. private.
906 * \param ConstantVal Const initializer of the member.
907 * \param AlignInBits Member alignment.
908 */
910 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
911 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
912 LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
913 uint32_t AlignInBits);
914
915/**
916 * Create debugging information entry for a pointer to member.
917 * \param Builder The DIBuilder.
918 * \param PointeeType Type pointed to by this pointer.
919 * \param ClassType Type for which this pointer points to members of.
920 * \param SizeInBits Size.
921 * \param AlignInBits Alignment.
922 * \param Flags Flags.
923 */
925 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType,
926 LLVMMetadataRef ClassType, uint64_t SizeInBits, uint32_t AlignInBits,
927 LLVMDIFlags Flags);
928/**
929 * Create debugging information entry for Objective-C instance variable.
930 * \param Builder The DIBuilder.
931 * \param Name Member name.
932 * \param NameLen The length of the C string passed to \c Name.
933 * \param File File where this member is defined.
934 * \param LineNo Line number.
935 * \param SizeInBits Member size.
936 * \param AlignInBits Member alignment.
937 * \param OffsetInBits Member offset.
938 * \param Flags Flags to encode member attribute, e.g. private
939 * \param Ty Parent type.
940 * \param PropertyNode Property associated with this ivar.
941 */
943 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
944 LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
945 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
946 LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode);
947
948/**
949 * Create debugging information entry for Objective-C property.
950 * \param Builder The DIBuilder.
951 * \param Name Property name.
952 * \param NameLen The length of the C string passed to \c Name.
953 * \param File File where this property is defined.
954 * \param LineNo Line number.
955 * \param GetterName Name of the Objective C property getter selector.
956 * \param GetterNameLen The length of the C string passed to \c GetterName.
957 * \param SetterName Name of the Objective C property setter selector.
958 * \param SetterNameLen The length of the C string passed to \c SetterName.
959 * \param PropertyAttributes Objective C property attributes.
960 * \param Ty Type.
961 */
963 LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
964 LLVMMetadataRef File, unsigned LineNo, const char *GetterName,
965 size_t GetterNameLen, const char *SetterName, size_t SetterNameLen,
966 unsigned PropertyAttributes, LLVMMetadataRef Ty);
967
968/**
969 * Create a uniqued DIType* clone with FlagObjectPointer. If \c Implicit
970 * is true, then also set FlagArtificial.
971 * \param Builder The DIBuilder.
972 * \param Type The underlying type to which this pointer points.
973 * \param Implicit Indicates whether this pointer was implicitly generated
974 * (i.e., not spelled out in source).
975 */
977 LLVMDIBuilderRef Builder, LLVMMetadataRef Type, LLVMBool Implicit);
978
979/**
980 * Create debugging information entry for a qualified
981 * type, e.g. 'const int'.
982 * \param Builder The DIBuilder.
983 * \param Tag Tag identifying type,
984 * e.g. LLVMDWARFTypeQualifier_volatile_type
985 * \param Type Base Type.
986 */
988 LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type);
989
990/**
991 * Create debugging information entry for a c++
992 * style reference or rvalue reference type.
993 * \param Builder The DIBuilder.
994 * \param Tag Tag identifying type,
995 * \param Type Base Type.
996 */
998 LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type);
999
1000/**
1001 * Create C++11 nullptr type.
1002 * \param Builder The DIBuilder.
1003 */
1006
1007/**
1008 * Create debugging information entry for a typedef.
1009 * \param Builder The DIBuilder.
1010 * \param Type Original type.
1011 * \param Name Typedef name.
1012 * \param File File where this type is defined.
1013 * \param LineNo Line number.
1014 * \param Scope The surrounding context for the typedef.
1015 */
1017 LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name,
1018 size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
1019 LLVMMetadataRef Scope, uint32_t AlignInBits);
1020
1021/**
1022 * Create debugging information entry to establish inheritance relationship
1023 * between two types.
1024 * \param Builder The DIBuilder.
1025 * \param Ty Original type.
1026 * \param BaseTy Base type. Ty is inherits from base.
1027 * \param BaseOffset Base offset.
1028 * \param VBPtrOffset Virtual base pointer offset.
1029 * \param Flags Flags to describe inheritance attribute, e.g. private
1030 */
1033 uint64_t BaseOffset, uint32_t VBPtrOffset, LLVMDIFlags Flags);
1034
1035/**
1036 * Create a permanent forward-declared type.
1037 * \param Builder The DIBuilder.
1038 * \param Tag A unique tag for this type.
1039 * \param Name Type name.
1040 * \param NameLen Length of type name.
1041 * \param Scope Type scope.
1042 * \param File File where this type is defined.
1043 * \param Line Line number where this type is defined.
1044 * \param RuntimeLang Indicates runtime version for languages like
1045 * Objective-C.
1046 * \param SizeInBits Member size.
1047 * \param AlignInBits Member alignment.
1048 * \param UniqueIdentifier A unique identifier for the type.
1049 * \param UniqueIdentifierLen Length of the unique identifier.
1050 */
1052 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen,
1053 LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
1054 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
1055 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
1056
1057/**
1058 * Create a temporary forward-declared type.
1059 * \param Builder The DIBuilder.
1060 * \param Tag A unique tag for this type.
1061 * \param Name Type name.
1062 * \param NameLen Length of type name.
1063 * \param Scope Type scope.
1064 * \param File File where this type is defined.
1065 * \param Line Line number where this type is defined.
1066 * \param RuntimeLang Indicates runtime version for languages like
1067 * Objective-C.
1068 * \param SizeInBits Member size.
1069 * \param AlignInBits Member alignment.
1070 * \param Flags Flags.
1071 * \param UniqueIdentifier A unique identifier for the type.
1072 * \param UniqueIdentifierLen Length of the unique identifier.
1073 */
1075 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen,
1076 LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
1077 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
1078 LLVMDIFlags Flags, const char *UniqueIdentifier,
1079 size_t UniqueIdentifierLen);
1080
1081/**
1082 * Create debugging information entry for a bit field member.
1083 * \param Builder The DIBuilder.
1084 * \param Scope Member scope.
1085 * \param Name Member name.
1086 * \param NameLen Length of member name.
1087 * \param File File where this member is defined.
1088 * \param LineNumber Line number.
1089 * \param SizeInBits Member size.
1090 * \param OffsetInBits Member offset.
1091 * \param StorageOffsetInBits Member storage offset.
1092 * \param Flags Flags to encode member attribute.
1093 * \param Type Parent type.
1094 */
1096 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1097 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
1098 uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits,
1099 LLVMDIFlags Flags, LLVMMetadataRef Type);
1100
1101/**
1102 * Create debugging information entry for a class.
1103 * \param Scope Scope in which this class is defined.
1104 * \param Name Class name.
1105 * \param NameLen The length of the C string passed to \c Name.
1106 * \param File File where this member is defined.
1107 * \param LineNumber Line number.
1108 * \param SizeInBits Member size.
1109 * \param AlignInBits Member alignment.
1110 * \param OffsetInBits Member offset.
1111 * \param Flags Flags to encode member attribute, e.g. private.
1112 * \param DerivedFrom Debug info of the base class of this type.
1113 * \param Elements Class members.
1114 * \param NumElements Number of class elements.
1115 * \param VTableHolder Debug info of the base class that contains vtable
1116 * for this type. This is used in
1117 * DW_AT_containing_type. See DWARF documentation
1118 * for more info.
1119 * \param TemplateParamsNode Template type parameters.
1120 * \param UniqueIdentifier A unique identifier for the type.
1121 * \param UniqueIdentifierLen Length of the unique identifier.
1122 */
1124 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1125 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
1126 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1127 LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
1128 unsigned NumElements, LLVMMetadataRef VTableHolder,
1129 LLVMMetadataRef TemplateParamsNode, const char *UniqueIdentifier,
1130 size_t UniqueIdentifierLen);
1131
1132/**
1133 * Create a uniqued DIType* clone with FlagArtificial set.
1134 * \param Builder The DIBuilder.
1135 * \param Type The underlying type.
1136 */
1138 LLVMDIBuilderRef Builder, LLVMMetadataRef Type);
1139
1140/**
1141 * Get the name of this DIType.
1142 * \param DType The DIType.
1143 * \param Length The length of the returned string.
1144 *
1145 * @see DIType::getName()
1146 */
1147LLVM_C_ABI const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
1148
1149/**
1150 * Get the size of this DIType in bits.
1151 * \param DType The DIType.
1152 *
1153 * @see DIType::getSizeInBits()
1154 */
1156
1157/**
1158 * Get the offset of this DIType in bits.
1159 * \param DType The DIType.
1160 *
1161 * @see DIType::getOffsetInBits()
1162 */
1164
1165/**
1166 * Get the alignment of this DIType in bits.
1167 * \param DType The DIType.
1168 *
1169 * @see DIType::getAlignInBits()
1170 */
1172
1173/**
1174 * Get the source line where this DIType is declared.
1175 * \param DType The DIType.
1176 *
1177 * @see DIType::getLine()
1178 */
1180
1181/**
1182 * Get the flags associated with this DIType.
1183 * \param DType The DIType.
1184 *
1185 * @see DIType::getFlags()
1186 */
1188
1189/**
1190 * Create a descriptor for a value range.
1191 * \param Builder The DIBuilder.
1192 * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
1193 * \param Count Count of elements in the subrange.
1194 */
1196 LLVMDIBuilderRef Builder, int64_t LowerBound, int64_t Count);
1197
1198/**
1199 * Create an array of DI Nodes.
1200 * \param Builder The DIBuilder.
1201 * \param Data The DI Node elements.
1202 * \param NumElements Number of DI Node elements.
1203 */
1205 LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t NumElements);
1206
1207/**
1208 * Create a new descriptor for the specified variable which has a complex
1209 * address expression for its address.
1210 * \param Builder The DIBuilder.
1211 * \param Addr An array of complex address operations.
1212 * \param Length Length of the address operation array.
1213 */
1215 LLVMDIBuilderRef Builder, uint64_t *Addr, size_t Length);
1216
1217/**
1218 * Create a new descriptor for the specified variable that does not have an
1219 * address, but does have a constant value.
1220 * \param Builder The DIBuilder.
1221 * \param Value The constant value.
1222 */
1224 LLVMDIBuilderRef Builder, uint64_t Value);
1225
1226/**
1227 * Create a new descriptor for the specified variable.
1228 * \param Scope Variable scope.
1229 * \param Name Name of the variable.
1230 * \param NameLen The length of the C string passed to \c Name.
1231 * \param Linkage Mangled name of the variable.
1232 * \param LinkLen The length of the C string passed to \c Linkage.
1233 * \param File File where this variable is defined.
1234 * \param LineNo Line number.
1235 * \param Ty Variable Type.
1236 * \param LocalToUnit Boolean flag indicate whether this variable is
1237 * externally visible or not.
1238 * \param Expr The location of the global relative to the attached
1239 * GlobalVariable.
1240 * \param Decl Reference to the corresponding declaration.
1241 * variables.
1242 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1243 * specified)
1244 */
1246 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1247 size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
1248 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1249 LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
1250
1251/**
1252 * Get the dwarf::Tag of a DINode
1253 */
1255
1256/**
1257 * Retrieves the \c DIVariable associated with this global variable expression.
1258 * \param GVE The global variable expression.
1259 *
1260 * @see llvm::DIGlobalVariableExpression::getVariable()
1261 */
1264
1265/**
1266 * Retrieves the \c DIExpression associated with this global variable expression.
1267 * \param GVE The global variable expression.
1268 *
1269 * @see llvm::DIGlobalVariableExpression::getExpression()
1270 */
1273
1274/**
1275 * Get the metadata of the file associated with a given variable.
1276 * \param Var The variable object.
1277 *
1278 * @see DIVariable::getFile()
1279 */
1281
1282/**
1283 * Get the metadata of the scope associated with a given variable.
1284 * \param Var The variable object.
1285 *
1286 * @see DIVariable::getScope()
1287 */
1289
1290/**
1291 * Get the source line where this \c DIVariable is declared.
1292 * \param Var The DIVariable.
1293 *
1294 * @see DIVariable::getLine()
1295 */
1297
1298/**
1299 * Create a new temporary \c MDNode. Suitable for use in constructing cyclic
1300 * \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
1301 * and must be manually deleted with \c LLVMDisposeTemporaryMDNode.
1302 * \param Ctx The context in which to construct the temporary node.
1303 * \param Data The metadata elements.
1304 * \param NumElements Number of metadata elements.
1305 */
1307 LLVMMetadataRef *Data,
1308 size_t NumElements);
1309
1310/**
1311 * Deallocate a temporary node.
1312 *
1313 * Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining
1314 * references will be reset.
1315 * \param TempNode The temporary metadata node.
1316 */
1318
1319/**
1320 * Replace all uses of temporary metadata.
1321 * \param TempTargetMetadata The temporary metadata node.
1322 * \param Replacement The replacement metadata node.
1323 */
1324LLVM_C_ABI void
1326 LLVMMetadataRef Replacement);
1327
1328/**
1329 * Create a new descriptor for the specified global variable that is temporary
1330 * and meant to be RAUWed.
1331 * \param Scope Variable scope.
1332 * \param Name Name of the variable.
1333 * \param NameLen The length of the C string passed to \c Name.
1334 * \param Linkage Mangled name of the variable.
1335 * \param LnkLen The length of the C string passed to \c Linkage.
1336 * \param File File where this variable is defined.
1337 * \param LineNo Line number.
1338 * \param Ty Variable Type.
1339 * \param LocalToUnit Boolean flag indicate whether this variable is
1340 * externally visible or not.
1341 * \param Decl Reference to the corresponding declaration.
1342 * \param AlignInBits Variable alignment(or 0 if no alignment attr was
1343 * specified)
1344 */
1346 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1347 size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
1348 unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
1349 LLVMMetadataRef Decl, uint32_t AlignInBits);
1350
1351/**
1352 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1353 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1354 *
1355 * The debug format can be switched later after inserting the records using
1356 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1357 *
1358 * Insert a Declare DbgRecord before the given instruction.
1359 * \param Builder The DIBuilder.
1360 * \param Storage The storage of the variable to declare.
1361 * \param VarInfo The variable's debug info descriptor.
1362 * \param Expr A complex location expression for the variable.
1363 * \param DebugLoc Debug info location.
1364 * \param Instr Instruction acting as a location for the new record.
1365 */
1367 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1368 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1369
1370/**
1371 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1372 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1373 *
1374 * The debug format can be switched later after inserting the records using
1375 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1376 *
1377 * Insert a Declare DbgRecord at the end of the given basic block. If the basic
1378 * block has a terminator instruction, the record is inserted before that
1379 * terminator instruction.
1380 * \param Builder The DIBuilder.
1381 * \param Storage The storage of the variable to declare.
1382 * \param VarInfo The variable's debug info descriptor.
1383 * \param Expr A complex location expression for the variable.
1384 * \param DebugLoc Debug info location.
1385 * \param Block Basic block acting as a location for the new record.
1386 */
1388 LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
1389 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1390
1391/**
1392 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1393 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1394 *
1395 * The debug format can be switched later after inserting the records using
1396 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1397 *
1398 * Insert a new debug record before the given instruction.
1399 * \param Builder The DIBuilder.
1400 * \param Val The value of the variable.
1401 * \param VarInfo The variable's debug info descriptor.
1402 * \param Expr A complex location expression for the variable.
1403 * \param DebugLoc Debug info location.
1404 * \param Instr Instruction acting as a location for the new record.
1405 */
1407 LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
1408 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
1409
1410/**
1411 * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true).
1412 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
1413 *
1414 * The debug format can be switched later after inserting the records using
1415 * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.
1416 *
1417 * Insert a new debug record at the end of the given basic block. If the
1418 * basic block has a terminator instruction, the record is inserted before
1419 * that terminator instruction.
1420 * \param Builder The DIBuilder.
1421 * \param Val The value of the variable.
1422 * \param VarInfo The variable's debug info descriptor.
1423 * \param Expr A complex location expression for the variable.
1424 * \param DebugLoc Debug info location.
1425 * \param Block Basic block acting as a location for the new record.
1426 */
1428 LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
1429 LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
1430
1431/**
1432 * Create a new descriptor for a local auto variable.
1433 * \param Builder The DIBuilder.
1434 * \param Scope The local scope the variable is declared in.
1435 * \param Name Variable name.
1436 * \param NameLen Length of variable name.
1437 * \param File File where this variable is defined.
1438 * \param LineNo Line number.
1439 * \param Ty Metadata describing the type of the variable.
1440 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1441 * \param Flags Flags.
1442 * \param AlignInBits Variable alignment.
1443 */
1445 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1446 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
1447 LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
1448
1449/**
1450 * Create a new descriptor for a function parameter variable.
1451 * \param Builder The DIBuilder.
1452 * \param Scope The local scope the variable is declared in.
1453 * \param Name Variable name.
1454 * \param NameLen Length of variable name.
1455 * \param ArgNo Unique argument number for this variable; starts at 1.
1456 * \param File File where this variable is defined.
1457 * \param LineNo Line number.
1458 * \param Ty Metadata describing the type of the variable.
1459 * \param AlwaysPreserve If true, this descriptor will survive optimizations.
1460 * \param Flags Flags.
1461 */
1463 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
1464 size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
1465 LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
1466
1467/**
1468 * Get the metadata of the subprogram attached to a function.
1469 *
1470 * @see llvm::Function::getSubprogram()
1471 */
1473
1474/**
1475 * Set the subprogram attached to a function.
1476 *
1477 * @see llvm::Function::setSubprogram()
1478 */
1480
1481/**
1482 * Get the line associated with a given subprogram.
1483 * \param Subprogram The subprogram object.
1484 *
1485 * @see DISubprogram::getLine()
1486 */
1488
1489/**
1490 * Replace the subprogram subroutine type.
1491 * \param Subprogram The subprogram object.
1492 * \param SubroutineType The new subroutine type.
1493 *
1494 * @see DISubprogram::replaceType()
1495 */
1497 LLVMMetadataRef SubroutineType);
1498
1499/**
1500 * Get the debug location for the given instruction.
1501 *
1502 * @see llvm::Instruction::getDebugLoc()
1503 */
1505
1506/**
1507 * Set the debug location for the given instruction.
1508 *
1509 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
1510 *
1511 * @see llvm::Instruction::setDebugLoc()
1512 */
1514 LLVMMetadataRef Loc);
1515
1516/**
1517 * Create a new descriptor for a label
1518 *
1519 * \param Builder The DIBuilder.
1520 * \param Scope The scope to create the label in.
1521 * \param Name Variable name.
1522 * \param NameLen Length of variable name.
1523 * \param File The file to create the label in.
1524 * \param LineNo Line Number.
1525 * \param AlwaysPreserve Preserve the label regardless of optimization.
1526 *
1527 * @see llvm::DIBuilder::createLabel()
1528 */
1531 const char *Name, size_t NameLen, LLVMMetadataRef File,
1532 unsigned LineNo, LLVMBool AlwaysPreserve);
1533
1534/**
1535 * Insert a new llvm.dbg.label intrinsic call
1536 *
1537 * \param Builder The DIBuilder.
1538 * \param LabelInfo The Label's debug info descriptor
1539 * \param Location The debug info location
1540 * \param InsertBefore Location for the new intrinsic.
1541 *
1542 * @see llvm::DIBuilder::insertLabel()
1543 */
1545 LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
1546 LLVMMetadataRef Location, LLVMValueRef InsertBefore);
1547
1548/**
1549 * Insert a new llvm.dbg.label intrinsic call
1550 *
1551 * \param Builder The DIBuilder.
1552 * \param LabelInfo The Label's debug info descriptor
1553 * \param Location The debug info location
1554 * \param InsertAtEnd Location for the new intrinsic.
1555 *
1556 * @see llvm::DIBuilder::insertLabel()
1557 */
1559 LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
1560 LLVMMetadataRef Location, LLVMBasicBlockRef InsertAtEnd);
1561
1562/**
1563 * Obtain the enumerated type of a Metadata instance.
1564 *
1565 * @see llvm::Metadata::getMetadataID()
1566 */
1568
1569/**
1570 * @}
1571 */
1572
1574
1575#endif
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:232
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:220
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:164
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:225
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:215
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:184
@ LLVMDIFixedPointTypeMetadataKind
Definition DebugInfo.h:213
@ LLVMDISubrangeTypeMetadataKind
Definition DebugInfo.h:212
@ LLVMDIDerivedTypeMetadataKind
Definition DebugInfo.h:188
@ LLVMDIMacroMetadataKind
Definition DebugInfo.h:205
@ LLVMDILexicalBlockMetadataKind
Definition DebugInfo.h:194
@ LLVMMDTupleMetadataKind
Definition DebugInfo.h:180
@ LLVMDIExpressionMetadataKind
Definition DebugInfo.h:182
@ LLVMDIGlobalVariableExpressionMetadataKind
Definition DebugInfo.h:183
@ LLVMLocalAsMetadataMetadataKind
Definition DebugInfo.h:178
@ LLVMDILocalVariableMetadataKind
Definition DebugInfo.h:201
@ LLVMDILocationMetadataKind
Definition DebugInfo.h:181
@ LLVMDistinctMDOperandPlaceholderMetadataKind
Definition DebugInfo.h:179
@ LLVMDILexicalBlockFileMetadataKind
Definition DebugInfo.h:195
@ LLVMDIMacroFileMetadataKind
Definition DebugInfo.h:206
@ LLVMDIArgListMetadataKind
Definition DebugInfo.h:210
@ LLVMDITemplateTypeParameterMetadataKind
Definition DebugInfo.h:198
@ LLVMDIImportedEntityMetadataKind
Definition DebugInfo.h:204
@ LLVMDIGlobalVariableMetadataKind
Definition DebugInfo.h:200
@ LLVMDIAssignIDMetadataKind
Definition DebugInfo.h:211
@ LLVMDISubrangeMetadataKind
Definition DebugInfo.h:185
@ LLVMDITemplateValueParameterMetadataKind
Definition DebugInfo.h:199
@ LLVMDIObjCPropertyMetadataKind
Definition DebugInfo.h:203
@ LLVMDINamespaceMetadataKind
Definition DebugInfo.h:196
@ LLVMDIGenericSubrangeMetadataKind
Definition DebugInfo.h:209
@ LLVMDICompileUnitMetadataKind
Definition DebugInfo.h:192
@ LLVMDICompositeTypeMetadataKind
Definition DebugInfo.h:189
@ LLVMMDStringMetadataKind
Definition DebugInfo.h:176
@ LLVMDIEnumeratorMetadataKind
Definition DebugInfo.h:186
@ LLVMDIFileMetadataKind
Definition DebugInfo.h:191
@ LLVMDIModuleMetadataKind
Definition DebugInfo.h:197
@ LLVMDIBasicTypeMetadataKind
Definition DebugInfo.h:187
@ LLVMConstantAsMetadataMetadataKind
Definition DebugInfo.h:177
@ LLVMDIStringTypeMetadataKind
Definition DebugInfo.h:208
@ LLVMDICommonBlockMetadataKind
Definition DebugInfo.h:207
@ LLVMDILabelMetadataKind
Definition DebugInfo.h:202
@ LLVMDISubprogramMetadataKind
Definition DebugInfo.h:193
@ LLVMDISubroutineTypeMetadataKind
Definition DebugInfo.h:190
@ LLVMDWARFMacinfoRecordTypeStartFile
Definition DebugInfo.h:235
@ LLVMDWARFMacinfoRecordTypeVendorExt
Definition DebugInfo.h:237
@ LLVMDWARFMacinfoRecordTypeEndFile
Definition DebugInfo.h:236
@ LLVMDWARFMacinfoRecordTypeMacro
Definition DebugInfo.h:234
@ LLVMDWARFMacinfoRecordTypeDefine
Definition DebugInfo.h:233
@ LLVMDWARFSourceLanguageBLISS
Definition DebugInfo.h:119
@ LLVMDWARFSourceLanguageJava
Definition DebugInfo.h:91
@ LLVMDWARFSourceLanguageGOOGLE_RenderScript
Definition DebugInfo.h:157
@ 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:158
@ LLVMDWARFSourceLanguageFortran77
Definition DebugInfo.h:86
@ LLVMDWARFSourceLanguageC23
Definition DebugInfo.h:146
@ LLVMDWARFSourceLanguageMips_Assembler
Definition DebugInfo.h:156
@ 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
@ 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:220
@ CSK_SHA256
Definition DebugInfo.h:220
@ CSK_MD5
Definition DebugInfo.h:220
@ LLVMDWARFEmissionLineTablesOnly
Definition DebugInfo.h:167
@ LLVMDWARFEmissionFull
Definition DebugInfo.h:166
@ LLVMDWARFEmissionNone
Definition DebugInfo.h:165
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