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