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