Index.odin (199278B)
1 /*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\ 2 |* *| 3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| 4 |* Exceptions. *| 5 |* See https://llvm.org/LICENSE.txt for license information. *| 6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| 7 |* *| 8 |*===----------------------------------------------------------------------===*| 9 |* *| 10 |* This header provides a public interface to a Clang library for extracting *| 11 |* high-level symbol information from source files without exposing the full *| 12 |* Clang C++ API. *| 13 |* *| 14 \*===----------------------------------------------------------------------===*/ 15 package libclang 16 17 import "core:c" 18 19 _ :: c 20 21 when ODIN_OS == .Windows { 22 @(extra_linker_flags="/NODEFAULTLIB:libcmt") 23 foreign import lib { 24 "system:ntdll.lib", 25 "system:ucrt.lib", 26 "system:msvcrt.lib", 27 "system:legacy_stdio_definitions.lib", 28 "system:kernel32.lib", 29 "system:user32.lib", 30 "system:advapi32.lib", 31 "system:shell32.lib", 32 "system:ole32.lib", 33 "system:oleaut32.lib", 34 "system:uuid.lib", 35 "system:ws2_32.lib", 36 "system:version.lib", 37 "system:oldnames.lib", 38 "libclang.lib", 39 } 40 } else { 41 foreign import lib "system:clang" 42 } 43 44 // LLVM_CLANG_C_INDEX_H :: 45 46 CINDEX_VERSION_MAJOR :: 0 47 CINDEX_VERSION_MINOR :: 64 48 49 // CINDEX_VERSION :: 50 51 // CINDEX_VERSION_STRING :: 52 53 /** 54 * An "index" that consists of a set of translation units that would 55 * typically be linked together into an executable or library. 56 */ 57 Index :: rawptr 58 59 /** 60 * An opaque type representing target information for a given translation 61 * unit. 62 */ 63 Target_Info :: rawptr 64 65 /** 66 * A single translation unit, which resides in an index. 67 */ 68 Translation_Unit :: rawptr 69 70 /** 71 * Opaque pointer representing client data that will be passed through 72 * to various callbacks and visitors. 73 */ 74 Client_Data :: rawptr 75 76 /** 77 * Provides the contents of a file that has not yet been saved to disk. 78 * 79 * Each CXUnsavedFile instance provides the name of a file on the 80 * system along with the current contents of that file that have not 81 * yet been saved to disk. 82 */ 83 Unsaved_File :: struct { 84 /** 85 * The file whose contents have not yet been saved. 86 * 87 * This file must already exist in the file system. 88 */ 89 Filename: cstring, 90 91 /** 92 * A buffer containing the unsaved contents of this file. 93 */ 94 Contents: cstring, 95 96 /** 97 * The length of the unsaved contents of this buffer. 98 */ 99 Length: c.ulong, 100 } 101 102 /** 103 * Describes the availability of a particular entity, which indicates 104 * whether the use of this entity will result in a warning or error due to 105 * it being deprecated or unavailable. 106 */ 107 Availability_Kind :: enum c.int { 108 /** 109 * The entity is available. 110 */ 111 Available, 112 113 /** 114 * The entity is available, but has been deprecated (and its use is 115 * not recommended). 116 */ 117 Deprecated, 118 119 /** 120 * The entity is not available; any use of it will be an error. 121 */ 122 NotAvailable, 123 124 /** 125 * The entity is available, but not accessible; any use of it will be 126 * an error. 127 */ 128 NotAccessible, 129 } 130 131 /** 132 * Describes a version number of the form major.minor.subminor. 133 */ 134 Version :: struct { 135 /** 136 * The major version number, e.g., the '10' in '10.7.3'. A negative 137 * value indicates that there is no version number at all. 138 */ 139 Major: c.int, 140 141 /** 142 * The minor version number, e.g., the '7' in '10.7.3'. This value 143 * will be negative if no minor version number was provided, e.g., for 144 * version '10'. 145 */ 146 Minor: c.int, 147 148 /** 149 * The subminor version number, e.g., the '3' in '10.7.3'. This value 150 * will be negative if no minor or subminor version number was provided, 151 * e.g., in version '10' or '10.7'. 152 */ 153 Subminor: c.int, 154 } 155 156 /** 157 * Describes the exception specification of a cursor. 158 * 159 * A negative value indicates that the cursor is not a function declaration. 160 */ 161 Cursor_Exception_Specification_Kind :: enum c.int { 162 /** 163 * The cursor has no exception specification. 164 */ 165 None, 166 167 /** 168 * The cursor has exception specification throw() 169 */ 170 DynamicNone, 171 172 /** 173 * The cursor has exception specification throw(T1, T2) 174 */ 175 Dynamic, 176 177 /** 178 * The cursor has exception specification throw(...). 179 */ 180 MSAny, 181 182 /** 183 * The cursor has exception specification basic noexcept. 184 */ 185 BasicNoexcept, 186 187 /** 188 * The cursor has exception specification computed noexcept. 189 */ 190 ComputedNoexcept, 191 192 /** 193 * The exception specification has not yet been evaluated. 194 */ 195 Unevaluated, 196 197 /** 198 * The exception specification has not yet been instantiated. 199 */ 200 Uninstantiated, 201 202 /** 203 * The exception specification has not been parsed yet. 204 */ 205 Unparsed, 206 207 /** 208 * The cursor has a __declspec(nothrow) exception specification. 209 */ 210 NoThrow, 211 } 212 213 Choice :: enum c.int { 214 /** 215 * Use the default value of an option that may depend on the process 216 * environment. 217 */ 218 Default, 219 220 /** 221 * Enable the option. 222 */ 223 Enabled, 224 225 /** 226 * Disable the option. 227 */ 228 Disabled, 229 } 230 231 Global_Opt_Flags :: enum c.int { 232 /** 233 * Used to indicate that no special CXIndex options are needed. 234 */ 235 None, 236 237 /** 238 * Used to indicate that threads that libclang creates for indexing 239 * purposes should use background priority. 240 * 241 * Affects #clang_indexSourceFile, #clang_indexTranslationUnit, 242 * #clang_parseTranslationUnit, #clang_saveTranslationUnit. 243 */ 244 ThreadBackgroundPriorityForIndexing, 245 246 /** 247 * Used to indicate that threads that libclang creates for editing 248 * purposes should use background priority. 249 * 250 * Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, 251 * #clang_annotateTokens 252 */ 253 ThreadBackgroundPriorityForEditing, 254 255 /** 256 * Used to indicate that all threads that libclang creates should use 257 * background priority. 258 */ 259 ThreadBackgroundPriorityForAll, 260 } 261 262 /** 263 * Index initialization options. 264 * 265 * 0 is the default value of each member of this struct except for Size. 266 * Initialize the struct in one of the following three ways to avoid adapting 267 * code each time a new member is added to it: 268 * \code 269 * CXIndexOptions Opts; 270 * memset(&Opts, 0, sizeof(Opts)); 271 * Opts.Size = sizeof(CXIndexOptions); 272 * \endcode 273 * or explicitly initialize the first data member and zero-initialize the rest: 274 * \code 275 * CXIndexOptions Opts = { sizeof(CXIndexOptions) }; 276 * \endcode 277 * or to prevent the -Wmissing-field-initializers warning for the above version: 278 * \code 279 * CXIndexOptions Opts{}; 280 * Opts.Size = sizeof(CXIndexOptions); 281 * \endcode 282 */ 283 Index_Options :: struct { 284 /** 285 * The size of struct CXIndexOptions used for option versioning. 286 * 287 * Always initialize this member to sizeof(CXIndexOptions), or assign 288 * sizeof(CXIndexOptions) to it right after creating a CXIndexOptions object. 289 */ 290 Size: c.uint, 291 292 /** 293 * A CXChoice enumerator that specifies the indexing priority policy. 294 * \sa CXGlobalOpt_ThreadBackgroundPriorityForIndexing 295 */ 296 ThreadBackgroundPriorityForIndexing: c.uchar, 297 298 /** 299 * A CXChoice enumerator that specifies the editing priority policy. 300 * \sa CXGlobalOpt_ThreadBackgroundPriorityForEditing 301 */ 302 ThreadBackgroundPriorityForEditing: c.uchar, 303 304 /** 305 * \see clang_createIndex() 306 */ 307 using _: bit_field u16 { 308 ExcludeDeclarationsFromPCH: u16 | 1, 309 DisplayDiagnostics: u16 | 1, 310 StorePreamblesInMemory: u16 | 1, 311 _: u16 | 13, /*Reserved*/ 312 }, 313 314 /** 315 * The path to a directory, in which to store temporary PCH files. If null or 316 * empty, the default system temporary directory is used. These PCH files are 317 * deleted on clean exit but stay on disk if the program crashes or is killed. 318 * 319 * This option is ignored if \a StorePreamblesInMemory is non-zero. 320 * 321 * Libclang does not create the directory at the specified path in the file 322 * system. Therefore it must exist, or storing PCH files will fail. 323 */ 324 PreambleStoragePath: cstring, 325 326 /** 327 * Specifies a path which will contain log files for certain libclang 328 * invocations. A null value implies that libclang invocations are not logged. 329 */ 330 InvocationEmissionPath: cstring, 331 } 332 333 /** 334 * Flags that control the creation of translation units. 335 * 336 * The enumerators in this enumeration type are meant to be bitwise 337 * ORed together to specify which options should be used when 338 * constructing the translation unit. 339 */ 340 Translation_Unit_Flag :: enum c.int { 341 /** 342 * Used to indicate that the parser should construct a "detailed" 343 * preprocessing record, including all macro definitions and instantiations. 344 * 345 * Constructing a detailed preprocessing record requires more memory 346 * and time to parse, since the information contained in the record 347 * is usually not retained. However, it can be useful for 348 * applications that require more detailed information about the 349 * behavior of the preprocessor. 350 */ 351 DetailedPreprocessingRecord, 352 353 /** 354 * Used to indicate that the translation unit is incomplete. 355 * 356 * When a translation unit is considered "incomplete", semantic 357 * analysis that is typically performed at the end of the 358 * translation unit will be suppressed. For example, this suppresses 359 * the completion of tentative declarations in C and of 360 * instantiation of implicitly-instantiation function templates in 361 * C++. This option is typically used when parsing a header with the 362 * intent of producing a precompiled header. 363 */ 364 Incomplete, 365 366 /** 367 * Used to indicate that the translation unit should be built with an 368 * implicit precompiled header for the preamble. 369 * 370 * An implicit precompiled header is used as an optimization when a 371 * particular translation unit is likely to be reparsed many times 372 * when the sources aren't changing that often. In this case, an 373 * implicit precompiled header will be built containing all of the 374 * initial includes at the top of the main file (what we refer to as 375 * the "preamble" of the file). In subsequent parses, if the 376 * preamble or the files in it have not changed, \c 377 * clang_reparseTranslationUnit() will re-use the implicit 378 * precompiled header to improve parsing performance. 379 */ 380 PrecompiledPreamble, 381 382 /** 383 * Used to indicate that the translation unit should cache some 384 * code-completion results with each reparse of the source file. 385 * 386 * Caching of code-completion results is a performance optimization that 387 * introduces some overhead to reparsing but improves the performance of 388 * code-completion operations. 389 */ 390 CacheCompletionResults, 391 392 /** 393 * Used to indicate that the translation unit will be serialized with 394 * \c clang_saveTranslationUnit. 395 * 396 * This option is typically used when parsing a header with the intent of 397 * producing a precompiled header. 398 */ 399 ForSerialization, 400 401 /** 402 * DEPRECATED: Enabled chained precompiled preambles in C++. 403 * 404 * Note: this is a *temporary* option that is available only while 405 * we are testing C++ precompiled preamble support. It is deprecated. 406 */ 407 CXXChainedPCH, 408 409 /** 410 * Used to indicate that function/method bodies should be skipped while 411 * parsing. 412 * 413 * This option can be used to search for declarations/definitions while 414 * ignoring the usages. 415 */ 416 SkipFunctionBodies, 417 418 /** 419 * Used to indicate that brief documentation comments should be 420 * included into the set of code completions returned from this translation 421 * unit. 422 */ 423 IncludeBriefCommentsInCodeCompletion, 424 425 /** 426 * Used to indicate that the precompiled preamble should be created on 427 * the first parse. Otherwise it will be created on the first reparse. This 428 * trades runtime on the first parse (serializing the preamble takes time) for 429 * reduced runtime on the second parse (can now reuse the preamble). 430 */ 431 CreatePreambleOnFirstParse, 432 433 /** 434 * Do not stop processing when fatal errors are encountered. 435 * 436 * When fatal errors are encountered while parsing a translation unit, 437 * semantic analysis is typically stopped early when compiling code. A common 438 * source for fatal errors are unresolvable include files. For the 439 * purposes of an IDE, this is undesirable behavior and as much information 440 * as possible should be reported. Use this flag to enable this behavior. 441 */ 442 KeepGoing, 443 444 /** 445 * Sets the preprocessor in a mode for parsing a single file only. 446 */ 447 SingleFileParse, 448 449 /** 450 * Used in combination with CXTranslationUnit_SkipFunctionBodies to 451 * constrain the skipping of function bodies to the preamble. 452 * 453 * The function bodies of the main file are not skipped. 454 */ 455 LimitSkipFunctionBodiesToPreamble, 456 457 /** 458 * Used to indicate that attributed types should be included in CXType. 459 */ 460 IncludeAttributedTypes, 461 462 /** 463 * Used to indicate that implicit attributes should be visited. 464 */ 465 VisitImplicitAttributes, 466 467 /** 468 * Used to indicate that non-errors from included files should be ignored. 469 * 470 * If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from 471 * included files anymore. This speeds up clang_getDiagnosticSetFromTU() for 472 * the case where these warnings are not of interest, as for an IDE for 473 * example, which typically shows only the diagnostics in the main file. 474 */ 475 IgnoreNonErrorsFromIncludedFiles, 476 477 /** 478 * Tells the preprocessor not to skip excluded conditional blocks. 479 */ 480 RetainExcludedConditionalBlocks, 481 } 482 483 Translation_Unit_Flags :: distinct bit_set[Translation_Unit_Flag; c.int] 484 485 /** 486 * Flags that control how translation units are saved. 487 * 488 * The enumerators in this enumeration type are meant to be bitwise 489 * ORed together to specify which options should be used when 490 * saving the translation unit. 491 */ 492 Save_Translation_Unit_Flag :: enum c.int { 493 } 494 495 Save_Translation_Unit_Flags :: distinct bit_set[Save_Translation_Unit_Flag; c.int] 496 497 /** 498 * Describes the kind of error that occurred (if any) in a call to 499 * \c clang_saveTranslationUnit(). 500 */ 501 Save_Error :: enum c.int { 502 /** 503 * Indicates that no error occurred while saving a translation unit. 504 */ 505 None, 506 507 /** 508 * Indicates that an unknown error occurred while attempting to save 509 * the file. 510 * 511 * This error typically indicates that file I/O failed when attempting to 512 * write the file. 513 */ 514 Unknown, 515 516 /** 517 * Indicates that errors during translation prevented this attempt 518 * to save the translation unit. 519 * 520 * Errors that prevent the translation unit from being saved can be 521 * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic(). 522 */ 523 TranslationErrors, 524 525 /** 526 * Indicates that the translation unit to be saved was somehow 527 * invalid (e.g., NULL). 528 */ 529 InvalidTU, 530 } 531 532 /** 533 * Flags that control the reparsing of translation units. 534 * 535 * The enumerators in this enumeration type are meant to be bitwise 536 * ORed together to specify which options should be used when 537 * reparsing the translation unit. 538 */ 539 Reparse_Flags :: enum c.int { 540 /** 541 * Used to indicate that no special reparsing options are needed. 542 */ 543 CXReparse_None, 544 } 545 546 /** 547 * Categorizes how memory is being used by a translation unit. 548 */ 549 Turesource_Usage_Kind :: enum c.int { 550 AST = 1, 551 Identifiers = 2, 552 Selectors = 3, 553 GlobalCompletionResults = 4, 554 SourceManagerContentCache = 5, 555 AST_SideTables = 6, 556 SourceManager_Membuffer_Malloc = 7, 557 SourceManager_Membuffer_MMap = 8, 558 ExternalASTSource_Membuffer_Malloc = 9, 559 ExternalASTSource_Membuffer_MMap = 10, 560 Preprocessor = 11, 561 PreprocessingRecord = 12, 562 SourceManager_DataStructures = 13, 563 Preprocessor_HeaderSearch = 14, 564 MEMORY_IN_BYTES_BEGIN = 1, 565 MEMORY_IN_BYTES_END = 14, 566 First = 1, 567 Last = 14, 568 } 569 570 Turesource_Usage_Entry :: struct { 571 /* The memory usage category. */ 572 kind: Turesource_Usage_Kind, 573 574 /* Amount of resources used. 575 The units will depend on the resource kind. */ 576 amount: c.ulong, 577 } 578 579 /** 580 * The memory usage of a CXTranslationUnit, broken into categories. 581 */ 582 Turesource_Usage :: struct { 583 /* Private data member, used for queries. */ 584 data: rawptr, 585 586 /* The number of entries in the 'entries' array. */ 587 numEntries: c.uint, 588 589 /* An array of key-value pairs, representing the breakdown of memory 590 usage. */ 591 entries: ^Turesource_Usage_Entry, 592 } 593 594 /** 595 * Describes the kind of entity that a cursor refers to. 596 */ 597 Cursor_Kind :: enum c.int { 598 /* Declarations */ 599 /** 600 * A declaration whose specific kind is not exposed via this 601 * interface. 602 * 603 * Unexposed declarations have the same operations as any other kind 604 * of declaration; one can extract their location information, 605 * spelling, find their definitions, etc. However, the specific kind 606 * of the declaration is not reported. 607 */ 608 UnexposedDecl = 1, 609 610 /** A C or C++ struct. */ 611 StructDecl = 2, 612 613 /** A C or C++ union. */ 614 UnionDecl = 3, 615 616 /** A C++ class. */ 617 ClassDecl = 4, 618 619 /** An enumeration. */ 620 EnumDecl = 5, 621 622 /** 623 * A field (in C) or non-static data member (in C++) in a 624 * struct, union, or C++ class. 625 */ 626 FieldDecl = 6, 627 628 /** An enumerator constant. */ 629 EnumConstantDecl = 7, 630 631 /** A function. */ 632 FunctionDecl = 8, 633 634 /** A variable. */ 635 VarDecl = 9, 636 637 /** A function or method parameter. */ 638 ParmDecl = 10, 639 640 /** An Objective-C \@interface. */ 641 ObjCInterfaceDecl = 11, 642 643 /** An Objective-C \@interface for a category. */ 644 ObjCCategoryDecl = 12, 645 646 /** An Objective-C \@protocol declaration. */ 647 ObjCProtocolDecl = 13, 648 649 /** An Objective-C \@property declaration. */ 650 ObjCPropertyDecl = 14, 651 652 /** An Objective-C instance variable. */ 653 ObjCIvarDecl = 15, 654 655 /** An Objective-C instance method. */ 656 ObjCInstanceMethodDecl = 16, 657 658 /** An Objective-C class method. */ 659 ObjCClassMethodDecl = 17, 660 661 /** An Objective-C \@implementation. */ 662 ObjCImplementationDecl = 18, 663 664 /** An Objective-C \@implementation for a category. */ 665 ObjCCategoryImplDecl = 19, 666 667 /** A typedef. */ 668 TypedefDecl = 20, 669 670 /** A C++ class method. */ 671 CXXMethod = 21, 672 673 /** A C++ namespace. */ 674 Namespace = 22, 675 676 /** A linkage specification, e.g. 'extern "C"'. */ 677 LinkageSpec = 23, 678 679 /** A C++ constructor. */ 680 Constructor = 24, 681 682 /** A C++ destructor. */ 683 Destructor = 25, 684 685 /** A C++ conversion function. */ 686 ConversionFunction = 26, 687 688 /** A C++ template type parameter. */ 689 TemplateTypeParameter = 27, 690 691 /** A C++ non-type template parameter. */ 692 NonTypeTemplateParameter = 28, 693 694 /** A C++ template template parameter. */ 695 TemplateTemplateParameter = 29, 696 697 /** A C++ function template. */ 698 FunctionTemplate = 30, 699 700 /** A C++ class template. */ 701 ClassTemplate = 31, 702 703 /** A C++ class template partial specialization. */ 704 ClassTemplatePartialSpecialization = 32, 705 706 /** A C++ namespace alias declaration. */ 707 NamespaceAlias = 33, 708 709 /** A C++ using directive. */ 710 UsingDirective = 34, 711 712 /** A C++ using declaration. */ 713 UsingDeclaration = 35, 714 715 /** A C++ alias declaration */ 716 TypeAliasDecl = 36, 717 718 /** An Objective-C \@synthesize definition. */ 719 ObjCSynthesizeDecl = 37, 720 721 /** An Objective-C \@dynamic definition. */ 722 ObjCDynamicDecl = 38, 723 724 /** An access specifier. */ 725 CXXAccessSpecifier = 39, 726 727 /** An access specifier. */ 728 FirstDecl = 1, 729 730 /** An access specifier. */ 731 LastDecl = 39, 732 FirstRef = 40, /* Decl references */ 733 ObjCSuperClassRef = 40, 734 ObjCProtocolRef = 41, 735 ObjCClassRef = 42, 736 737 /** 738 * A reference to a type declaration. 739 * 740 * A type reference occurs anywhere where a type is named but not 741 * declared. For example, given: 742 * 743 * \code 744 * typedef unsigned size_type; 745 * size_type size; 746 * \endcode 747 * 748 * The typedef is a declaration of size_type (CXCursor_TypedefDecl), 749 * while the type of the variable "size" is referenced. The cursor 750 * referenced by the type of size is the typedef for size_type. 751 */ 752 TypeRef = 43, 753 754 /** 755 * A reference to a type declaration. 756 * 757 * A type reference occurs anywhere where a type is named but not 758 * declared. For example, given: 759 * 760 * \code 761 * typedef unsigned size_type; 762 * size_type size; 763 * \endcode 764 * 765 * The typedef is a declaration of size_type (CXCursor_TypedefDecl), 766 * while the type of the variable "size" is referenced. The cursor 767 * referenced by the type of size is the typedef for size_type. 768 */ 769 CXXBaseSpecifier = 44, 770 771 /** 772 * A reference to a class template, function template, template 773 * template parameter, or class template partial specialization. 774 */ 775 TemplateRef = 45, 776 777 /** 778 * A reference to a namespace or namespace alias. 779 */ 780 NamespaceRef = 46, 781 782 /** 783 * A reference to a member of a struct, union, or class that occurs in 784 * some non-expression context, e.g., a designated initializer. 785 */ 786 MemberRef = 47, 787 788 /** 789 * A reference to a labeled statement. 790 * 791 * This cursor kind is used to describe the jump to "start_over" in the 792 * goto statement in the following example: 793 * 794 * \code 795 * start_over: 796 * ++counter; 797 * 798 * goto start_over; 799 * \endcode 800 * 801 * A label reference cursor refers to a label statement. 802 */ 803 LabelRef = 48, 804 805 /** 806 * A reference to a set of overloaded functions or function templates 807 * that has not yet been resolved to a specific function or function template. 808 * 809 * An overloaded declaration reference cursor occurs in C++ templates where 810 * a dependent name refers to a function. For example: 811 * 812 * \code 813 * template<typename T> void swap(T&, T&); 814 * 815 * struct X { ... }; 816 * void swap(X&, X&); 817 * 818 * template<typename T> 819 * void reverse(T* first, T* last) { 820 * while (first < last - 1) { 821 * swap(*first, *--last); 822 * ++first; 823 * } 824 * } 825 * 826 * struct Y { }; 827 * void swap(Y&, Y&); 828 * \endcode 829 * 830 * Here, the identifier "swap" is associated with an overloaded declaration 831 * reference. In the template definition, "swap" refers to either of the two 832 * "swap" functions declared above, so both results will be available. At 833 * instantiation time, "swap" may also refer to other functions found via 834 * argument-dependent lookup (e.g., the "swap" function at the end of the 835 * example). 836 * 837 * The functions \c clang_getNumOverloadedDecls() and 838 * \c clang_getOverloadedDecl() can be used to retrieve the definitions 839 * referenced by this cursor. 840 */ 841 OverloadedDeclRef = 49, 842 843 /** 844 * A reference to a variable that occurs in some non-expression 845 * context, e.g., a C++ lambda capture list. 846 */ 847 VariableRef = 50, 848 849 /** 850 * A reference to a variable that occurs in some non-expression 851 * context, e.g., a C++ lambda capture list. 852 */ 853 LastRef = 50, 854 855 /* Error conditions */ 856 FirstInvalid = 70, 857 858 /* Error conditions */ 859 InvalidFile = 70, 860 861 /* Error conditions */ 862 NoDeclFound = 71, 863 864 /* Error conditions */ 865 NotImplemented = 72, 866 867 /* Error conditions */ 868 InvalidCode = 73, 869 870 /* Error conditions */ 871 LastInvalid = 73, 872 873 /* Expressions */ 874 FirstExpr = 100, 875 876 /** 877 * An expression whose specific kind is not exposed via this 878 * interface. 879 * 880 * Unexposed expressions have the same operations as any other kind 881 * of expression; one can extract their location information, 882 * spelling, children, etc. However, the specific kind of the 883 * expression is not reported. 884 */ 885 UnexposedExpr = 100, 886 887 /** 888 * An expression that refers to some value declaration, such 889 * as a function, variable, or enumerator. 890 */ 891 DeclRefExpr = 101, 892 893 /** 894 * An expression that refers to a member of a struct, union, 895 * class, Objective-C class, etc. 896 */ 897 MemberRefExpr = 102, 898 899 /** An expression that calls a function. */ 900 CallExpr = 103, 901 902 /** An expression that sends a message to an Objective-C 903 object or class. */ 904 ObjCMessageExpr = 104, 905 906 /** An expression that represents a block literal. */ 907 BlockExpr = 105, 908 909 /** An integer literal. 910 */ 911 IntegerLiteral = 106, 912 913 /** A floating point number literal. 914 */ 915 FloatingLiteral = 107, 916 917 /** An imaginary number literal. 918 */ 919 ImaginaryLiteral = 108, 920 921 /** A string literal. 922 */ 923 StringLiteral = 109, 924 925 /** A character literal. 926 */ 927 CharacterLiteral = 110, 928 929 /** A parenthesized expression, e.g. "(1)". 930 * 931 * This AST node is only formed if full location information is requested. 932 */ 933 ParenExpr = 111, 934 935 /** This represents the unary-expression's (except sizeof and 936 * alignof). 937 */ 938 UnaryOperator = 112, 939 940 /** [C99 6.5.2.1] Array Subscripting. 941 */ 942 ArraySubscriptExpr = 113, 943 944 /** A builtin binary operation expression such as "x + y" or 945 * "x <= y". 946 */ 947 BinaryOperator = 114, 948 949 /** Compound assignment such as "+=". 950 */ 951 CompoundAssignOperator = 115, 952 953 /** The ?: ternary operator. 954 */ 955 ConditionalOperator = 116, 956 957 /** An explicit cast in C (C99 6.5.4) or a C-style cast in C++ 958 * (C++ [expr.cast]), which uses the syntax (Type)expr. 959 * 960 * For example: (int)f. 961 */ 962 CStyleCastExpr = 117, 963 964 /** [C99 6.5.2.5] 965 */ 966 CompoundLiteralExpr = 118, 967 968 /** Describes an C or C++ initializer list. 969 */ 970 InitListExpr = 119, 971 972 /** The GNU address of label extension, representing &&label. 973 */ 974 AddrLabelExpr = 120, 975 976 /** This is the GNU Statement Expression extension: ({int X=4; X;}) 977 */ 978 StmtExpr = 121, 979 980 /** Represents a C11 generic selection. 981 */ 982 GenericSelectionExpr = 122, 983 984 /** Implements the GNU __null extension, which is a name for a null 985 * pointer constant that has integral type (e.g., int or long) and is the same 986 * size and alignment as a pointer. 987 * 988 * The __null extension is typically only used by system headers, which define 989 * NULL as __null in C++ rather than using 0 (which is an integer that may not 990 * match the size of a pointer). 991 */ 992 GNUNullExpr = 123, 993 994 /** C++'s static_cast<> expression. 995 */ 996 CXXStaticCastExpr = 124, 997 998 /** C++'s dynamic_cast<> expression. 999 */ 1000 CXXDynamicCastExpr = 125, 1001 1002 /** C++'s reinterpret_cast<> expression. 1003 */ 1004 CXXReinterpretCastExpr = 126, 1005 1006 /** C++'s const_cast<> expression. 1007 */ 1008 CXXConstCastExpr = 127, 1009 1010 /** Represents an explicit C++ type conversion that uses "functional" 1011 * notion (C++ [expr.type.conv]). 1012 * 1013 * Example: 1014 * \code 1015 * x = int(0.5); 1016 * \endcode 1017 */ 1018 CXXFunctionalCastExpr = 128, 1019 1020 /** A C++ typeid expression (C++ [expr.typeid]). 1021 */ 1022 CXXTypeidExpr = 129, 1023 1024 /** [C++ 2.13.5] C++ Boolean Literal. 1025 */ 1026 CXXBoolLiteralExpr = 130, 1027 1028 /** [C++0x 2.14.7] C++ Pointer Literal. 1029 */ 1030 CXXNullPtrLiteralExpr = 131, 1031 1032 /** Represents the "this" expression in C++ 1033 */ 1034 CXXThisExpr = 132, 1035 1036 /** [C++ 15] C++ Throw Expression. 1037 * 1038 * This handles 'throw' and 'throw' assignment-expression. When 1039 * assignment-expression isn't present, Op will be null. 1040 */ 1041 CXXThrowExpr = 133, 1042 1043 /** A new expression for memory allocation and constructor calls, e.g: 1044 * "new CXXNewExpr(foo)". 1045 */ 1046 CXXNewExpr = 134, 1047 1048 /** A delete expression for memory deallocation and destructor calls, 1049 * e.g. "delete[] pArray". 1050 */ 1051 CXXDeleteExpr = 135, 1052 1053 /** A unary expression. (noexcept, sizeof, or other traits) 1054 */ 1055 UnaryExpr = 136, 1056 1057 /** An Objective-C string literal i.e. @"foo". 1058 */ 1059 ObjCStringLiteral = 137, 1060 1061 /** An Objective-C \@encode expression. 1062 */ 1063 ObjCEncodeExpr = 138, 1064 1065 /** An Objective-C \@selector expression. 1066 */ 1067 ObjCSelectorExpr = 139, 1068 1069 /** An Objective-C \@protocol expression. 1070 */ 1071 ObjCProtocolExpr = 140, 1072 1073 /** An Objective-C "bridged" cast expression, which casts between 1074 * Objective-C pointers and C pointers, transferring ownership in the process. 1075 * 1076 * \code 1077 * NSString *str = (__bridge_transfer NSString *)CFCreateString(); 1078 * \endcode 1079 */ 1080 ObjCBridgedCastExpr = 141, 1081 1082 /** Represents a C++0x pack expansion that produces a sequence of 1083 * expressions. 1084 * 1085 * A pack expansion expression contains a pattern (which itself is an 1086 * expression) followed by an ellipsis. For example: 1087 * 1088 * \code 1089 * template<typename F, typename ...Types> 1090 * void forward(F f, Types &&...args) { 1091 * f(static_cast<Types&&>(args)...); 1092 * } 1093 * \endcode 1094 */ 1095 PackExpansionExpr = 142, 1096 1097 /** Represents an expression that computes the length of a parameter 1098 * pack. 1099 * 1100 * \code 1101 * template<typename ...Types> 1102 * struct count { 1103 * static const unsigned value = sizeof...(Types); 1104 * }; 1105 * \endcode 1106 */ 1107 SizeOfPackExpr = 143, 1108 1109 /* Represents a C++ lambda expression that produces a local function 1110 * object. 1111 * 1112 * \code 1113 * void abssort(float *x, unsigned N) { 1114 * std::sort(x, x + N, 1115 * [](float a, float b) { 1116 * return std::abs(a) < std::abs(b); 1117 * }); 1118 * } 1119 * \endcode 1120 */ 1121 LambdaExpr = 144, 1122 1123 /** Objective-c Boolean Literal. 1124 */ 1125 ObjCBoolLiteralExpr = 145, 1126 1127 /** Represents the "self" expression in an Objective-C method. 1128 */ 1129 ObjCSelfExpr = 146, 1130 1131 /** OpenMP 5.0 [2.1.5, Array Section]. 1132 * OpenACC 3.3 [2.7.1, Data Specification for Data Clauses (Sub Arrays)] 1133 */ 1134 ArraySectionExpr = 147, 1135 1136 /** Represents an @available(...) check. 1137 */ 1138 ObjCAvailabilityCheckExpr = 148, 1139 1140 /** 1141 * Fixed point literal 1142 */ 1143 FixedPointLiteral = 149, 1144 1145 /** OpenMP 5.0 [2.1.4, Array Shaping]. 1146 */ 1147 OMPArrayShapingExpr = 150, 1148 1149 /** 1150 * OpenMP 5.0 [2.1.6 Iterators] 1151 */ 1152 OMPIteratorExpr = 151, 1153 1154 /** OpenCL's addrspace_cast<> expression. 1155 */ 1156 CXXAddrspaceCastExpr = 152, 1157 1158 /** 1159 * Expression that references a C++20 concept. 1160 */ 1161 ConceptSpecializationExpr = 153, 1162 1163 /** 1164 * Expression that references a C++20 requires expression. 1165 */ 1166 RequiresExpr = 154, 1167 1168 /** 1169 * Expression that references a C++20 parenthesized list aggregate 1170 * initializer. 1171 */ 1172 CXXParenListInitExpr = 155, 1173 1174 /** 1175 * Represents a C++26 pack indexing expression. 1176 */ 1177 PackIndexingExpr = 156, 1178 1179 /** 1180 * Represents a C++26 pack indexing expression. 1181 */ 1182 LastExpr = 156, 1183 1184 /* Statements */ 1185 FirstStmt = 200, 1186 1187 /** 1188 * A statement whose specific kind is not exposed via this 1189 * interface. 1190 * 1191 * Unexposed statements have the same operations as any other kind of 1192 * statement; one can extract their location information, spelling, 1193 * children, etc. However, the specific kind of the statement is not 1194 * reported. 1195 */ 1196 UnexposedStmt = 200, 1197 1198 /** A labelled statement in a function. 1199 * 1200 * This cursor kind is used to describe the "start_over:" label statement in 1201 * the following example: 1202 * 1203 * \code 1204 * start_over: 1205 * ++counter; 1206 * \endcode 1207 * 1208 */ 1209 LabelStmt = 201, 1210 1211 /** A group of statements like { stmt stmt }. 1212 * 1213 * This cursor kind is used to describe compound statements, e.g. function 1214 * bodies. 1215 */ 1216 CompoundStmt = 202, 1217 1218 /** A case statement. 1219 */ 1220 CaseStmt = 203, 1221 1222 /** A default statement. 1223 */ 1224 DefaultStmt = 204, 1225 1226 /** An if statement 1227 */ 1228 IfStmt = 205, 1229 1230 /** A switch statement. 1231 */ 1232 SwitchStmt = 206, 1233 1234 /** A while statement. 1235 */ 1236 WhileStmt = 207, 1237 1238 /** A do statement. 1239 */ 1240 DoStmt = 208, 1241 1242 /** A for statement. 1243 */ 1244 ForStmt = 209, 1245 1246 /** A goto statement. 1247 */ 1248 GotoStmt = 210, 1249 1250 /** An indirect goto statement. 1251 */ 1252 IndirectGotoStmt = 211, 1253 1254 /** A continue statement. 1255 */ 1256 ContinueStmt = 212, 1257 1258 /** A break statement. 1259 */ 1260 BreakStmt = 213, 1261 1262 /** A return statement. 1263 */ 1264 ReturnStmt = 214, 1265 1266 /** A GCC inline assembly statement extension. 1267 */ 1268 GCCAsmStmt = 215, 1269 1270 /** A GCC inline assembly statement extension. 1271 */ 1272 AsmStmt = 215, 1273 1274 /** Objective-C's overall \@try-\@catch-\@finally statement. 1275 */ 1276 ObjCAtTryStmt = 216, 1277 1278 /** Objective-C's \@catch statement. 1279 */ 1280 ObjCAtCatchStmt = 217, 1281 1282 /** Objective-C's \@finally statement. 1283 */ 1284 ObjCAtFinallyStmt = 218, 1285 1286 /** Objective-C's \@throw statement. 1287 */ 1288 ObjCAtThrowStmt = 219, 1289 1290 /** Objective-C's \@synchronized statement. 1291 */ 1292 ObjCAtSynchronizedStmt = 220, 1293 1294 /** Objective-C's autorelease pool statement. 1295 */ 1296 ObjCAutoreleasePoolStmt = 221, 1297 1298 /** Objective-C's collection statement. 1299 */ 1300 ObjCForCollectionStmt = 222, 1301 1302 /** C++'s catch statement. 1303 */ 1304 CXXCatchStmt = 223, 1305 1306 /** C++'s try statement. 1307 */ 1308 CXXTryStmt = 224, 1309 1310 /** C++'s for (* : *) statement. 1311 */ 1312 CXXForRangeStmt = 225, 1313 1314 /** Windows Structured Exception Handling's try statement. 1315 */ 1316 SEHTryStmt = 226, 1317 1318 /** Windows Structured Exception Handling's except statement. 1319 */ 1320 SEHExceptStmt = 227, 1321 1322 /** Windows Structured Exception Handling's finally statement. 1323 */ 1324 SEHFinallyStmt = 228, 1325 1326 /** A MS inline assembly statement extension. 1327 */ 1328 MSAsmStmt = 229, 1329 1330 /** The null statement ";": C99 6.8.3p3. 1331 * 1332 * This cursor kind is used to describe the null statement. 1333 */ 1334 NullStmt = 230, 1335 1336 /** Adaptor class for mixing declarations with statements and 1337 * expressions. 1338 */ 1339 DeclStmt = 231, 1340 1341 /** OpenMP parallel directive. 1342 */ 1343 OMPParallelDirective = 232, 1344 1345 /** OpenMP SIMD directive. 1346 */ 1347 OMPSimdDirective = 233, 1348 1349 /** OpenMP for directive. 1350 */ 1351 OMPForDirective = 234, 1352 1353 /** OpenMP sections directive. 1354 */ 1355 OMPSectionsDirective = 235, 1356 1357 /** OpenMP section directive. 1358 */ 1359 OMPSectionDirective = 236, 1360 1361 /** OpenMP single directive. 1362 */ 1363 OMPSingleDirective = 237, 1364 1365 /** OpenMP parallel for directive. 1366 */ 1367 OMPParallelForDirective = 238, 1368 1369 /** OpenMP parallel sections directive. 1370 */ 1371 OMPParallelSectionsDirective = 239, 1372 1373 /** OpenMP task directive. 1374 */ 1375 OMPTaskDirective = 240, 1376 1377 /** OpenMP master directive. 1378 */ 1379 OMPMasterDirective = 241, 1380 1381 /** OpenMP critical directive. 1382 */ 1383 OMPCriticalDirective = 242, 1384 1385 /** OpenMP taskyield directive. 1386 */ 1387 OMPTaskyieldDirective = 243, 1388 1389 /** OpenMP barrier directive. 1390 */ 1391 OMPBarrierDirective = 244, 1392 1393 /** OpenMP taskwait directive. 1394 */ 1395 OMPTaskwaitDirective = 245, 1396 1397 /** OpenMP flush directive. 1398 */ 1399 OMPFlushDirective = 246, 1400 1401 /** Windows Structured Exception Handling's leave statement. 1402 */ 1403 SEHLeaveStmt = 247, 1404 1405 /** OpenMP ordered directive. 1406 */ 1407 OMPOrderedDirective = 248, 1408 1409 /** OpenMP atomic directive. 1410 */ 1411 OMPAtomicDirective = 249, 1412 1413 /** OpenMP for SIMD directive. 1414 */ 1415 OMPForSimdDirective = 250, 1416 1417 /** OpenMP parallel for SIMD directive. 1418 */ 1419 OMPParallelForSimdDirective = 251, 1420 1421 /** OpenMP target directive. 1422 */ 1423 OMPTargetDirective = 252, 1424 1425 /** OpenMP teams directive. 1426 */ 1427 OMPTeamsDirective = 253, 1428 1429 /** OpenMP taskgroup directive. 1430 */ 1431 OMPTaskgroupDirective = 254, 1432 1433 /** OpenMP cancellation point directive. 1434 */ 1435 OMPCancellationPointDirective = 255, 1436 1437 /** OpenMP cancel directive. 1438 */ 1439 OMPCancelDirective = 256, 1440 1441 /** OpenMP target data directive. 1442 */ 1443 OMPTargetDataDirective = 257, 1444 1445 /** OpenMP taskloop directive. 1446 */ 1447 OMPTaskLoopDirective = 258, 1448 1449 /** OpenMP taskloop simd directive. 1450 */ 1451 OMPTaskLoopSimdDirective = 259, 1452 1453 /** OpenMP distribute directive. 1454 */ 1455 OMPDistributeDirective = 260, 1456 1457 /** OpenMP target enter data directive. 1458 */ 1459 OMPTargetEnterDataDirective = 261, 1460 1461 /** OpenMP target exit data directive. 1462 */ 1463 OMPTargetExitDataDirective = 262, 1464 1465 /** OpenMP target parallel directive. 1466 */ 1467 OMPTargetParallelDirective = 263, 1468 1469 /** OpenMP target parallel for directive. 1470 */ 1471 OMPTargetParallelForDirective = 264, 1472 1473 /** OpenMP target update directive. 1474 */ 1475 OMPTargetUpdateDirective = 265, 1476 1477 /** OpenMP distribute parallel for directive. 1478 */ 1479 OMPDistributeParallelForDirective = 266, 1480 1481 /** OpenMP distribute parallel for simd directive. 1482 */ 1483 OMPDistributeParallelForSimdDirective = 267, 1484 1485 /** OpenMP distribute simd directive. 1486 */ 1487 OMPDistributeSimdDirective = 268, 1488 1489 /** OpenMP target parallel for simd directive. 1490 */ 1491 OMPTargetParallelForSimdDirective = 269, 1492 1493 /** OpenMP target simd directive. 1494 */ 1495 OMPTargetSimdDirective = 270, 1496 1497 /** OpenMP teams distribute directive. 1498 */ 1499 OMPTeamsDistributeDirective = 271, 1500 1501 /** OpenMP teams distribute simd directive. 1502 */ 1503 OMPTeamsDistributeSimdDirective = 272, 1504 1505 /** OpenMP teams distribute parallel for simd directive. 1506 */ 1507 OMPTeamsDistributeParallelForSimdDirective = 273, 1508 1509 /** OpenMP teams distribute parallel for directive. 1510 */ 1511 OMPTeamsDistributeParallelForDirective = 274, 1512 1513 /** OpenMP target teams directive. 1514 */ 1515 OMPTargetTeamsDirective = 275, 1516 1517 /** OpenMP target teams distribute directive. 1518 */ 1519 OMPTargetTeamsDistributeDirective = 276, 1520 1521 /** OpenMP target teams distribute parallel for directive. 1522 */ 1523 OMPTargetTeamsDistributeParallelForDirective = 277, 1524 1525 /** OpenMP target teams distribute parallel for simd directive. 1526 */ 1527 OMPTargetTeamsDistributeParallelForSimdDirective = 278, 1528 1529 /** OpenMP target teams distribute simd directive. 1530 */ 1531 OMPTargetTeamsDistributeSimdDirective = 279, 1532 1533 /** C++2a std::bit_cast expression. 1534 */ 1535 BuiltinBitCastExpr = 280, 1536 1537 /** OpenMP master taskloop directive. 1538 */ 1539 OMPMasterTaskLoopDirective = 281, 1540 1541 /** OpenMP parallel master taskloop directive. 1542 */ 1543 OMPParallelMasterTaskLoopDirective = 282, 1544 1545 /** OpenMP master taskloop simd directive. 1546 */ 1547 OMPMasterTaskLoopSimdDirective = 283, 1548 1549 /** OpenMP parallel master taskloop simd directive. 1550 */ 1551 OMPParallelMasterTaskLoopSimdDirective = 284, 1552 1553 /** OpenMP parallel master directive. 1554 */ 1555 OMPParallelMasterDirective = 285, 1556 1557 /** OpenMP depobj directive. 1558 */ 1559 OMPDepobjDirective = 286, 1560 1561 /** OpenMP scan directive. 1562 */ 1563 OMPScanDirective = 287, 1564 1565 /** OpenMP tile directive. 1566 */ 1567 OMPTileDirective = 288, 1568 1569 /** OpenMP canonical loop. 1570 */ 1571 OMPCanonicalLoop = 289, 1572 1573 /** OpenMP interop directive. 1574 */ 1575 OMPInteropDirective = 290, 1576 1577 /** OpenMP dispatch directive. 1578 */ 1579 OMPDispatchDirective = 291, 1580 1581 /** OpenMP masked directive. 1582 */ 1583 OMPMaskedDirective = 292, 1584 1585 /** OpenMP unroll directive. 1586 */ 1587 OMPUnrollDirective = 293, 1588 1589 /** OpenMP metadirective directive. 1590 */ 1591 OMPMetaDirective = 294, 1592 1593 /** OpenMP loop directive. 1594 */ 1595 OMPGenericLoopDirective = 295, 1596 1597 /** OpenMP teams loop directive. 1598 */ 1599 OMPTeamsGenericLoopDirective = 296, 1600 1601 /** OpenMP target teams loop directive. 1602 */ 1603 OMPTargetTeamsGenericLoopDirective = 297, 1604 1605 /** OpenMP parallel loop directive. 1606 */ 1607 OMPParallelGenericLoopDirective = 298, 1608 1609 /** OpenMP target parallel loop directive. 1610 */ 1611 OMPTargetParallelGenericLoopDirective = 299, 1612 1613 /** OpenMP parallel masked directive. 1614 */ 1615 OMPParallelMaskedDirective = 300, 1616 1617 /** OpenMP masked taskloop directive. 1618 */ 1619 OMPMaskedTaskLoopDirective = 301, 1620 1621 /** OpenMP masked taskloop simd directive. 1622 */ 1623 OMPMaskedTaskLoopSimdDirective = 302, 1624 1625 /** OpenMP parallel masked taskloop directive. 1626 */ 1627 OMPParallelMaskedTaskLoopDirective = 303, 1628 1629 /** OpenMP parallel masked taskloop simd directive. 1630 */ 1631 OMPParallelMaskedTaskLoopSimdDirective = 304, 1632 1633 /** OpenMP error directive. 1634 */ 1635 OMPErrorDirective = 305, 1636 1637 /** OpenMP scope directive. 1638 */ 1639 OMPScopeDirective = 306, 1640 1641 /** OpenMP reverse directive. 1642 */ 1643 OMPReverseDirective = 307, 1644 1645 /** OpenMP interchange directive. 1646 */ 1647 OMPInterchangeDirective = 308, 1648 1649 /** OpenMP assume directive. 1650 */ 1651 OMPAssumeDirective = 309, 1652 1653 /** OpenACC Compute Construct. 1654 */ 1655 OpenACCComputeConstruct = 320, 1656 1657 /** OpenACC Loop Construct. 1658 */ 1659 OpenACCLoopConstruct = 321, 1660 1661 /** OpenACC Combined Constructs. 1662 */ 1663 OpenACCCombinedConstruct = 322, 1664 1665 /** OpenACC data Construct. 1666 */ 1667 OpenACCDataConstruct = 323, 1668 1669 /** OpenACC enter data Construct. 1670 */ 1671 OpenACCEnterDataConstruct = 324, 1672 1673 /** OpenACC exit data Construct. 1674 */ 1675 OpenACCExitDataConstruct = 325, 1676 1677 /** OpenACC host_data Construct. 1678 */ 1679 OpenACCHostDataConstruct = 326, 1680 1681 /** OpenACC wait Construct. 1682 */ 1683 OpenACCWaitConstruct = 327, 1684 1685 /** OpenACC init Construct. 1686 */ 1687 OpenACCInitConstruct = 328, 1688 1689 /** OpenACC shutdown Construct. 1690 */ 1691 OpenACCShutdownConstruct = 329, 1692 1693 /** OpenACC set Construct. 1694 */ 1695 OpenACCSetConstruct = 330, 1696 1697 /** OpenACC update Construct. 1698 */ 1699 OpenACCUpdateConstruct = 331, 1700 1701 /** OpenACC update Construct. 1702 */ 1703 LastStmt = 331, 1704 1705 /** 1706 * Cursor that represents the translation unit itself. 1707 * 1708 * The translation unit cursor exists primarily to act as the root 1709 * cursor for traversing the contents of a translation unit. 1710 */ 1711 TranslationUnit = 350, 1712 1713 /* Attributes */ 1714 FirstAttr = 400, 1715 1716 /** 1717 * An attribute whose specific kind is not exposed via this 1718 * interface. 1719 */ 1720 UnexposedAttr = 400, 1721 1722 /** 1723 * An attribute whose specific kind is not exposed via this 1724 * interface. 1725 */ 1726 IBActionAttr = 401, 1727 1728 /** 1729 * An attribute whose specific kind is not exposed via this 1730 * interface. 1731 */ 1732 IBOutletAttr = 402, 1733 1734 /** 1735 * An attribute whose specific kind is not exposed via this 1736 * interface. 1737 */ 1738 IBOutletCollectionAttr = 403, 1739 1740 /** 1741 * An attribute whose specific kind is not exposed via this 1742 * interface. 1743 */ 1744 CXXFinalAttr = 404, 1745 1746 /** 1747 * An attribute whose specific kind is not exposed via this 1748 * interface. 1749 */ 1750 CXXOverrideAttr = 405, 1751 1752 /** 1753 * An attribute whose specific kind is not exposed via this 1754 * interface. 1755 */ 1756 AnnotateAttr = 406, 1757 1758 /** 1759 * An attribute whose specific kind is not exposed via this 1760 * interface. 1761 */ 1762 AsmLabelAttr = 407, 1763 1764 /** 1765 * An attribute whose specific kind is not exposed via this 1766 * interface. 1767 */ 1768 PackedAttr = 408, 1769 1770 /** 1771 * An attribute whose specific kind is not exposed via this 1772 * interface. 1773 */ 1774 PureAttr = 409, 1775 1776 /** 1777 * An attribute whose specific kind is not exposed via this 1778 * interface. 1779 */ 1780 ConstAttr = 410, 1781 1782 /** 1783 * An attribute whose specific kind is not exposed via this 1784 * interface. 1785 */ 1786 NoDuplicateAttr = 411, 1787 1788 /** 1789 * An attribute whose specific kind is not exposed via this 1790 * interface. 1791 */ 1792 CUDAConstantAttr = 412, 1793 1794 /** 1795 * An attribute whose specific kind is not exposed via this 1796 * interface. 1797 */ 1798 CUDADeviceAttr = 413, 1799 1800 /** 1801 * An attribute whose specific kind is not exposed via this 1802 * interface. 1803 */ 1804 CUDAGlobalAttr = 414, 1805 1806 /** 1807 * An attribute whose specific kind is not exposed via this 1808 * interface. 1809 */ 1810 CUDAHostAttr = 415, 1811 1812 /** 1813 * An attribute whose specific kind is not exposed via this 1814 * interface. 1815 */ 1816 CUDASharedAttr = 416, 1817 1818 /** 1819 * An attribute whose specific kind is not exposed via this 1820 * interface. 1821 */ 1822 VisibilityAttr = 417, 1823 1824 /** 1825 * An attribute whose specific kind is not exposed via this 1826 * interface. 1827 */ 1828 DLLExport = 418, 1829 1830 /** 1831 * An attribute whose specific kind is not exposed via this 1832 * interface. 1833 */ 1834 DLLImport = 419, 1835 1836 /** 1837 * An attribute whose specific kind is not exposed via this 1838 * interface. 1839 */ 1840 NSReturnsRetained = 420, 1841 1842 /** 1843 * An attribute whose specific kind is not exposed via this 1844 * interface. 1845 */ 1846 NSReturnsNotRetained = 421, 1847 1848 /** 1849 * An attribute whose specific kind is not exposed via this 1850 * interface. 1851 */ 1852 NSReturnsAutoreleased = 422, 1853 1854 /** 1855 * An attribute whose specific kind is not exposed via this 1856 * interface. 1857 */ 1858 NSConsumesSelf = 423, 1859 1860 /** 1861 * An attribute whose specific kind is not exposed via this 1862 * interface. 1863 */ 1864 NSConsumed = 424, 1865 1866 /** 1867 * An attribute whose specific kind is not exposed via this 1868 * interface. 1869 */ 1870 ObjCException = 425, 1871 1872 /** 1873 * An attribute whose specific kind is not exposed via this 1874 * interface. 1875 */ 1876 ObjCNSObject = 426, 1877 1878 /** 1879 * An attribute whose specific kind is not exposed via this 1880 * interface. 1881 */ 1882 ObjCIndependentClass = 427, 1883 1884 /** 1885 * An attribute whose specific kind is not exposed via this 1886 * interface. 1887 */ 1888 ObjCPreciseLifetime = 428, 1889 1890 /** 1891 * An attribute whose specific kind is not exposed via this 1892 * interface. 1893 */ 1894 ObjCReturnsInnerPointer = 429, 1895 1896 /** 1897 * An attribute whose specific kind is not exposed via this 1898 * interface. 1899 */ 1900 ObjCRequiresSuper = 430, 1901 1902 /** 1903 * An attribute whose specific kind is not exposed via this 1904 * interface. 1905 */ 1906 ObjCRootClass = 431, 1907 1908 /** 1909 * An attribute whose specific kind is not exposed via this 1910 * interface. 1911 */ 1912 ObjCSubclassingRestricted = 432, 1913 1914 /** 1915 * An attribute whose specific kind is not exposed via this 1916 * interface. 1917 */ 1918 ObjCExplicitProtocolImpl = 433, 1919 1920 /** 1921 * An attribute whose specific kind is not exposed via this 1922 * interface. 1923 */ 1924 ObjCDesignatedInitializer = 434, 1925 1926 /** 1927 * An attribute whose specific kind is not exposed via this 1928 * interface. 1929 */ 1930 ObjCRuntimeVisible = 435, 1931 1932 /** 1933 * An attribute whose specific kind is not exposed via this 1934 * interface. 1935 */ 1936 ObjCBoxable = 436, 1937 1938 /** 1939 * An attribute whose specific kind is not exposed via this 1940 * interface. 1941 */ 1942 FlagEnum = 437, 1943 1944 /** 1945 * An attribute whose specific kind is not exposed via this 1946 * interface. 1947 */ 1948 ConvergentAttr = 438, 1949 1950 /** 1951 * An attribute whose specific kind is not exposed via this 1952 * interface. 1953 */ 1954 WarnUnusedAttr = 439, 1955 1956 /** 1957 * An attribute whose specific kind is not exposed via this 1958 * interface. 1959 */ 1960 WarnUnusedResultAttr = 440, 1961 1962 /** 1963 * An attribute whose specific kind is not exposed via this 1964 * interface. 1965 */ 1966 AlignedAttr = 441, 1967 1968 /** 1969 * An attribute whose specific kind is not exposed via this 1970 * interface. 1971 */ 1972 LastAttr = 441, 1973 1974 /* Preprocessing */ 1975 PreprocessingDirective = 500, 1976 1977 /* Preprocessing */ 1978 MacroDefinition = 501, 1979 1980 /* Preprocessing */ 1981 MacroExpansion = 502, 1982 1983 /* Preprocessing */ 1984 MacroInstantiation = 502, 1985 1986 /* Preprocessing */ 1987 InclusionDirective = 503, 1988 1989 /* Preprocessing */ 1990 FirstPreprocessing = 500, 1991 1992 /* Preprocessing */ 1993 LastPreprocessing = 503, 1994 1995 /* Extra Declarations */ 1996 /** 1997 * A module import declaration. 1998 */ 1999 ModuleImportDecl = 600, 2000 2001 /* Extra Declarations */ 2002 /** 2003 * A module import declaration. 2004 */ 2005 TypeAliasTemplateDecl = 601, 2006 2007 /** 2008 * A static_assert or _Static_assert node 2009 */ 2010 StaticAssert = 602, 2011 2012 /** 2013 * a friend declaration. 2014 */ 2015 FriendDecl = 603, 2016 2017 /** 2018 * a concept declaration. 2019 */ 2020 ConceptDecl = 604, 2021 2022 /** 2023 * a concept declaration. 2024 */ 2025 FirstExtraDecl = 600, 2026 2027 /** 2028 * a concept declaration. 2029 */ 2030 LastExtraDecl = 604, 2031 2032 /** 2033 * A code completion overload candidate. 2034 */ 2035 OverloadCandidate = 700, 2036 } 2037 2038 /** 2039 * A cursor representing some element in the abstract syntax tree for 2040 * a translation unit. 2041 * 2042 * The cursor abstraction unifies the different kinds of entities in a 2043 * program--declaration, statements, expressions, references to declarations, 2044 * etc.--under a single "cursor" abstraction with a common set of operations. 2045 * Common operation for a cursor include: getting the physical location in 2046 * a source file where the cursor points, getting the name associated with a 2047 * cursor, and retrieving cursors for any child nodes of a particular cursor. 2048 * 2049 * Cursors can be produced in two specific ways. 2050 * clang_getTranslationUnitCursor() produces a cursor for a translation unit, 2051 * from which one can use clang_visitChildren() to explore the rest of the 2052 * translation unit. clang_getCursor() maps from a physical source location 2053 * to the entity that resides at that location, allowing one to map from the 2054 * source code into the AST. 2055 */ 2056 Cursor :: struct { 2057 kind: Cursor_Kind, 2058 xdata: c.int, 2059 data: [3]rawptr, 2060 } 2061 2062 /** 2063 * Describe the linkage of the entity referred to by a cursor. 2064 */ 2065 Linkage_Kind :: enum c.int { 2066 /** This value indicates that no linkage information is available 2067 * for a provided CXCursor. */ 2068 Invalid, 2069 2070 /** 2071 * This is the linkage for variables, parameters, and so on that 2072 * have automatic storage. This covers normal (non-extern) local variables. 2073 */ 2074 NoLinkage, 2075 2076 /** This is the linkage for static variables and static functions. */ 2077 Internal, 2078 2079 /** This is the linkage for entities with external linkage that live 2080 * in C++ anonymous namespaces.*/ 2081 UniqueExternal, 2082 2083 /** This is the linkage for entities with true, external linkage. */ 2084 External, 2085 } 2086 2087 Visibility_Kind :: enum c.int { 2088 /** This value indicates that no visibility information is available 2089 * for a provided CXCursor. */ 2090 Invalid, 2091 2092 /** Symbol not seen by the linker. */ 2093 Hidden, 2094 2095 /** Symbol seen by the linker but resolves to a symbol inside this object. */ 2096 Protected, 2097 2098 /** Symbol seen by the linker and acts like a normal symbol. */ 2099 Default, 2100 } 2101 2102 /** 2103 * Describes the availability of a given entity on a particular platform, e.g., 2104 * a particular class might only be available on Mac OS 10.7 or newer. 2105 */ 2106 Platform_Availability :: struct { 2107 /** 2108 * A string that describes the platform for which this structure 2109 * provides availability information. 2110 * 2111 * Possible values are "ios" or "macos". 2112 */ 2113 Platform: String, 2114 2115 /** 2116 * The version number in which this entity was introduced. 2117 */ 2118 Introduced: Version, 2119 2120 /** 2121 * The version number in which this entity was deprecated (but is 2122 * still available). 2123 */ 2124 Deprecated: Version, 2125 2126 /** 2127 * The version number in which this entity was obsoleted, and therefore 2128 * is no longer available. 2129 */ 2130 Obsoleted: Version, 2131 2132 /** 2133 * Whether the entity is unconditionally unavailable on this platform. 2134 */ 2135 Unavailable: c.int, 2136 2137 /** 2138 * An optional message to provide to a user of this API, e.g., to 2139 * suggest replacement APIs. 2140 */ 2141 Message: String, 2142 } 2143 2144 /** 2145 * Describe the "language" of the entity referred to by a cursor. 2146 */ 2147 Language_Kind :: enum c.int { 2148 Invalid, 2149 C, 2150 ObjC, 2151 CPlusPlus, 2152 } 2153 2154 /** 2155 * Describe the "thread-local storage (TLS) kind" of the declaration 2156 * referred to by a cursor. 2157 */ 2158 Tlskind :: enum c.int { 2159 None, 2160 Dynamic, 2161 Static, 2162 } 2163 2164 /** 2165 * A fast container representing a set of CXCursors. 2166 */ 2167 Cursor_Set :: struct {} 2168 2169 /** 2170 * Describes the kind of type 2171 */ 2172 Type_Kind :: enum c.int { 2173 /** 2174 * Represents an invalid type (e.g., where no type is available). 2175 */ 2176 Invalid = 0, 2177 2178 /** 2179 * A type whose specific kind is not exposed via this 2180 * interface. 2181 */ 2182 Unexposed = 1, 2183 2184 /* Builtin types */ 2185 Void = 2, 2186 2187 /* Builtin types */ 2188 Bool = 3, 2189 2190 /* Builtin types */ 2191 Char_U = 4, 2192 2193 /* Builtin types */ 2194 UChar = 5, 2195 2196 /* Builtin types */ 2197 Char16 = 6, 2198 2199 /* Builtin types */ 2200 Char32 = 7, 2201 2202 /* Builtin types */ 2203 UShort = 8, 2204 2205 /* Builtin types */ 2206 UInt = 9, 2207 2208 /* Builtin types */ 2209 ULong = 10, 2210 2211 /* Builtin types */ 2212 ULongLong = 11, 2213 2214 /* Builtin types */ 2215 UInt128 = 12, 2216 2217 /* Builtin types */ 2218 Char_S = 13, 2219 2220 /* Builtin types */ 2221 SChar = 14, 2222 2223 /* Builtin types */ 2224 WChar = 15, 2225 2226 /* Builtin types */ 2227 Short = 16, 2228 2229 /* Builtin types */ 2230 Int = 17, 2231 2232 /* Builtin types */ 2233 Long = 18, 2234 2235 /* Builtin types */ 2236 LongLong = 19, 2237 2238 /* Builtin types */ 2239 Int128 = 20, 2240 2241 /* Builtin types */ 2242 Float = 21, 2243 2244 /* Builtin types */ 2245 Double = 22, 2246 2247 /* Builtin types */ 2248 LongDouble = 23, 2249 2250 /* Builtin types */ 2251 NullPtr = 24, 2252 2253 /* Builtin types */ 2254 Overload = 25, 2255 2256 /* Builtin types */ 2257 Dependent = 26, 2258 2259 /* Builtin types */ 2260 ObjCId = 27, 2261 2262 /* Builtin types */ 2263 ObjCClass = 28, 2264 2265 /* Builtin types */ 2266 ObjCSel = 29, 2267 2268 /* Builtin types */ 2269 Float128 = 30, 2270 2271 /* Builtin types */ 2272 Half = 31, 2273 2274 /* Builtin types */ 2275 Float16 = 32, 2276 2277 /* Builtin types */ 2278 ShortAccum = 33, 2279 2280 /* Builtin types */ 2281 Accum = 34, 2282 2283 /* Builtin types */ 2284 LongAccum = 35, 2285 2286 /* Builtin types */ 2287 UShortAccum = 36, 2288 2289 /* Builtin types */ 2290 UAccum = 37, 2291 2292 /* Builtin types */ 2293 ULongAccum = 38, 2294 2295 /* Builtin types */ 2296 BFloat16 = 39, 2297 2298 /* Builtin types */ 2299 Ibm128 = 40, 2300 2301 /* Builtin types */ 2302 FirstBuiltin = 2, 2303 2304 /* Builtin types */ 2305 LastBuiltin = 40, 2306 2307 /* Builtin types */ 2308 Complex = 100, 2309 2310 /* Builtin types */ 2311 Pointer = 101, 2312 2313 /* Builtin types */ 2314 BlockPointer = 102, 2315 2316 /* Builtin types */ 2317 LValueReference = 103, 2318 2319 /* Builtin types */ 2320 RValueReference = 104, 2321 2322 /* Builtin types */ 2323 Record = 105, 2324 2325 /* Builtin types */ 2326 Enum = 106, 2327 2328 /* Builtin types */ 2329 Typedef = 107, 2330 2331 /* Builtin types */ 2332 ObjCInterface = 108, 2333 2334 /* Builtin types */ 2335 ObjCObjectPointer = 109, 2336 2337 /* Builtin types */ 2338 FunctionNoProto = 110, 2339 2340 /* Builtin types */ 2341 FunctionProto = 111, 2342 2343 /* Builtin types */ 2344 ConstantArray = 112, 2345 2346 /* Builtin types */ 2347 Vector = 113, 2348 2349 /* Builtin types */ 2350 IncompleteArray = 114, 2351 2352 /* Builtin types */ 2353 VariableArray = 115, 2354 2355 /* Builtin types */ 2356 DependentSizedArray = 116, 2357 2358 /* Builtin types */ 2359 MemberPointer = 117, 2360 2361 /* Builtin types */ 2362 Auto = 118, 2363 2364 /** 2365 * Represents a type that was referred to using an elaborated type keyword. 2366 * 2367 * E.g., struct S, or via a qualified name, e.g., N::M::type, or both. 2368 */ 2369 Elaborated = 119, 2370 2371 /* OpenCL PipeType. */ 2372 Pipe = 120, 2373 2374 /* OpenCL builtin types. */ 2375 OCLImage1dRO = 121, 2376 2377 /* OpenCL builtin types. */ 2378 OCLImage1dArrayRO = 122, 2379 2380 /* OpenCL builtin types. */ 2381 OCLImage1dBufferRO = 123, 2382 2383 /* OpenCL builtin types. */ 2384 OCLImage2dRO = 124, 2385 2386 /* OpenCL builtin types. */ 2387 OCLImage2dArrayRO = 125, 2388 2389 /* OpenCL builtin types. */ 2390 OCLImage2dDepthRO = 126, 2391 2392 /* OpenCL builtin types. */ 2393 OCLImage2dArrayDepthRO = 127, 2394 2395 /* OpenCL builtin types. */ 2396 OCLImage2dMSAARO = 128, 2397 2398 /* OpenCL builtin types. */ 2399 OCLImage2dArrayMSAARO = 129, 2400 2401 /* OpenCL builtin types. */ 2402 OCLImage2dMSAADepthRO = 130, 2403 2404 /* OpenCL builtin types. */ 2405 OCLImage2dArrayMSAADepthRO = 131, 2406 2407 /* OpenCL builtin types. */ 2408 OCLImage3dRO = 132, 2409 2410 /* OpenCL builtin types. */ 2411 OCLImage1dWO = 133, 2412 2413 /* OpenCL builtin types. */ 2414 OCLImage1dArrayWO = 134, 2415 2416 /* OpenCL builtin types. */ 2417 OCLImage1dBufferWO = 135, 2418 2419 /* OpenCL builtin types. */ 2420 OCLImage2dWO = 136, 2421 2422 /* OpenCL builtin types. */ 2423 OCLImage2dArrayWO = 137, 2424 2425 /* OpenCL builtin types. */ 2426 OCLImage2dDepthWO = 138, 2427 2428 /* OpenCL builtin types. */ 2429 OCLImage2dArrayDepthWO = 139, 2430 2431 /* OpenCL builtin types. */ 2432 OCLImage2dMSAAWO = 140, 2433 2434 /* OpenCL builtin types. */ 2435 OCLImage2dArrayMSAAWO = 141, 2436 2437 /* OpenCL builtin types. */ 2438 OCLImage2dMSAADepthWO = 142, 2439 2440 /* OpenCL builtin types. */ 2441 OCLImage2dArrayMSAADepthWO = 143, 2442 2443 /* OpenCL builtin types. */ 2444 OCLImage3dWO = 144, 2445 2446 /* OpenCL builtin types. */ 2447 OCLImage1dRW = 145, 2448 2449 /* OpenCL builtin types. */ 2450 OCLImage1dArrayRW = 146, 2451 2452 /* OpenCL builtin types. */ 2453 OCLImage1dBufferRW = 147, 2454 2455 /* OpenCL builtin types. */ 2456 OCLImage2dRW = 148, 2457 2458 /* OpenCL builtin types. */ 2459 OCLImage2dArrayRW = 149, 2460 2461 /* OpenCL builtin types. */ 2462 OCLImage2dDepthRW = 150, 2463 2464 /* OpenCL builtin types. */ 2465 OCLImage2dArrayDepthRW = 151, 2466 2467 /* OpenCL builtin types. */ 2468 OCLImage2dMSAARW = 152, 2469 2470 /* OpenCL builtin types. */ 2471 OCLImage2dArrayMSAARW = 153, 2472 2473 /* OpenCL builtin types. */ 2474 OCLImage2dMSAADepthRW = 154, 2475 2476 /* OpenCL builtin types. */ 2477 OCLImage2dArrayMSAADepthRW = 155, 2478 2479 /* OpenCL builtin types. */ 2480 OCLImage3dRW = 156, 2481 2482 /* OpenCL builtin types. */ 2483 OCLSampler = 157, 2484 2485 /* OpenCL builtin types. */ 2486 OCLEvent = 158, 2487 2488 /* OpenCL builtin types. */ 2489 OCLQueue = 159, 2490 2491 /* OpenCL builtin types. */ 2492 OCLReserveID = 160, 2493 2494 /* OpenCL builtin types. */ 2495 ObjCObject = 161, 2496 2497 /* OpenCL builtin types. */ 2498 ObjCTypeParam = 162, 2499 2500 /* OpenCL builtin types. */ 2501 Attributed = 163, 2502 2503 /* OpenCL builtin types. */ 2504 OCLIntelSubgroupAVCMcePayload = 164, 2505 2506 /* OpenCL builtin types. */ 2507 OCLIntelSubgroupAVCImePayload = 165, 2508 2509 /* OpenCL builtin types. */ 2510 OCLIntelSubgroupAVCRefPayload = 166, 2511 2512 /* OpenCL builtin types. */ 2513 OCLIntelSubgroupAVCSicPayload = 167, 2514 2515 /* OpenCL builtin types. */ 2516 OCLIntelSubgroupAVCMceResult = 168, 2517 2518 /* OpenCL builtin types. */ 2519 OCLIntelSubgroupAVCImeResult = 169, 2520 2521 /* OpenCL builtin types. */ 2522 OCLIntelSubgroupAVCRefResult = 170, 2523 2524 /* OpenCL builtin types. */ 2525 OCLIntelSubgroupAVCSicResult = 171, 2526 2527 /* OpenCL builtin types. */ 2528 OCLIntelSubgroupAVCImeResultSingleReferenceStreamout = 172, 2529 2530 /* OpenCL builtin types. */ 2531 OCLIntelSubgroupAVCImeResultDualReferenceStreamout = 173, 2532 2533 /* OpenCL builtin types. */ 2534 OCLIntelSubgroupAVCImeSingleReferenceStreamin = 174, 2535 2536 /* OpenCL builtin types. */ 2537 OCLIntelSubgroupAVCImeDualReferenceStreamin = 175, 2538 2539 /* Old aliases for AVC OpenCL extension types. */ 2540 OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172, 2541 2542 /* Old aliases for AVC OpenCL extension types. */ 2543 OCLIntelSubgroupAVCImeResultDualRefStreamout = 173, 2544 2545 /* Old aliases for AVC OpenCL extension types. */ 2546 OCLIntelSubgroupAVCImeSingleRefStreamin = 174, 2547 2548 /* Old aliases for AVC OpenCL extension types. */ 2549 OCLIntelSubgroupAVCImeDualRefStreamin = 175, 2550 2551 /* Old aliases for AVC OpenCL extension types. */ 2552 ExtVector = 176, 2553 2554 /* Old aliases for AVC OpenCL extension types. */ 2555 Atomic = 177, 2556 2557 /* Old aliases for AVC OpenCL extension types. */ 2558 BTFTagAttributed = 178, 2559 2560 /* HLSL Types */ 2561 HLSLResource = 179, 2562 2563 /* HLSL Types */ 2564 HLSLAttributedResource = 180, 2565 } 2566 2567 /** 2568 * Describes the calling convention of a function type 2569 */ 2570 Calling_Conv :: enum c.int { 2571 Default = 0, 2572 C = 1, 2573 X86StdCall = 2, 2574 X86FastCall = 3, 2575 X86ThisCall = 4, 2576 X86Pascal = 5, 2577 AAPCS = 6, 2578 AAPCS_VFP = 7, 2579 X86RegCall = 8, 2580 IntelOclBicc = 9, 2581 Win64 = 10, 2582 2583 /* Alias for compatibility with older versions of API. */ 2584 X86_64Win64 = 10, 2585 2586 /* Alias for compatibility with older versions of API. */ 2587 X86_64SysV = 11, 2588 2589 /* Alias for compatibility with older versions of API. */ 2590 X86VectorCall = 12, 2591 2592 /* Alias for compatibility with older versions of API. */ 2593 Swift = 13, 2594 2595 /* Alias for compatibility with older versions of API. */ 2596 PreserveMost = 14, 2597 2598 /* Alias for compatibility with older versions of API. */ 2599 PreserveAll = 15, 2600 2601 /* Alias for compatibility with older versions of API. */ 2602 AArch64VectorCall = 16, 2603 2604 /* Alias for compatibility with older versions of API. */ 2605 SwiftAsync = 17, 2606 2607 /* Alias for compatibility with older versions of API. */ 2608 AArch64SVEPCS = 18, 2609 2610 /* Alias for compatibility with older versions of API. */ 2611 M68kRTD = 19, 2612 2613 /* Alias for compatibility with older versions of API. */ 2614 PreserveNone = 20, 2615 2616 /* Alias for compatibility with older versions of API. */ 2617 RISCVVectorCall = 21, 2618 2619 /* Alias for compatibility with older versions of API. */ 2620 Invalid = 100, 2621 2622 /* Alias for compatibility with older versions of API. */ 2623 Unexposed = 200, 2624 } 2625 2626 /** 2627 * The type of an element in the abstract syntax tree. 2628 * 2629 */ 2630 Type :: struct { 2631 kind: Type_Kind, 2632 data: [2]rawptr, 2633 } 2634 2635 /** 2636 * Describes the kind of a template argument. 2637 * 2638 * See the definition of llvm::clang::TemplateArgument::ArgKind for full 2639 * element descriptions. 2640 */ 2641 Template_Argument_Kind :: enum c.int { 2642 Null, 2643 Type, 2644 Declaration, 2645 NullPtr, 2646 Integral, 2647 Template, 2648 TemplateExpansion, 2649 Expression, 2650 Pack, 2651 2652 /* Indicates an error case, preventing the kind from being deduced. */ 2653 Invalid, 2654 } 2655 2656 Type_Nullability_Kind :: enum c.int { 2657 /** 2658 * Values of this type can never be null. 2659 */ 2660 NonNull, 2661 2662 /** 2663 * Values of this type can be null. 2664 */ 2665 Nullable, 2666 2667 /** 2668 * Whether values of this type can be null is (explicitly) 2669 * unspecified. This captures a (fairly rare) case where we 2670 * can't conclude anything about the nullability of the type even 2671 * though it has been considered. 2672 */ 2673 Unspecified, 2674 2675 /** 2676 * Nullability is not applicable to this type. 2677 */ 2678 Invalid, 2679 2680 /** 2681 * Generally behaves like Nullable, except when used in a block parameter that 2682 * was imported into a swift async method. There, swift will assume that the 2683 * parameter can get null even if no error occurred. _Nullable parameters are 2684 * assumed to only get null on error. 2685 */ 2686 NullableResult, 2687 } 2688 2689 /** 2690 * List the possible error codes for \c clang_Type_getSizeOf, 2691 * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf, 2692 * \c clang_Cursor_getOffsetOf, and \c clang_getOffsetOfBase. 2693 * 2694 * A value of this enumeration type can be returned if the target type is not 2695 * a valid argument to sizeof, alignof or offsetof. 2696 */ 2697 Type_Layout_Error :: enum c.int { 2698 /** 2699 * Type is of kind CXType_Invalid. 2700 */ 2701 Invalid = -1, 2702 2703 /** 2704 * The type is an incomplete Type. 2705 */ 2706 Incomplete = -2, 2707 2708 /** 2709 * The type is a dependent Type. 2710 */ 2711 Dependent = -3, 2712 2713 /** 2714 * The type is not a constant size type. 2715 */ 2716 NotConstantSize = -4, 2717 2718 /** 2719 * The Field name is not valid for this record. 2720 */ 2721 InvalidFieldName = -5, 2722 2723 /** 2724 * The type is undeduced. 2725 */ 2726 Undeduced = -6, 2727 } 2728 2729 Ref_Qualifier_Kind :: enum c.int { 2730 /** No ref-qualifier was provided. */ 2731 None, 2732 2733 /** An lvalue ref-qualifier was provided (\c &). */ 2734 LValue, 2735 2736 /** An rvalue ref-qualifier was provided (\c &&). */ 2737 RValue, 2738 } 2739 2740 /** 2741 * Represents the C++ access control level to a base class for a 2742 * cursor with kind CX_CXXBaseSpecifier. 2743 */ 2744 Cxxaccess_Specifier :: enum c.int { 2745 InvalidAccessSpecifier, 2746 Public, 2747 Protected, 2748 Private, 2749 } 2750 2751 /** 2752 * Represents the storage classes as declared in the source. CX_SC_Invalid 2753 * was added for the case that the passed cursor in not a declaration. 2754 */ 2755 Storage_Class :: enum c.int { 2756 Invalid, 2757 None, 2758 Extern, 2759 Static, 2760 PrivateExtern, 2761 OpenCLWorkGroupLocal, 2762 Auto, 2763 Register, 2764 } 2765 2766 /** 2767 * Represents a specific kind of binary operator which can appear at a cursor. 2768 */ 2769 CX_Binary_Operator_Kind :: enum c.int { 2770 Invalid = 0, 2771 PtrMemD = 1, 2772 PtrMemI = 2, 2773 Mul = 3, 2774 Div = 4, 2775 Rem = 5, 2776 Add = 6, 2777 Sub = 7, 2778 Shl = 8, 2779 Shr = 9, 2780 Cmp = 10, 2781 LT = 11, 2782 GT = 12, 2783 LE = 13, 2784 GE = 14, 2785 EQ = 15, 2786 NE = 16, 2787 And = 17, 2788 Xor = 18, 2789 Or = 19, 2790 LAnd = 20, 2791 LOr = 21, 2792 Assign = 22, 2793 MulAssign = 23, 2794 DivAssign = 24, 2795 RemAssign = 25, 2796 AddAssign = 26, 2797 SubAssign = 27, 2798 ShlAssign = 28, 2799 ShrAssign = 29, 2800 AndAssign = 30, 2801 XorAssign = 31, 2802 OrAssign = 32, 2803 Comma = 33, 2804 LAST = 33, 2805 } 2806 2807 /** 2808 * Describes how the traversal of the children of a particular 2809 * cursor should proceed after visiting a particular child cursor. 2810 * 2811 * A value of this enumeration type should be returned by each 2812 * \c CXCursorVisitor to indicate how clang_visitChildren() proceed. 2813 */ 2814 Child_Visit_Result :: enum c.int { 2815 /** 2816 * Terminates the cursor traversal. 2817 */ 2818 Break, 2819 2820 /** 2821 * Continues the cursor traversal with the next sibling of 2822 * the cursor just visited, without visiting its children. 2823 */ 2824 Continue, 2825 2826 /** 2827 * Recursively traverse the children of this cursor, using 2828 * the same visitor and client data. 2829 */ 2830 Recurse, 2831 } 2832 2833 /** 2834 * Visitor invoked for each cursor found by a traversal. 2835 * 2836 * This visitor function will be invoked for each cursor found by 2837 * clang_visitCursorChildren(). Its first argument is the cursor being 2838 * visited, its second argument is the parent visitor for that cursor, 2839 * and its third argument is the client data provided to 2840 * clang_visitCursorChildren(). 2841 * 2842 * The visitor should return one of the \c CXChildVisitResult values 2843 * to direct clang_visitCursorChildren(). 2844 */ 2845 Cursor_Visitor :: proc "c" (Cursor, Cursor, Client_Data) -> Child_Visit_Result 2846 2847 Cursor_Visitor_Block :: struct {} 2848 2849 /** 2850 * Opaque pointer representing a policy that controls pretty printing 2851 * for \c clang_getCursorPrettyPrinted. 2852 */ 2853 Printing_Policy :: rawptr 2854 2855 /** 2856 * Properties for the printing policy. 2857 * 2858 * See \c clang::PrintingPolicy for more information. 2859 */ 2860 Printing_Policy_Property :: enum c.int { 2861 Indentation = 0, 2862 SuppressSpecifiers = 1, 2863 SuppressTagKeyword = 2, 2864 IncludeTagDefinition = 3, 2865 SuppressScope = 4, 2866 SuppressUnwrittenScope = 5, 2867 SuppressInitializers = 6, 2868 ConstantArraySizeAsWritten = 7, 2869 AnonymousTagLocations = 8, 2870 SuppressStrongLifetime = 9, 2871 SuppressLifetimeQualifiers = 10, 2872 SuppressTemplateArgsInCXXConstructors = 11, 2873 Bool = 12, 2874 Restrict = 13, 2875 Alignof = 14, 2876 UnderscoreAlignof = 15, 2877 UseVoidForZeroParams = 16, 2878 TerseOutput = 17, 2879 PolishForDeclaration = 18, 2880 Half = 19, 2881 MSWChar = 20, 2882 IncludeNewlines = 21, 2883 MSVCFormatting = 22, 2884 ConstantsAsWritten = 23, 2885 SuppressImplicitBase = 24, 2886 FullyQualifiedName = 25, 2887 LastProperty = 25, 2888 } 2889 2890 /** 2891 * Property attributes for a \c CXCursor_ObjCPropertyDecl. 2892 */ 2893 Obj_Cproperty_Attr_Kind :: enum c.int { 2894 noattr = 0, 2895 readonly = 1, 2896 getter = 2, 2897 assign = 4, 2898 readwrite = 8, 2899 retain = 16, 2900 copy = 32, 2901 nonatomic = 64, 2902 setter = 128, 2903 atomic = 256, 2904 weak = 512, 2905 strong = 1024, 2906 unsafe_unretained = 2048, 2907 class = 4096, 2908 } 2909 2910 /** 2911 * 'Qualifiers' written next to the return and parameter types in 2912 * Objective-C method declarations. 2913 */ 2914 Obj_Cdecl_Qualifier_Kind :: enum c.int { 2915 None = 0, 2916 In = 1, 2917 Inout = 2, 2918 Out = 4, 2919 Bycopy = 8, 2920 Byref = 16, 2921 Oneway = 32, 2922 } 2923 2924 /** 2925 * \defgroup CINDEX_MODULE Module introspection 2926 * 2927 * The functions in this group provide access to information about modules. 2928 * 2929 * @{ 2930 */ 2931 CXModule :: rawptr 2932 2933 Name_Ref_Flags :: enum c.int { 2934 /** 2935 * Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the 2936 * range. 2937 */ 2938 Qualifier = 1, 2939 2940 /** 2941 * Include the explicit template arguments, e.g. \<int> in x.f<int>, 2942 * in the range. 2943 */ 2944 TemplateArgs = 2, 2945 2946 /** 2947 * If the name is non-contiguous, return the full spanning range. 2948 * 2949 * Non-contiguous names occur in Objective-C when a selector with two or more 2950 * parameters is used, or in C++ when using an operator: 2951 * \code 2952 * [object doSomething:here withValue:there]; // Objective-C 2953 * return some_vector[1]; // C++ 2954 * \endcode 2955 */ 2956 SinglePiece = 4, 2957 } 2958 2959 /** 2960 * Describes a kind of token. 2961 */ 2962 Token_Kind :: enum c.int { 2963 /** 2964 * A token that contains some kind of punctuation. 2965 */ 2966 Punctuation, 2967 2968 /** 2969 * A language keyword. 2970 */ 2971 Keyword, 2972 2973 /** 2974 * An identifier (that is not a keyword). 2975 */ 2976 Identifier, 2977 2978 /** 2979 * A numeric, string, or character literal. 2980 */ 2981 Literal, 2982 2983 /** 2984 * A comment. 2985 */ 2986 Comment, 2987 } 2988 2989 /** 2990 * Describes a single preprocessing token. 2991 */ 2992 Token :: struct { 2993 int_data: [4]c.uint, 2994 ptr_data: rawptr, 2995 } 2996 2997 /** 2998 * A semantic string that describes a code-completion result. 2999 * 3000 * A semantic string that describes the formatting of a code-completion 3001 * result as a single "template" of text that should be inserted into the 3002 * source buffer when a particular code-completion result is selected. 3003 * Each semantic string is made up of some number of "chunks", each of which 3004 * contains some text along with a description of what that text means, e.g., 3005 * the name of the entity being referenced, whether the text chunk is part of 3006 * the template, or whether it is a "placeholder" that the user should replace 3007 * with actual code,of a specific kind. See \c CXCompletionChunkKind for a 3008 * description of the different kinds of chunks. 3009 */ 3010 Completion_String :: rawptr 3011 3012 /** 3013 * A single result of code completion. 3014 */ 3015 Completion_Result :: struct { 3016 /** 3017 * The kind of entity that this completion refers to. 3018 * 3019 * The cursor kind will be a macro, keyword, or a declaration (one of the 3020 * *Decl cursor kinds), describing the entity that the completion is 3021 * referring to. 3022 * 3023 * \todo In the future, we would like to provide a full cursor, to allow 3024 * the client to extract additional information from declaration. 3025 */ 3026 CursorKind: Cursor_Kind, 3027 3028 /** 3029 * The code-completion string that describes how to insert this 3030 * code-completion result into the editing buffer. 3031 */ 3032 CompletionString: Completion_String, 3033 } 3034 3035 /** 3036 * Describes a single piece of text within a code-completion string. 3037 * 3038 * Each "chunk" within a code-completion string (\c CXCompletionString) is 3039 * either a piece of text with a specific "kind" that describes how that text 3040 * should be interpreted by the client or is another completion string. 3041 */ 3042 Completion_Chunk_Kind :: enum c.int { 3043 /** 3044 * A code-completion string that describes "optional" text that 3045 * could be a part of the template (but is not required). 3046 * 3047 * The Optional chunk is the only kind of chunk that has a code-completion 3048 * string for its representation, which is accessible via 3049 * \c clang_getCompletionChunkCompletionString(). The code-completion string 3050 * describes an additional part of the template that is completely optional. 3051 * For example, optional chunks can be used to describe the placeholders for 3052 * arguments that match up with defaulted function parameters, e.g. given: 3053 * 3054 * \code 3055 * void f(int x, float y = 3.14, double z = 2.71828); 3056 * \endcode 3057 * 3058 * The code-completion string for this function would contain: 3059 * - a TypedText chunk for "f". 3060 * - a LeftParen chunk for "(". 3061 * - a Placeholder chunk for "int x" 3062 * - an Optional chunk containing the remaining defaulted arguments, e.g., 3063 * - a Comma chunk for "," 3064 * - a Placeholder chunk for "float y" 3065 * - an Optional chunk containing the last defaulted argument: 3066 * - a Comma chunk for "," 3067 * - a Placeholder chunk for "double z" 3068 * - a RightParen chunk for ")" 3069 * 3070 * There are many ways to handle Optional chunks. Two simple approaches are: 3071 * - Completely ignore optional chunks, in which case the template for the 3072 * function "f" would only include the first parameter ("int x"). 3073 * - Fully expand all optional chunks, in which case the template for the 3074 * function "f" would have all of the parameters. 3075 */ 3076 Optional, 3077 3078 /** 3079 * Text that a user would be expected to type to get this 3080 * code-completion result. 3081 * 3082 * There will be exactly one "typed text" chunk in a semantic string, which 3083 * will typically provide the spelling of a keyword or the name of a 3084 * declaration that could be used at the current code point. Clients are 3085 * expected to filter the code-completion results based on the text in this 3086 * chunk. 3087 */ 3088 TypedText, 3089 3090 /** 3091 * Text that should be inserted as part of a code-completion result. 3092 * 3093 * A "text" chunk represents text that is part of the template to be 3094 * inserted into user code should this particular code-completion result 3095 * be selected. 3096 */ 3097 Text, 3098 3099 /** 3100 * Placeholder text that should be replaced by the user. 3101 * 3102 * A "placeholder" chunk marks a place where the user should insert text 3103 * into the code-completion template. For example, placeholders might mark 3104 * the function parameters for a function declaration, to indicate that the 3105 * user should provide arguments for each of those parameters. The actual 3106 * text in a placeholder is a suggestion for the text to display before 3107 * the user replaces the placeholder with real code. 3108 */ 3109 Placeholder, 3110 3111 /** 3112 * Informative text that should be displayed but never inserted as 3113 * part of the template. 3114 * 3115 * An "informative" chunk contains annotations that can be displayed to 3116 * help the user decide whether a particular code-completion result is the 3117 * right option, but which is not part of the actual template to be inserted 3118 * by code completion. 3119 */ 3120 Informative, 3121 3122 /** 3123 * Text that describes the current parameter when code-completion is 3124 * referring to function call, message send, or template specialization. 3125 * 3126 * A "current parameter" chunk occurs when code-completion is providing 3127 * information about a parameter corresponding to the argument at the 3128 * code-completion point. For example, given a function 3129 * 3130 * \code 3131 * int add(int x, int y); 3132 * \endcode 3133 * 3134 * and the source code \c add(, where the code-completion point is after the 3135 * "(", the code-completion string will contain a "current parameter" chunk 3136 * for "int x", indicating that the current argument will initialize that 3137 * parameter. After typing further, to \c add(17, (where the code-completion 3138 * point is after the ","), the code-completion string will contain a 3139 * "current parameter" chunk to "int y". 3140 */ 3141 CurrentParameter, 3142 3143 /** 3144 * A left parenthesis ('('), used to initiate a function call or 3145 * signal the beginning of a function parameter list. 3146 */ 3147 LeftParen, 3148 3149 /** 3150 * A right parenthesis (')'), used to finish a function call or 3151 * signal the end of a function parameter list. 3152 */ 3153 RightParen, 3154 3155 /** 3156 * A left bracket ('['). 3157 */ 3158 LeftBracket, 3159 3160 /** 3161 * A right bracket (']'). 3162 */ 3163 RightBracket, 3164 3165 /** 3166 * A left brace ('{'). 3167 */ 3168 LeftBrace, 3169 3170 /** 3171 * A right brace ('}'). 3172 */ 3173 RightBrace, 3174 3175 /** 3176 * A left angle bracket ('<'). 3177 */ 3178 LeftAngle, 3179 3180 /** 3181 * A right angle bracket ('>'). 3182 */ 3183 RightAngle, 3184 3185 /** 3186 * A comma separator (','). 3187 */ 3188 Comma, 3189 3190 /** 3191 * Text that specifies the result type of a given result. 3192 * 3193 * This special kind of informative chunk is not meant to be inserted into 3194 * the text buffer. Rather, it is meant to illustrate the type that an 3195 * expression using the given completion string would have. 3196 */ 3197 ResultType, 3198 3199 /** 3200 * A colon (':'). 3201 */ 3202 Colon, 3203 3204 /** 3205 * A semicolon (';'). 3206 */ 3207 SemiColon, 3208 3209 /** 3210 * An '=' sign. 3211 */ 3212 Equal, 3213 3214 /** 3215 * Horizontal space (' '). 3216 */ 3217 HorizontalSpace, 3218 3219 /** 3220 * Vertical space ('\\n'), after which it is generally a good idea to 3221 * perform indentation. 3222 */ 3223 VerticalSpace, 3224 } 3225 3226 /** 3227 * Contains the results of code-completion. 3228 * 3229 * This data structure contains the results of code completion, as 3230 * produced by \c clang_codeCompleteAt(). Its contents must be freed by 3231 * \c clang_disposeCodeCompleteResults. 3232 */ 3233 Code_Complete_Results :: struct { 3234 /** 3235 * The code-completion results. 3236 */ 3237 Results: ^Completion_Result, 3238 3239 /** 3240 * The number of code-completion results stored in the 3241 * \c Results array. 3242 */ 3243 NumResults: c.uint, 3244 } 3245 3246 /** 3247 * Flags that can be passed to \c clang_codeCompleteAt() to 3248 * modify its behavior. 3249 * 3250 * The enumerators in this enumeration can be bitwise-OR'd together to 3251 * provide multiple options to \c clang_codeCompleteAt(). 3252 */ 3253 Code_Complete_Flags :: enum c.int { 3254 /** 3255 * Whether to include macros within the set of code 3256 * completions returned. 3257 */ 3258 IncludeMacros = 1, 3259 3260 /** 3261 * Whether to include code patterns for language constructs 3262 * within the set of code completions, e.g., for loops. 3263 */ 3264 IncludeCodePatterns = 2, 3265 3266 /** 3267 * Whether to include brief documentation within the set of code 3268 * completions returned. 3269 */ 3270 IncludeBriefComments = 4, 3271 3272 /** 3273 * Whether to speed up completion by omitting top- or namespace-level entities 3274 * defined in the preamble. There's no guarantee any particular entity is 3275 * omitted. This may be useful if the headers are indexed externally. 3276 */ 3277 SkipPreamble = 8, 3278 3279 /** 3280 * Whether to include completions with small 3281 * fix-its, e.g. change '.' to '->' on member access, etc. 3282 */ 3283 IncludeCompletionsWithFixIts = 16, 3284 } 3285 3286 /** 3287 * Bits that represent the context under which completion is occurring. 3288 * 3289 * The enumerators in this enumeration may be bitwise-OR'd together if multiple 3290 * contexts are occurring simultaneously. 3291 */ 3292 Completion_Context :: enum c.int { 3293 /** 3294 * The context for completions is unexposed, as only Clang results 3295 * should be included. (This is equivalent to having no context bits set.) 3296 */ 3297 Unexposed = 0, 3298 3299 /** 3300 * Completions for any possible type should be included in the results. 3301 */ 3302 AnyType = 1, 3303 3304 /** 3305 * Completions for any possible value (variables, function calls, etc.) 3306 * should be included in the results. 3307 */ 3308 AnyValue = 2, 3309 3310 /** 3311 * Completions for values that resolve to an Objective-C object should 3312 * be included in the results. 3313 */ 3314 ObjCObjectValue = 4, 3315 3316 /** 3317 * Completions for values that resolve to an Objective-C selector 3318 * should be included in the results. 3319 */ 3320 ObjCSelectorValue = 8, 3321 3322 /** 3323 * Completions for values that resolve to a C++ class type should be 3324 * included in the results. 3325 */ 3326 CXXClassTypeValue = 16, 3327 3328 /** 3329 * Completions for fields of the member being accessed using the dot 3330 * operator should be included in the results. 3331 */ 3332 DotMemberAccess = 32, 3333 3334 /** 3335 * Completions for fields of the member being accessed using the arrow 3336 * operator should be included in the results. 3337 */ 3338 ArrowMemberAccess = 64, 3339 3340 /** 3341 * Completions for properties of the Objective-C object being accessed 3342 * using the dot operator should be included in the results. 3343 */ 3344 ObjCPropertyAccess = 128, 3345 3346 /** 3347 * Completions for enum tags should be included in the results. 3348 */ 3349 EnumTag = 256, 3350 3351 /** 3352 * Completions for union tags should be included in the results. 3353 */ 3354 UnionTag = 512, 3355 3356 /** 3357 * Completions for struct tags should be included in the results. 3358 */ 3359 StructTag = 1024, 3360 3361 /** 3362 * Completions for C++ class names should be included in the results. 3363 */ 3364 ClassTag = 2048, 3365 3366 /** 3367 * Completions for C++ namespaces and namespace aliases should be 3368 * included in the results. 3369 */ 3370 Namespace = 4096, 3371 3372 /** 3373 * Completions for C++ nested name specifiers should be included in 3374 * the results. 3375 */ 3376 NestedNameSpecifier = 8192, 3377 3378 /** 3379 * Completions for Objective-C interfaces (classes) should be included 3380 * in the results. 3381 */ 3382 ObjCInterface = 16384, 3383 3384 /** 3385 * Completions for Objective-C protocols should be included in 3386 * the results. 3387 */ 3388 ObjCProtocol = 32768, 3389 3390 /** 3391 * Completions for Objective-C categories should be included in 3392 * the results. 3393 */ 3394 ObjCCategory = 65536, 3395 3396 /** 3397 * Completions for Objective-C instance messages should be included 3398 * in the results. 3399 */ 3400 ObjCInstanceMessage = 131072, 3401 3402 /** 3403 * Completions for Objective-C class messages should be included in 3404 * the results. 3405 */ 3406 ObjCClassMessage = 262144, 3407 3408 /** 3409 * Completions for Objective-C selector names should be included in 3410 * the results. 3411 */ 3412 ObjCSelectorName = 524288, 3413 3414 /** 3415 * Completions for preprocessor macro names should be included in 3416 * the results. 3417 */ 3418 MacroName = 1048576, 3419 3420 /** 3421 * Natural language completions should be included in the results. 3422 */ 3423 NaturalLanguage = 2097152, 3424 3425 /** 3426 * #include file completions should be included in the results. 3427 */ 3428 IncludedFile = 4194304, 3429 3430 /** 3431 * The current context is unknown, so set all contexts. 3432 */ 3433 Unknown = 8388607, 3434 } 3435 3436 /** 3437 * Visitor invoked for each file in a translation unit 3438 * (used with clang_getInclusions()). 3439 * 3440 * This visitor function will be invoked by clang_getInclusions() for each 3441 * file included (either at the top-level or by \#include directives) within 3442 * a translation unit. The first argument is the file being included, and 3443 * the second and third arguments provide the inclusion stack. The 3444 * array is sorted in order of immediate inclusion. For example, 3445 * the first element refers to the location that included 'included_file'. 3446 */ 3447 Inclusion_Visitor :: proc "c" (File, ^Source_Location, c.uint, Client_Data) 3448 3449 Eval_Result_Kind :: enum c.int { 3450 Int = 1, 3451 Float = 2, 3452 ObjCStrLiteral = 3, 3453 StrLiteral = 4, 3454 CFStr = 5, 3455 Other = 6, 3456 UnExposed = 0, 3457 } 3458 3459 /** 3460 * Evaluation result of a cursor 3461 */ 3462 Eval_Result :: rawptr 3463 3464 /** 3465 * A remapping of original source files and their translated files. 3466 */ 3467 Remapping :: rawptr 3468 3469 /** \defgroup CINDEX_HIGH Higher level API functions 3470 * 3471 * @{ 3472 */ 3473 Visitor_Result :: enum c.int { 3474 Break, 3475 Continue, 3476 } 3477 3478 Cursor_And_Range_Visitor :: struct { 3479 _context: rawptr, 3480 visit: proc "c" (rawptr, Cursor, Source_Range) -> Visitor_Result, 3481 } 3482 3483 Result :: enum c.int { 3484 /** 3485 * Function returned successfully. 3486 */ 3487 Success, 3488 3489 /** 3490 * One of the parameters was invalid for the function. 3491 */ 3492 Invalid, 3493 3494 /** 3495 * The function was terminated by a callback (e.g. it returned 3496 * CXVisit_Break) 3497 */ 3498 VisitBreak, 3499 } 3500 3501 Cursor_And_Range_Visitor_Block :: struct {} 3502 3503 /** 3504 * The client's data object that is associated with a CXFile. 3505 */ 3506 Idx_Client_File :: rawptr 3507 3508 /** 3509 * The client's data object that is associated with a semantic entity. 3510 */ 3511 Idx_Client_Entity :: rawptr 3512 3513 /** 3514 * The client's data object that is associated with a semantic container 3515 * of entities. 3516 */ 3517 Idx_Client_Container :: rawptr 3518 3519 /** 3520 * The client's data object that is associated with an AST file (PCH 3521 * or module). 3522 */ 3523 Idx_Client_Astfile :: rawptr 3524 3525 /** 3526 * Source location passed to index callbacks. 3527 */ 3528 Idx_Loc :: struct { 3529 ptr_data: [2]rawptr, 3530 int_data: c.uint, 3531 } 3532 3533 /** 3534 * Data for ppIncludedFile callback. 3535 */ 3536 Idx_Included_File_Info :: struct { 3537 /** 3538 * Location of '#' in the \#include/\#import directive. 3539 */ 3540 hashLoc: Idx_Loc, 3541 3542 /** 3543 * Filename as written in the \#include/\#import directive. 3544 */ 3545 filename: cstring, 3546 3547 /** 3548 * The actual file that the \#include/\#import directive resolved to. 3549 */ 3550 file: File, 3551 isImport: c.int, 3552 isAngled: c.int, 3553 3554 /** 3555 * Non-zero if the directive was automatically turned into a module 3556 * import. 3557 */ 3558 isModuleImport: c.int, 3559 } 3560 3561 /** 3562 * Data for IndexerCallbacks#importedASTFile. 3563 */ 3564 Idx_Imported_Astfile_Info :: struct { 3565 /** 3566 * Top level AST file containing the imported PCH, module or submodule. 3567 */ 3568 file: File, 3569 3570 /** 3571 * The imported module or NULL if the AST file is a PCH. 3572 */ 3573 module: CXModule, 3574 3575 /** 3576 * Location where the file is imported. Applicable only for modules. 3577 */ 3578 loc: Idx_Loc, 3579 3580 /** 3581 * Non-zero if an inclusion directive was automatically turned into 3582 * a module import. Applicable only for modules. 3583 */ 3584 isImplicit: c.int, 3585 } 3586 3587 Idx_Entity_Kind :: enum c.int { 3588 Unexposed, 3589 Typedef, 3590 Function, 3591 Variable, 3592 Field, 3593 EnumConstant, 3594 ObjCClass, 3595 ObjCProtocol, 3596 ObjCCategory, 3597 ObjCInstanceMethod, 3598 ObjCClassMethod, 3599 ObjCProperty, 3600 ObjCIvar, 3601 Enum, 3602 Struct, 3603 Union, 3604 CXXClass, 3605 CXXNamespace, 3606 CXXNamespaceAlias, 3607 CXXStaticVariable, 3608 CXXStaticMethod, 3609 CXXInstanceMethod, 3610 CXXConstructor, 3611 CXXDestructor, 3612 CXXConversionFunction, 3613 CXXTypeAlias, 3614 CXXInterface, 3615 CXXConcept, 3616 } 3617 3618 Idx_Entity_Language :: enum c.int { 3619 None, 3620 C, 3621 ObjC, 3622 CXX, 3623 Swift, 3624 } 3625 3626 /** 3627 * Extra C++ template information for an entity. This can apply to: 3628 * CXIdxEntity_Function 3629 * CXIdxEntity_CXXClass 3630 * CXIdxEntity_CXXStaticMethod 3631 * CXIdxEntity_CXXInstanceMethod 3632 * CXIdxEntity_CXXConstructor 3633 * CXIdxEntity_CXXConversionFunction 3634 * CXIdxEntity_CXXTypeAlias 3635 */ 3636 Idx_Entity_Cxxtemplate_Kind :: enum c.int { 3637 NonTemplate, 3638 Template, 3639 TemplatePartialSpecialization, 3640 TemplateSpecialization, 3641 } 3642 3643 Idx_Attr_Kind :: enum c.int { 3644 Unexposed, 3645 IBAction, 3646 IBOutlet, 3647 IBOutletCollection, 3648 } 3649 3650 Idx_Attr_Info :: struct { 3651 kind: Idx_Attr_Kind, 3652 cursor: Cursor, 3653 loc: Idx_Loc, 3654 } 3655 3656 Idx_Entity_Info :: struct { 3657 kind: Idx_Entity_Kind, 3658 templateKind: Idx_Entity_Cxxtemplate_Kind, 3659 lang: Idx_Entity_Language, 3660 name: cstring, 3661 USR: cstring, 3662 cursor: Cursor, 3663 attributes: ^^Idx_Attr_Info, 3664 numAttributes: c.uint, 3665 } 3666 3667 Idx_Container_Info :: struct { 3668 cursor: Cursor, 3669 } 3670 3671 Idx_Iboutlet_Collection_Attr_Info :: struct { 3672 attrInfo: ^Idx_Attr_Info, 3673 objcClass: ^Idx_Entity_Info, 3674 classCursor: Cursor, 3675 classLoc: Idx_Loc, 3676 } 3677 3678 Idx_Decl_Info_Flags :: enum c.int { 3679 CXIdxDeclFlag_Skipped = 1, 3680 } 3681 3682 Idx_Decl_Info :: struct { 3683 entityInfo: ^Idx_Entity_Info, 3684 cursor: Cursor, 3685 loc: Idx_Loc, 3686 semanticContainer: ^Idx_Container_Info, 3687 3688 /** 3689 * Generally same as #semanticContainer but can be different in 3690 * cases like out-of-line C++ member functions. 3691 */ 3692 lexicalContainer: ^Idx_Container_Info, 3693 isRedeclaration: c.int, 3694 isDefinition: c.int, 3695 isContainer: c.int, 3696 declAsContainer: ^Idx_Container_Info, 3697 3698 /** 3699 * Whether the declaration exists in code or was created implicitly 3700 * by the compiler, e.g. implicit Objective-C methods for properties. 3701 */ 3702 isImplicit: c.int, 3703 attributes: ^^Idx_Attr_Info, 3704 numAttributes: c.uint, 3705 flags: c.uint, 3706 } 3707 3708 Idx_Obj_Ccontainer_Kind :: enum c.int { 3709 ForwardRef, 3710 Interface, 3711 Implementation, 3712 } 3713 3714 Idx_Obj_Ccontainer_Decl_Info :: struct { 3715 declInfo: ^Idx_Decl_Info, 3716 kind: Idx_Obj_Ccontainer_Kind, 3717 } 3718 3719 Idx_Base_Class_Info :: struct { 3720 base: ^Idx_Entity_Info, 3721 cursor: Cursor, 3722 loc: Idx_Loc, 3723 } 3724 3725 Idx_Obj_Cprotocol_Ref_Info :: struct { 3726 protocol: ^Idx_Entity_Info, 3727 cursor: Cursor, 3728 loc: Idx_Loc, 3729 } 3730 3731 Idx_Obj_Cprotocol_Ref_List_Info :: struct { 3732 protocols: ^^Idx_Obj_Cprotocol_Ref_Info, 3733 numProtocols: c.uint, 3734 } 3735 3736 Idx_Obj_Cinterface_Decl_Info :: struct { 3737 containerInfo: ^Idx_Obj_Ccontainer_Decl_Info, 3738 superInfo: ^Idx_Base_Class_Info, 3739 protocols: ^Idx_Obj_Cprotocol_Ref_List_Info, 3740 } 3741 3742 Idx_Obj_Ccategory_Decl_Info :: struct { 3743 containerInfo: ^Idx_Obj_Ccontainer_Decl_Info, 3744 objcClass: ^Idx_Entity_Info, 3745 classCursor: Cursor, 3746 classLoc: Idx_Loc, 3747 protocols: ^Idx_Obj_Cprotocol_Ref_List_Info, 3748 } 3749 3750 Idx_Obj_Cproperty_Decl_Info :: struct { 3751 declInfo: ^Idx_Decl_Info, 3752 getter: ^Idx_Entity_Info, 3753 setter: ^Idx_Entity_Info, 3754 } 3755 3756 Idx_Cxxclass_Decl_Info :: struct { 3757 declInfo: ^Idx_Decl_Info, 3758 bases: ^^Idx_Base_Class_Info, 3759 numBases: c.uint, 3760 } 3761 3762 /** 3763 * Data for IndexerCallbacks#indexEntityReference. 3764 * 3765 * This may be deprecated in a future version as this duplicates 3766 * the \c CXSymbolRole_Implicit bit in \c CXSymbolRole. 3767 */ 3768 Idx_Entity_Ref_Kind :: enum c.int { 3769 /** 3770 * The entity is referenced directly in user's code. 3771 */ 3772 Direct = 1, 3773 3774 /** 3775 * An implicit reference, e.g. a reference of an Objective-C method 3776 * via the dot syntax. 3777 */ 3778 Implicit = 2, 3779 } 3780 3781 /** 3782 * Roles that are attributed to symbol occurrences. 3783 * 3784 * Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with 3785 * higher bits zeroed. These high bits may be exposed in the future. 3786 */ 3787 Symbol_Role :: enum c.int { 3788 None = 0, 3789 Declaration = 1, 3790 Definition = 2, 3791 Reference = 4, 3792 Read = 8, 3793 Write = 16, 3794 Call = 32, 3795 Dynamic = 64, 3796 AddressOf = 128, 3797 Implicit = 256, 3798 } 3799 3800 /** 3801 * Data for IndexerCallbacks#indexEntityReference. 3802 */ 3803 Idx_Entity_Ref_Info :: struct { 3804 kind: Idx_Entity_Ref_Kind, 3805 3806 /** 3807 * Reference cursor. 3808 */ 3809 cursor: Cursor, 3810 loc: Idx_Loc, 3811 3812 /** 3813 * The entity that gets referenced. 3814 */ 3815 referencedEntity: ^Idx_Entity_Info, 3816 3817 /** 3818 * Immediate "parent" of the reference. For example: 3819 * 3820 * \code 3821 * Foo *var; 3822 * \endcode 3823 * 3824 * The parent of reference of type 'Foo' is the variable 'var'. 3825 * For references inside statement bodies of functions/methods, 3826 * the parentEntity will be the function/method. 3827 */ 3828 parentEntity: ^Idx_Entity_Info, 3829 3830 /** 3831 * Lexical container context of the reference. 3832 */ 3833 container: ^Idx_Container_Info, 3834 3835 /** 3836 * Sets of symbol roles of the reference. 3837 */ 3838 role: Symbol_Role, 3839 } 3840 3841 /** 3842 * A group of callbacks used by #clang_indexSourceFile and 3843 * #clang_indexTranslationUnit. 3844 */ 3845 Indexer_Callbacks :: struct { 3846 /** 3847 * Called periodically to check whether indexing should be aborted. 3848 * Should return 0 to continue, and non-zero to abort. 3849 */ 3850 abortQuery: proc "c" (Client_Data, rawptr) -> c.int, 3851 3852 /** 3853 * Called at the end of indexing; passes the complete diagnostic set. 3854 */ 3855 diagnostic: proc "c" (Client_Data, Diagnostic_Set, rawptr), 3856 enteredMainFile: proc "c" (Client_Data, File, rawptr) -> Idx_Client_File, 3857 3858 /** 3859 * Called when a file gets \#included/\#imported. 3860 */ 3861 ppIncludedFile: proc "c" (Client_Data, ^Idx_Included_File_Info) -> Idx_Client_File, 3862 3863 /** 3864 * Called when a AST file (PCH or module) gets imported. 3865 * 3866 * AST files will not get indexed (there will not be callbacks to index all 3867 * the entities in an AST file). The recommended action is that, if the AST 3868 * file is not already indexed, to initiate a new indexing job specific to 3869 * the AST file. 3870 */ 3871 importedASTFile: proc "c" (Client_Data, ^Idx_Imported_Astfile_Info) -> Idx_Client_Astfile, 3872 3873 /** 3874 * Called at the beginning of indexing a translation unit. 3875 */ 3876 startedTranslationUnit: proc "c" (Client_Data, rawptr) -> Idx_Client_Container, 3877 indexDeclaration: proc "c" (Client_Data, ^Idx_Decl_Info), 3878 3879 /** 3880 * Called to index a reference of an entity. 3881 */ 3882 indexEntityReference: proc "c" (Client_Data, ^Idx_Entity_Ref_Info), 3883 } 3884 3885 /** 3886 * An indexing action/session, to be applied to one or multiple 3887 * translation units. 3888 */ 3889 Index_Action :: rawptr 3890 3891 Index_Opt_Flags :: enum c.int { 3892 /** 3893 * Used to indicate that no special indexing options are needed. 3894 */ 3895 None = 0, 3896 3897 /** 3898 * Used to indicate that IndexerCallbacks#indexEntityReference should 3899 * be invoked for only one reference of an entity per source file that does 3900 * not also include a declaration/definition of the entity. 3901 */ 3902 SuppressRedundantRefs = 1, 3903 3904 /** 3905 * Function-local symbols should be indexed. If this is not set 3906 * function-local symbols will be ignored. 3907 */ 3908 IndexFunctionLocalSymbols = 2, 3909 3910 /** 3911 * Implicit function/class template instantiations should be indexed. 3912 * If this is not set, implicit instantiations will be ignored. 3913 */ 3914 IndexImplicitTemplateInstantiations = 4, 3915 3916 /** 3917 * Suppress all compiler warnings when parsing for indexing. 3918 */ 3919 SuppressWarnings = 8, 3920 3921 /** 3922 * Skip a function/method body that was already parsed during an 3923 * indexing session associated with a \c CXIndexAction object. 3924 * Bodies in system headers are always skipped. 3925 */ 3926 SkipParsedBodiesInSession = 16, 3927 } 3928 3929 /** 3930 * Visitor invoked for each field found by a traversal. 3931 * 3932 * This visitor function will be invoked for each field found by 3933 * \c clang_Type_visitFields. Its first argument is the cursor being 3934 * visited, its second argument is the client data provided to 3935 * \c clang_Type_visitFields. 3936 * 3937 * The visitor should return one of the \c CXVisitorResult values 3938 * to direct \c clang_Type_visitFields. 3939 */ 3940 Field_Visitor :: proc "c" (Cursor, Client_Data) -> Visitor_Result 3941 3942 /** 3943 * Describes the kind of binary operators. 3944 */ 3945 CXBinary_Operator_Kind :: enum c.int { 3946 /** This value describes cursors which are not binary operators. */ 3947 Invalid, 3948 3949 /** C++ Pointer - to - member operator. */ 3950 PtrMemD, 3951 3952 /** C++ Pointer - to - member operator. */ 3953 PtrMemI, 3954 3955 /** Multiplication operator. */ 3956 Mul, 3957 3958 /** Division operator. */ 3959 Div, 3960 3961 /** Remainder operator. */ 3962 Rem, 3963 3964 /** Addition operator. */ 3965 Add, 3966 3967 /** Subtraction operator. */ 3968 Sub, 3969 3970 /** Bitwise shift left operator. */ 3971 Shl, 3972 3973 /** Bitwise shift right operator. */ 3974 Shr, 3975 3976 /** C++ three-way comparison (spaceship) operator. */ 3977 Cmp, 3978 3979 /** Less than operator. */ 3980 LT, 3981 3982 /** Greater than operator. */ 3983 GT, 3984 3985 /** Less or equal operator. */ 3986 LE, 3987 3988 /** Greater or equal operator. */ 3989 GE, 3990 3991 /** Equal operator. */ 3992 EQ, 3993 3994 /** Not equal operator. */ 3995 NE, 3996 3997 /** Bitwise AND operator. */ 3998 And, 3999 4000 /** Bitwise XOR operator. */ 4001 Xor, 4002 4003 /** Bitwise OR operator. */ 4004 Or, 4005 4006 /** Logical AND operator. */ 4007 LAnd, 4008 4009 /** Logical OR operator. */ 4010 LOr, 4011 4012 /** Assignment operator. */ 4013 Assign, 4014 4015 /** Multiplication assignment operator. */ 4016 MulAssign, 4017 4018 /** Division assignment operator. */ 4019 DivAssign, 4020 4021 /** Remainder assignment operator. */ 4022 RemAssign, 4023 4024 /** Addition assignment operator. */ 4025 AddAssign, 4026 4027 /** Subtraction assignment operator. */ 4028 SubAssign, 4029 4030 /** Bitwise shift left assignment operator. */ 4031 ShlAssign, 4032 4033 /** Bitwise shift right assignment operator. */ 4034 ShrAssign, 4035 4036 /** Bitwise AND assignment operator. */ 4037 AndAssign, 4038 4039 /** Bitwise XOR assignment operator. */ 4040 XorAssign, 4041 4042 /** Bitwise OR assignment operator. */ 4043 OrAssign, 4044 4045 /** Comma operator. */ 4046 Comma, 4047 } 4048 4049 /** 4050 * Describes the kind of unary operators. 4051 */ 4052 Unary_Operator_Kind :: enum c.int { 4053 /** This value describes cursors which are not unary operators. */ 4054 Invalid, 4055 4056 /** Postfix increment operator. */ 4057 PostInc, 4058 4059 /** Postfix decrement operator. */ 4060 PostDec, 4061 4062 /** Prefix increment operator. */ 4063 PreInc, 4064 4065 /** Prefix decrement operator. */ 4066 PreDec, 4067 4068 /** Address of operator. */ 4069 AddrOf, 4070 4071 /** Dereference operator. */ 4072 Deref, 4073 4074 /** Plus operator. */ 4075 Plus, 4076 4077 /** Minus operator. */ 4078 Minus, 4079 4080 /** Not operator. */ 4081 Not, 4082 4083 /** LNot operator. */ 4084 LNot, 4085 4086 /** "__real expr" operator. */ 4087 Real, 4088 4089 /** "__imag expr" operator. */ 4090 Imag, 4091 4092 /** __extension__ marker operator. */ 4093 Extension, 4094 4095 /** C++ co_await operator. */ 4096 Coawait, 4097 } 4098 4099 @(default_calling_convention="c", link_prefix="clang_") 4100 foreign lib { 4101 /** 4102 * Provides a shared context for creating translation units. 4103 * 4104 * It provides two options: 4105 * 4106 * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" 4107 * declarations (when loading any new translation units). A "local" declaration 4108 * is one that belongs in the translation unit itself and not in a precompiled 4109 * header that was used by the translation unit. If zero, all declarations 4110 * will be enumerated. 4111 * 4112 * Here is an example: 4113 * 4114 * \code 4115 * // excludeDeclsFromPCH = 1, displayDiagnostics=1 4116 * Idx = clang_createIndex(1, 1); 4117 * 4118 * // IndexTest.pch was produced with the following command: 4119 * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" 4120 * TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); 4121 * 4122 * // This will load all the symbols from 'IndexTest.pch' 4123 * clang_visitChildren(clang_getTranslationUnitCursor(TU), 4124 * TranslationUnitVisitor, 0); 4125 * clang_disposeTranslationUnit(TU); 4126 * 4127 * // This will load all the symbols from 'IndexTest.c', excluding symbols 4128 * // from 'IndexTest.pch'. 4129 * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; 4130 * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, 4131 * 0, 0); 4132 * clang_visitChildren(clang_getTranslationUnitCursor(TU), 4133 * TranslationUnitVisitor, 0); 4134 * clang_disposeTranslationUnit(TU); 4135 * \endcode 4136 * 4137 * This process of creating the 'pch', loading it separately, and using it (via 4138 * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks 4139 * (which gives the indexer the same performance benefit as the compiler). 4140 */ 4141 createIndex :: proc(excludeDeclarationsFromPCH: c.int, displayDiagnostics: c.int) -> Index --- 4142 4143 /** 4144 * Destroy the given index. 4145 * 4146 * The index must not be destroyed until all of the translation units created 4147 * within that index have been destroyed. 4148 */ 4149 disposeIndex :: proc(index: Index) --- 4150 4151 /** 4152 * Provides a shared context for creating translation units. 4153 * 4154 * Call this function instead of clang_createIndex() if you need to configure 4155 * the additional options in CXIndexOptions. 4156 * 4157 * \returns The created index or null in case of error, such as an unsupported 4158 * value of options->Size. 4159 * 4160 * For example: 4161 * \code 4162 * CXIndex createIndex(const char *ApplicationTemporaryPath) { 4163 * const int ExcludeDeclarationsFromPCH = 1; 4164 * const int DisplayDiagnostics = 1; 4165 * CXIndex Idx; 4166 * #if CINDEX_VERSION_MINOR >= 64 4167 * CXIndexOptions Opts; 4168 * memset(&Opts, 0, sizeof(Opts)); 4169 * Opts.Size = sizeof(CXIndexOptions); 4170 * Opts.ThreadBackgroundPriorityForIndexing = 1; 4171 * Opts.ExcludeDeclarationsFromPCH = ExcludeDeclarationsFromPCH; 4172 * Opts.DisplayDiagnostics = DisplayDiagnostics; 4173 * Opts.PreambleStoragePath = ApplicationTemporaryPath; 4174 * Idx = clang_createIndexWithOptions(&Opts); 4175 * if (Idx) 4176 * return Idx; 4177 * fprintf(stderr, 4178 * "clang_createIndexWithOptions() failed. " 4179 * "CINDEX_VERSION_MINOR = %d, sizeof(CXIndexOptions) = %u\n", 4180 * CINDEX_VERSION_MINOR, Opts.Size); 4181 * #else 4182 * (void)ApplicationTemporaryPath; 4183 * #endif 4184 * Idx = clang_createIndex(ExcludeDeclarationsFromPCH, DisplayDiagnostics); 4185 * clang_CXIndex_setGlobalOptions( 4186 * Idx, clang_CXIndex_getGlobalOptions(Idx) | 4187 * CXGlobalOpt_ThreadBackgroundPriorityForIndexing); 4188 * return Idx; 4189 * } 4190 * \endcode 4191 * 4192 * \sa clang_createIndex() 4193 */ 4194 createIndexWithOptions :: proc(options: ^Index_Options) -> Index --- 4195 4196 /** 4197 * Sets general options associated with a CXIndex. 4198 * 4199 * This function is DEPRECATED. Set 4200 * CXIndexOptions::ThreadBackgroundPriorityForIndexing and/or 4201 * CXIndexOptions::ThreadBackgroundPriorityForEditing and call 4202 * clang_createIndexWithOptions() instead. 4203 * 4204 * For example: 4205 * \code 4206 * CXIndex idx = ...; 4207 * clang_CXIndex_setGlobalOptions(idx, 4208 * clang_CXIndex_getGlobalOptions(idx) | 4209 * CXGlobalOpt_ThreadBackgroundPriorityForIndexing); 4210 * \endcode 4211 * 4212 * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. 4213 */ 4214 CXIndex_setGlobalOptions :: proc(_: Index, options: c.uint) --- 4215 4216 /** 4217 * Gets the general options associated with a CXIndex. 4218 * 4219 * This function allows to obtain the final option values used by libclang after 4220 * specifying the option policies via CXChoice enumerators. 4221 * 4222 * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that 4223 * are associated with the given CXIndex object. 4224 */ 4225 CXIndex_getGlobalOptions :: proc(_: Index) -> c.uint --- 4226 4227 /** 4228 * Sets the invocation emission path option in a CXIndex. 4229 * 4230 * This function is DEPRECATED. Set CXIndexOptions::InvocationEmissionPath and 4231 * call clang_createIndexWithOptions() instead. 4232 * 4233 * The invocation emission path specifies a path which will contain log 4234 * files for certain libclang invocations. A null value (default) implies that 4235 * libclang invocations are not logged.. 4236 */ 4237 CXIndex_setInvocationEmissionPathOption :: proc(_: Index, Path: cstring) --- 4238 4239 /** 4240 * Determine whether the given header is guarded against 4241 * multiple inclusions, either with the conventional 4242 * \#ifndef/\#define/\#endif macro guards or with \#pragma once. 4243 */ 4244 isFileMultipleIncludeGuarded :: proc(tu: Translation_Unit, file: File) -> c.uint --- 4245 4246 /** 4247 * Retrieve a file handle within the given translation unit. 4248 * 4249 * \param tu the translation unit 4250 * 4251 * \param file_name the name of the file. 4252 * 4253 * \returns the file handle for the named file in the translation unit \p tu, 4254 * or a NULL file handle if the file was not a part of this translation unit. 4255 */ 4256 getFile :: proc(tu: Translation_Unit, file_name: cstring) -> File --- 4257 4258 /** 4259 * Retrieve the buffer associated with the given file. 4260 * 4261 * \param tu the translation unit 4262 * 4263 * \param file the file for which to retrieve the buffer. 4264 * 4265 * \param size [out] if non-NULL, will be set to the size of the buffer. 4266 * 4267 * \returns a pointer to the buffer in memory that holds the contents of 4268 * \p file, or a NULL pointer when the file is not loaded. 4269 */ 4270 getFileContents :: proc(tu: Translation_Unit, file: File, size: ^c.size_t) -> cstring --- 4271 4272 /** 4273 * Retrieves the source location associated with a given file/line/column 4274 * in a particular translation unit. 4275 */ 4276 getLocation :: proc(tu: Translation_Unit, file: File, line: c.uint, column: c.uint) -> Source_Location --- 4277 4278 /** 4279 * Retrieves the source location associated with a given character offset 4280 * in a particular translation unit. 4281 */ 4282 getLocationForOffset :: proc(tu: Translation_Unit, file: File, offset: c.uint) -> Source_Location --- 4283 4284 /** 4285 * Retrieve all ranges that were skipped by the preprocessor. 4286 * 4287 * The preprocessor will skip lines when they are surrounded by an 4288 * if/ifdef/ifndef directive whose condition does not evaluate to true. 4289 */ 4290 getSkippedRanges :: proc(tu: Translation_Unit, file: File) -> ^Source_Range_List --- 4291 4292 /** 4293 * Retrieve all ranges from all files that were skipped by the 4294 * preprocessor. 4295 * 4296 * The preprocessor will skip lines when they are surrounded by an 4297 * if/ifdef/ifndef directive whose condition does not evaluate to true. 4298 */ 4299 getAllSkippedRanges :: proc(tu: Translation_Unit) -> ^Source_Range_List --- 4300 4301 /** 4302 * Determine the number of diagnostics produced for the given 4303 * translation unit. 4304 */ 4305 getNumDiagnostics :: proc(Unit: Translation_Unit) -> c.uint --- 4306 4307 /** 4308 * Retrieve a diagnostic associated with the given translation unit. 4309 * 4310 * \param Unit the translation unit to query. 4311 * \param Index the zero-based diagnostic number to retrieve. 4312 * 4313 * \returns the requested diagnostic. This diagnostic must be freed 4314 * via a call to \c clang_disposeDiagnostic(). 4315 */ 4316 getDiagnostic :: proc(Unit: Translation_Unit, Index: c.uint) -> Diagnostic --- 4317 4318 /** 4319 * Retrieve the complete set of diagnostics associated with a 4320 * translation unit. 4321 * 4322 * \param Unit the translation unit to query. 4323 */ 4324 getDiagnosticSetFromTU :: proc(Unit: Translation_Unit) -> Diagnostic_Set --- 4325 4326 /** 4327 * Get the original translation unit source file name. 4328 */ 4329 getTranslationUnitSpelling :: proc(CTUnit: Translation_Unit) -> String --- 4330 4331 /** 4332 * Return the CXTranslationUnit for a given source file and the provided 4333 * command line arguments one would pass to the compiler. 4334 * 4335 * Note: The 'source_filename' argument is optional. If the caller provides a 4336 * NULL pointer, the name of the source file is expected to reside in the 4337 * specified command line arguments. 4338 * 4339 * Note: When encountered in 'clang_command_line_args', the following options 4340 * are ignored: 4341 * 4342 * '-c' 4343 * '-emit-ast' 4344 * '-fsyntax-only' 4345 * '-o \<output file>' (both '-o' and '\<output file>' are ignored) 4346 * 4347 * \param CIdx The index object with which the translation unit will be 4348 * associated. 4349 * 4350 * \param source_filename The name of the source file to load, or NULL if the 4351 * source file is included in \p clang_command_line_args. 4352 * 4353 * \param num_clang_command_line_args The number of command-line arguments in 4354 * \p clang_command_line_args. 4355 * 4356 * \param clang_command_line_args The command-line arguments that would be 4357 * passed to the \c clang executable if it were being invoked out-of-process. 4358 * These command-line options will be parsed and will affect how the translation 4359 * unit is parsed. Note that the following options are ignored: '-c', 4360 * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'. 4361 * 4362 * \param num_unsaved_files the number of unsaved file entries in \p 4363 * unsaved_files. 4364 * 4365 * \param unsaved_files the files that have not yet been saved to disk 4366 * but may be required for code completion, including the contents of 4367 * those files. The contents and name of these files (as specified by 4368 * CXUnsavedFile) are copied when necessary, so the client only needs to 4369 * guarantee their validity until the call to this function returns. 4370 */ 4371 createTranslationUnitFromSourceFile :: proc(CIdx: Index, source_filename: cstring, num_clang_command_line_args: c.int, clang_command_line_args: [^]cstring, num_unsaved_files: c.uint, unsaved_files: ^Unsaved_File) -> Translation_Unit --- 4372 4373 /** 4374 * Same as \c clang_createTranslationUnit2, but returns 4375 * the \c CXTranslationUnit instead of an error code. In case of an error this 4376 * routine returns a \c NULL \c CXTranslationUnit, without further detailed 4377 * error codes. 4378 */ 4379 createTranslationUnit :: proc(CIdx: Index, ast_filename: cstring) -> Translation_Unit --- 4380 4381 /** 4382 * Create a translation unit from an AST file (\c -emit-ast). 4383 * 4384 * \param[out] out_TU A non-NULL pointer to store the created 4385 * \c CXTranslationUnit. 4386 * 4387 * \returns Zero on success, otherwise returns an error code. 4388 */ 4389 createTranslationUnit2 :: proc(CIdx: Index, ast_filename: cstring, out_TU: ^Translation_Unit) -> Error_Code --- 4390 4391 /** 4392 * Returns the set of flags that is suitable for parsing a translation 4393 * unit that is being edited. 4394 * 4395 * The set of flags returned provide options for \c clang_parseTranslationUnit() 4396 * to indicate that the translation unit is likely to be reparsed many times, 4397 * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly 4398 * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag 4399 * set contains an unspecified set of optimizations (e.g., the precompiled 4400 * preamble) geared toward improving the performance of these routines. The 4401 * set of optimizations enabled may change from one version to the next. 4402 */ 4403 defaultEditingTranslationUnitOptions :: proc() -> c.uint --- 4404 4405 /** 4406 * Same as \c clang_parseTranslationUnit2, but returns 4407 * the \c CXTranslationUnit instead of an error code. In case of an error this 4408 * routine returns a \c NULL \c CXTranslationUnit, without further detailed 4409 * error codes. 4410 */ 4411 parseTranslationUnit :: proc(CIdx: Index, source_filename: cstring, command_line_args: [^]cstring, num_command_line_args: c.int, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, options: Translation_Unit_Flags) -> Translation_Unit --- 4412 4413 /** 4414 * Parse the given source file and the translation unit corresponding 4415 * to that file. 4416 * 4417 * This routine is the main entry point for the Clang C API, providing the 4418 * ability to parse a source file into a translation unit that can then be 4419 * queried by other functions in the API. This routine accepts a set of 4420 * command-line arguments so that the compilation can be configured in the same 4421 * way that the compiler is configured on the command line. 4422 * 4423 * \param CIdx The index object with which the translation unit will be 4424 * associated. 4425 * 4426 * \param source_filename The name of the source file to load, or NULL if the 4427 * source file is included in \c command_line_args. 4428 * 4429 * \param command_line_args The command-line arguments that would be 4430 * passed to the \c clang executable if it were being invoked out-of-process. 4431 * These command-line options will be parsed and will affect how the translation 4432 * unit is parsed. Note that the following options are ignored: '-c', 4433 * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'. 4434 * 4435 * \param num_command_line_args The number of command-line arguments in 4436 * \c command_line_args. 4437 * 4438 * \param unsaved_files the files that have not yet been saved to disk 4439 * but may be required for parsing, including the contents of 4440 * those files. The contents and name of these files (as specified by 4441 * CXUnsavedFile) are copied when necessary, so the client only needs to 4442 * guarantee their validity until the call to this function returns. 4443 * 4444 * \param num_unsaved_files the number of unsaved file entries in \p 4445 * unsaved_files. 4446 * 4447 * \param options A bitmask of options that affects how the translation unit 4448 * is managed but not its compilation. This should be a bitwise OR of the 4449 * CXTranslationUnit_XXX flags. 4450 * 4451 * \param[out] out_TU A non-NULL pointer to store the created 4452 * \c CXTranslationUnit, describing the parsed code and containing any 4453 * diagnostics produced by the compiler. 4454 * 4455 * \returns Zero on success, otherwise returns an error code. 4456 */ 4457 parseTranslationUnit2 :: proc(CIdx: Index, source_filename: cstring, command_line_args: [^]cstring, num_command_line_args: c.int, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, options: Translation_Unit_Flags, out_TU: ^Translation_Unit) -> Error_Code --- 4458 4459 /** 4460 * Same as clang_parseTranslationUnit2 but requires a full command line 4461 * for \c command_line_args including argv[0]. This is useful if the standard 4462 * library paths are relative to the binary. 4463 */ 4464 parseTranslationUnit2FullArgv :: proc(CIdx: Index, source_filename: cstring, command_line_args: [^]cstring, num_command_line_args: c.int, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, options: Translation_Unit_Flags, out_TU: ^Translation_Unit) -> Error_Code --- 4465 4466 /** 4467 * Returns the set of flags that is suitable for saving a translation 4468 * unit. 4469 * 4470 * The set of flags returned provide options for 4471 * \c clang_saveTranslationUnit() by default. The returned flag 4472 * set contains an unspecified set of options that save translation units with 4473 * the most commonly-requested data. 4474 */ 4475 defaultSaveOptions :: proc(TU: Translation_Unit) -> c.uint --- 4476 4477 /** 4478 * Saves a translation unit into a serialized representation of 4479 * that translation unit on disk. 4480 * 4481 * Any translation unit that was parsed without error can be saved 4482 * into a file. The translation unit can then be deserialized into a 4483 * new \c CXTranslationUnit with \c clang_createTranslationUnit() or, 4484 * if it is an incomplete translation unit that corresponds to a 4485 * header, used as a precompiled header when parsing other translation 4486 * units. 4487 * 4488 * \param TU The translation unit to save. 4489 * 4490 * \param FileName The file to which the translation unit will be saved. 4491 * 4492 * \param options A bitmask of options that affects how the translation unit 4493 * is saved. This should be a bitwise OR of the 4494 * CXSaveTranslationUnit_XXX flags. 4495 * 4496 * \returns A value that will match one of the enumerators of the CXSaveError 4497 * enumeration. Zero (CXSaveError_None) indicates that the translation unit was 4498 * saved successfully, while a non-zero value indicates that a problem occurred. 4499 */ 4500 saveTranslationUnit :: proc(TU: Translation_Unit, FileName: cstring, options: c.uint) -> c.int --- 4501 4502 /** 4503 * Suspend a translation unit in order to free memory associated with it. 4504 * 4505 * A suspended translation unit uses significantly less memory but on the other 4506 * side does not support any other calls than \c clang_reparseTranslationUnit 4507 * to resume it or \c clang_disposeTranslationUnit to dispose it completely. 4508 */ 4509 suspendTranslationUnit :: proc(_: Translation_Unit) -> c.uint --- 4510 4511 /** 4512 * Destroy the specified CXTranslationUnit object. 4513 */ 4514 disposeTranslationUnit :: proc(_: Translation_Unit) --- 4515 4516 /** 4517 * Returns the set of flags that is suitable for reparsing a translation 4518 * unit. 4519 * 4520 * The set of flags returned provide options for 4521 * \c clang_reparseTranslationUnit() by default. The returned flag 4522 * set contains an unspecified set of optimizations geared toward common uses 4523 * of reparsing. The set of optimizations enabled may change from one version 4524 * to the next. 4525 */ 4526 defaultReparseOptions :: proc(TU: Translation_Unit) -> c.uint --- 4527 4528 /** 4529 * Reparse the source files that produced this translation unit. 4530 * 4531 * This routine can be used to re-parse the source files that originally 4532 * created the given translation unit, for example because those source files 4533 * have changed (either on disk or as passed via \p unsaved_files). The 4534 * source code will be reparsed with the same command-line options as it 4535 * was originally parsed. 4536 * 4537 * Reparsing a translation unit invalidates all cursors and source locations 4538 * that refer into that translation unit. This makes reparsing a translation 4539 * unit semantically equivalent to destroying the translation unit and then 4540 * creating a new translation unit with the same command-line arguments. 4541 * However, it may be more efficient to reparse a translation 4542 * unit using this routine. 4543 * 4544 * \param TU The translation unit whose contents will be re-parsed. The 4545 * translation unit must originally have been built with 4546 * \c clang_createTranslationUnitFromSourceFile(). 4547 * 4548 * \param num_unsaved_files The number of unsaved file entries in \p 4549 * unsaved_files. 4550 * 4551 * \param unsaved_files The files that have not yet been saved to disk 4552 * but may be required for parsing, including the contents of 4553 * those files. The contents and name of these files (as specified by 4554 * CXUnsavedFile) are copied when necessary, so the client only needs to 4555 * guarantee their validity until the call to this function returns. 4556 * 4557 * \param options A bitset of options composed of the flags in CXReparse_Flags. 4558 * The function \c clang_defaultReparseOptions() produces a default set of 4559 * options recommended for most uses, based on the translation unit. 4560 * 4561 * \returns 0 if the sources could be reparsed. A non-zero error code will be 4562 * returned if reparsing was impossible, such that the translation unit is 4563 * invalid. In such cases, the only valid call for \c TU is 4564 * \c clang_disposeTranslationUnit(TU). The error codes returned by this 4565 * routine are described by the \c CXErrorCode enum. 4566 */ 4567 reparseTranslationUnit :: proc(TU: Translation_Unit, num_unsaved_files: c.uint, unsaved_files: ^Unsaved_File, options: c.uint) -> c.int --- 4568 4569 /** 4570 * Returns the human-readable null-terminated C string that represents 4571 * the name of the memory category. This string should never be freed. 4572 */ 4573 getTUResourceUsageName :: proc(kind: Turesource_Usage_Kind) -> cstring --- 4574 4575 /** 4576 * Return the memory usage of a translation unit. This object 4577 * should be released with clang_disposeCXTUResourceUsage(). 4578 */ 4579 getCXTUResourceUsage :: proc(TU: Translation_Unit) -> Turesource_Usage --- 4580 disposeCXTUResourceUsage :: proc(usage: Turesource_Usage) --- 4581 4582 /** 4583 * Get target information for this translation unit. 4584 * 4585 * The CXTargetInfo object cannot outlive the CXTranslationUnit object. 4586 */ 4587 getTranslationUnitTargetInfo :: proc(CTUnit: Translation_Unit) -> Target_Info --- 4588 4589 /** 4590 * Destroy the CXTargetInfo object. 4591 */ 4592 TargetInfo_dispose :: proc(Info: Target_Info) --- 4593 4594 /** 4595 * Get the normalized target triple as a string. 4596 * 4597 * Returns the empty string in case of any error. 4598 */ 4599 TargetInfo_getTriple :: proc(Info: Target_Info) -> String --- 4600 4601 /** 4602 * Get the pointer width of the target in bits. 4603 * 4604 * Returns -1 in case of error. 4605 */ 4606 TargetInfo_getPointerWidth :: proc(Info: Target_Info) -> c.int --- 4607 4608 /** 4609 * Retrieve the NULL cursor, which represents no entity. 4610 */ 4611 getNullCursor :: proc() -> Cursor --- 4612 4613 /** 4614 * Retrieve the cursor that represents the given translation unit. 4615 * 4616 * The translation unit cursor can be used to start traversing the 4617 * various declarations within the given translation unit. 4618 */ 4619 getTranslationUnitCursor :: proc(_: Translation_Unit) -> Cursor --- 4620 4621 /** 4622 * Determine whether two cursors are equivalent. 4623 */ 4624 equalCursors :: proc(_: Cursor, _: Cursor) -> c.uint --- 4625 4626 /** 4627 * Returns non-zero if \p cursor is null. 4628 */ 4629 Cursor_isNull :: proc(cursor: Cursor) -> c.int --- 4630 4631 /** 4632 * Compute a hash value for the given cursor. 4633 */ 4634 hashCursor :: proc(_: Cursor) -> c.uint --- 4635 4636 /** 4637 * Retrieve the kind of the given cursor. 4638 */ 4639 getCursorKind :: proc(_: Cursor) -> Cursor_Kind --- 4640 4641 /** 4642 * Determine whether the given cursor kind represents a declaration. 4643 */ 4644 isDeclaration :: proc(_: Cursor_Kind) -> c.uint --- 4645 4646 /** 4647 * Determine whether the given declaration is invalid. 4648 * 4649 * A declaration is invalid if it could not be parsed successfully. 4650 * 4651 * \returns non-zero if the cursor represents a declaration and it is 4652 * invalid, otherwise NULL. 4653 */ 4654 isInvalidDeclaration :: proc(_: Cursor) -> c.uint --- 4655 4656 /** 4657 * Determine whether the given cursor kind represents a simple 4658 * reference. 4659 * 4660 * Note that other kinds of cursors (such as expressions) can also refer to 4661 * other cursors. Use clang_getCursorReferenced() to determine whether a 4662 * particular cursor refers to another entity. 4663 */ 4664 isReference :: proc(_: Cursor_Kind) -> c.uint --- 4665 4666 /** 4667 * Determine whether the given cursor kind represents an expression. 4668 */ 4669 isExpression :: proc(_: Cursor_Kind) -> c.uint --- 4670 4671 /** 4672 * Determine whether the given cursor kind represents a statement. 4673 */ 4674 isStatement :: proc(_: Cursor_Kind) -> c.uint --- 4675 4676 /** 4677 * Determine whether the given cursor kind represents an attribute. 4678 */ 4679 isAttribute :: proc(_: Cursor_Kind) -> c.uint --- 4680 4681 /** 4682 * Determine whether the given cursor has any attributes. 4683 */ 4684 Cursor_hasAttrs :: proc(C: Cursor) -> c.uint --- 4685 4686 /** 4687 * Determine whether the given cursor kind represents an invalid 4688 * cursor. 4689 */ 4690 isInvalid :: proc(_: Cursor_Kind) -> c.uint --- 4691 4692 /** 4693 * Determine whether the given cursor kind represents a translation 4694 * unit. 4695 */ 4696 isTranslationUnit :: proc(_: Cursor_Kind) -> c.uint --- 4697 4698 /*** 4699 * Determine whether the given cursor represents a preprocessing 4700 * element, such as a preprocessor directive or macro instantiation. 4701 */ 4702 isPreprocessing :: proc(_: Cursor_Kind) -> c.uint --- 4703 4704 /*** 4705 * Determine whether the given cursor represents a currently 4706 * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). 4707 */ 4708 isUnexposed :: proc(_: Cursor_Kind) -> c.uint --- 4709 4710 /** 4711 * Determine the linkage of the entity referred to by a given cursor. 4712 */ 4713 getCursorLinkage :: proc(cursor: Cursor) -> Linkage_Kind --- 4714 4715 /** 4716 * Describe the visibility of the entity referred to by a cursor. 4717 * 4718 * This returns the default visibility if not explicitly specified by 4719 * a visibility attribute. The default visibility may be changed by 4720 * commandline arguments. 4721 * 4722 * \param cursor The cursor to query. 4723 * 4724 * \returns The visibility of the cursor. 4725 */ 4726 getCursorVisibility :: proc(cursor: Cursor) -> Visibility_Kind --- 4727 4728 /** 4729 * Determine the availability of the entity that this cursor refers to, 4730 * taking the current target platform into account. 4731 * 4732 * \param cursor The cursor to query. 4733 * 4734 * \returns The availability of the cursor. 4735 */ 4736 getCursorAvailability :: proc(cursor: Cursor) -> Availability_Kind --- 4737 4738 /** 4739 * Determine the availability of the entity that this cursor refers to 4740 * on any platforms for which availability information is known. 4741 * 4742 * \param cursor The cursor to query. 4743 * 4744 * \param always_deprecated If non-NULL, will be set to indicate whether the 4745 * entity is deprecated on all platforms. 4746 * 4747 * \param deprecated_message If non-NULL, will be set to the message text 4748 * provided along with the unconditional deprecation of this entity. The client 4749 * is responsible for deallocating this string. 4750 * 4751 * \param always_unavailable If non-NULL, will be set to indicate whether the 4752 * entity is unavailable on all platforms. 4753 * 4754 * \param unavailable_message If non-NULL, will be set to the message text 4755 * provided along with the unconditional unavailability of this entity. The 4756 * client is responsible for deallocating this string. 4757 * 4758 * \param availability If non-NULL, an array of CXPlatformAvailability instances 4759 * that will be populated with platform availability information, up to either 4760 * the number of platforms for which availability information is available (as 4761 * returned by this function) or \c availability_size, whichever is smaller. 4762 * 4763 * \param availability_size The number of elements available in the 4764 * \c availability array. 4765 * 4766 * \returns The number of platforms (N) for which availability information is 4767 * available (which is unrelated to \c availability_size). 4768 * 4769 * Note that the client is responsible for calling 4770 * \c clang_disposeCXPlatformAvailability to free each of the 4771 * platform-availability structures returned. There are 4772 * \c min(N, availability_size) such structures. 4773 */ 4774 getCursorPlatformAvailability :: proc(cursor: Cursor, always_deprecated: ^c.int, deprecated_message: ^String, always_unavailable: ^c.int, unavailable_message: ^String, availability: ^Platform_Availability, availability_size: c.int) -> c.int --- 4775 4776 /** 4777 * Free the memory associated with a \c CXPlatformAvailability structure. 4778 */ 4779 disposeCXPlatformAvailability :: proc(availability: ^Platform_Availability) --- 4780 4781 /** 4782 * If cursor refers to a variable declaration and it has initializer returns 4783 * cursor referring to the initializer otherwise return null cursor. 4784 */ 4785 Cursor_getVarDeclInitializer :: proc(cursor: Cursor) -> Cursor --- 4786 4787 /** 4788 * If cursor refers to a variable declaration that has global storage returns 1. 4789 * If cursor refers to a variable declaration that doesn't have global storage 4790 * returns 0. Otherwise returns -1. 4791 */ 4792 Cursor_hasVarDeclGlobalStorage :: proc(cursor: Cursor) -> c.int --- 4793 4794 /** 4795 * If cursor refers to a variable declaration that has external storage 4796 * returns 1. If cursor refers to a variable declaration that doesn't have 4797 * external storage returns 0. Otherwise returns -1. 4798 */ 4799 Cursor_hasVarDeclExternalStorage :: proc(cursor: Cursor) -> c.int --- 4800 4801 /** 4802 * Determine the "language" of the entity referred to by a given cursor. 4803 */ 4804 getCursorLanguage :: proc(cursor: Cursor) -> Language_Kind --- 4805 4806 /** 4807 * Determine the "thread-local storage (TLS) kind" of the declaration 4808 * referred to by a cursor. 4809 */ 4810 getCursorTLSKind :: proc(cursor: Cursor) -> Tlskind --- 4811 4812 /** 4813 * Returns the translation unit that a cursor originated from. 4814 */ 4815 Cursor_getTranslationUnit :: proc(_: Cursor) -> Translation_Unit --- 4816 4817 /** 4818 * Creates an empty CXCursorSet. 4819 */ 4820 createCXCursorSet :: proc() -> Cursor_Set --- 4821 4822 /** 4823 * Disposes a CXCursorSet and releases its associated memory. 4824 */ 4825 disposeCXCursorSet :: proc(cset: Cursor_Set) --- 4826 4827 /** 4828 * Queries a CXCursorSet to see if it contains a specific CXCursor. 4829 * 4830 * \returns non-zero if the set contains the specified cursor. 4831 */ 4832 CXCursorSet_contains :: proc(cset: Cursor_Set, cursor: Cursor) -> c.uint --- 4833 4834 /** 4835 * Inserts a CXCursor into a CXCursorSet. 4836 * 4837 * \returns zero if the CXCursor was already in the set, and non-zero otherwise. 4838 */ 4839 CXCursorSet_insert :: proc(cset: Cursor_Set, cursor: Cursor) -> c.uint --- 4840 4841 /** 4842 * Determine the semantic parent of the given cursor. 4843 * 4844 * The semantic parent of a cursor is the cursor that semantically contains 4845 * the given \p cursor. For many declarations, the lexical and semantic parents 4846 * are equivalent (the lexical parent is returned by 4847 * \c clang_getCursorLexicalParent()). They diverge when declarations or 4848 * definitions are provided out-of-line. For example: 4849 * 4850 * \code 4851 * class C { 4852 * void f(); 4853 * }; 4854 * 4855 * void C::f() { } 4856 * \endcode 4857 * 4858 * In the out-of-line definition of \c C::f, the semantic parent is 4859 * the class \c C, of which this function is a member. The lexical parent is 4860 * the place where the declaration actually occurs in the source code; in this 4861 * case, the definition occurs in the translation unit. In general, the 4862 * lexical parent for a given entity can change without affecting the semantics 4863 * of the program, and the lexical parent of different declarations of the 4864 * same entity may be different. Changing the semantic parent of a declaration, 4865 * on the other hand, can have a major impact on semantics, and redeclarations 4866 * of a particular entity should all have the same semantic context. 4867 * 4868 * In the example above, both declarations of \c C::f have \c C as their 4869 * semantic context, while the lexical context of the first \c C::f is \c C 4870 * and the lexical context of the second \c C::f is the translation unit. 4871 * 4872 * For global declarations, the semantic parent is the translation unit. 4873 */ 4874 getCursorSemanticParent :: proc(cursor: Cursor) -> Cursor --- 4875 4876 /** 4877 * Determine the lexical parent of the given cursor. 4878 * 4879 * The lexical parent of a cursor is the cursor in which the given \p cursor 4880 * was actually written. For many declarations, the lexical and semantic parents 4881 * are equivalent (the semantic parent is returned by 4882 * \c clang_getCursorSemanticParent()). They diverge when declarations or 4883 * definitions are provided out-of-line. For example: 4884 * 4885 * \code 4886 * class C { 4887 * void f(); 4888 * }; 4889 * 4890 * void C::f() { } 4891 * \endcode 4892 * 4893 * In the out-of-line definition of \c C::f, the semantic parent is 4894 * the class \c C, of which this function is a member. The lexical parent is 4895 * the place where the declaration actually occurs in the source code; in this 4896 * case, the definition occurs in the translation unit. In general, the 4897 * lexical parent for a given entity can change without affecting the semantics 4898 * of the program, and the lexical parent of different declarations of the 4899 * same entity may be different. Changing the semantic parent of a declaration, 4900 * on the other hand, can have a major impact on semantics, and redeclarations 4901 * of a particular entity should all have the same semantic context. 4902 * 4903 * In the example above, both declarations of \c C::f have \c C as their 4904 * semantic context, while the lexical context of the first \c C::f is \c C 4905 * and the lexical context of the second \c C::f is the translation unit. 4906 * 4907 * For declarations written in the global scope, the lexical parent is 4908 * the translation unit. 4909 */ 4910 getCursorLexicalParent :: proc(cursor: Cursor) -> Cursor --- 4911 4912 /** 4913 * Determine the set of methods that are overridden by the given 4914 * method. 4915 * 4916 * In both Objective-C and C++, a method (aka virtual member function, 4917 * in C++) can override a virtual method in a base class. For 4918 * Objective-C, a method is said to override any method in the class's 4919 * base class, its protocols, or its categories' protocols, that has the same 4920 * selector and is of the same kind (class or instance). 4921 * If no such method exists, the search continues to the class's superclass, 4922 * its protocols, and its categories, and so on. A method from an Objective-C 4923 * implementation is considered to override the same methods as its 4924 * corresponding method in the interface. 4925 * 4926 * For C++, a virtual member function overrides any virtual member 4927 * function with the same signature that occurs in its base 4928 * classes. With multiple inheritance, a virtual member function can 4929 * override several virtual member functions coming from different 4930 * base classes. 4931 * 4932 * In all cases, this function determines the immediate overridden 4933 * method, rather than all of the overridden methods. For example, if 4934 * a method is originally declared in a class A, then overridden in B 4935 * (which in inherits from A) and also in C (which inherited from B), 4936 * then the only overridden method returned from this function when 4937 * invoked on C's method will be B's method. The client may then 4938 * invoke this function again, given the previously-found overridden 4939 * methods, to map out the complete method-override set. 4940 * 4941 * \param cursor A cursor representing an Objective-C or C++ 4942 * method. This routine will compute the set of methods that this 4943 * method overrides. 4944 * 4945 * \param overridden A pointer whose pointee will be replaced with a 4946 * pointer to an array of cursors, representing the set of overridden 4947 * methods. If there are no overridden methods, the pointee will be 4948 * set to NULL. The pointee must be freed via a call to 4949 * \c clang_disposeOverriddenCursors(). 4950 * 4951 * \param num_overridden A pointer to the number of overridden 4952 * functions, will be set to the number of overridden functions in the 4953 * array pointed to by \p overridden. 4954 */ 4955 getOverriddenCursors :: proc(cursor: Cursor, overridden: ^^Cursor, num_overridden: ^c.uint) --- 4956 4957 /** 4958 * Free the set of overridden cursors returned by \c 4959 * clang_getOverriddenCursors(). 4960 */ 4961 disposeOverriddenCursors :: proc(overridden: ^Cursor) --- 4962 4963 /** 4964 * Retrieve the file that is included by the given inclusion directive 4965 * cursor. 4966 */ 4967 getIncludedFile :: proc(cursor: Cursor) -> File --- 4968 4969 /** 4970 * Map a source location to the cursor that describes the entity at that 4971 * location in the source code. 4972 * 4973 * clang_getCursor() maps an arbitrary source location within a translation 4974 * unit down to the most specific cursor that describes the entity at that 4975 * location. For example, given an expression \c x + y, invoking 4976 * clang_getCursor() with a source location pointing to "x" will return the 4977 * cursor for "x"; similarly for "y". If the cursor points anywhere between 4978 * "x" or "y" (e.g., on the + or the whitespace around it), clang_getCursor() 4979 * will return a cursor referring to the "+" expression. 4980 * 4981 * \returns a cursor representing the entity at the given source location, or 4982 * a NULL cursor if no such entity can be found. 4983 */ 4984 getCursor :: proc(_: Translation_Unit, _: Source_Location) -> Cursor --- 4985 4986 /** 4987 * Retrieve the physical location of the source constructor referenced 4988 * by the given cursor. 4989 * 4990 * The location of a declaration is typically the location of the name of that 4991 * declaration, where the name of that declaration would occur if it is 4992 * unnamed, or some keyword that introduces that particular declaration. 4993 * The location of a reference is where that reference occurs within the 4994 * source code. 4995 */ 4996 getCursorLocation :: proc(_: Cursor) -> Source_Location --- 4997 4998 /** 4999 * Retrieve the physical extent of the source construct referenced by 5000 * the given cursor. 5001 * 5002 * The extent of a cursor starts with the file/line/column pointing at the 5003 * first character within the source construct that the cursor refers to and 5004 * ends with the last character within that source construct. For a 5005 * declaration, the extent covers the declaration itself. For a reference, 5006 * the extent covers the location of the reference (e.g., where the referenced 5007 * entity was actually used). 5008 */ 5009 getCursorExtent :: proc(_: Cursor) -> Source_Range --- 5010 5011 /** 5012 * Retrieve the type of a CXCursor (if any). 5013 */ 5014 getCursorType :: proc(C: Cursor) -> Type --- 5015 5016 /** 5017 * Pretty-print the underlying type using the rules of the 5018 * language of the translation unit from which it came. 5019 * 5020 * If the type is invalid, an empty string is returned. 5021 */ 5022 getTypeSpelling :: proc(CT: Type) -> String --- 5023 5024 /** 5025 * Retrieve the underlying type of a typedef declaration. 5026 * 5027 * If the cursor does not reference a typedef declaration, an invalid type is 5028 * returned. 5029 */ 5030 getTypedefDeclUnderlyingType :: proc(C: Cursor) -> Type --- 5031 5032 /** 5033 * Retrieve the integer type of an enum declaration. 5034 * 5035 * If the cursor does not reference an enum declaration, an invalid type is 5036 * returned. 5037 */ 5038 getEnumDeclIntegerType :: proc(C: Cursor) -> Type --- 5039 5040 /** 5041 * Retrieve the integer value of an enum constant declaration as a signed 5042 * long long. 5043 * 5044 * If the cursor does not reference an enum constant declaration, LLONG_MIN is 5045 * returned. Since this is also potentially a valid constant value, the kind of 5046 * the cursor must be verified before calling this function. 5047 */ 5048 getEnumConstantDeclValue :: proc(C: Cursor) -> c.longlong --- 5049 5050 /** 5051 * Retrieve the integer value of an enum constant declaration as an unsigned 5052 * long long. 5053 * 5054 * If the cursor does not reference an enum constant declaration, ULLONG_MAX is 5055 * returned. Since this is also potentially a valid constant value, the kind of 5056 * the cursor must be verified before calling this function. 5057 */ 5058 getEnumConstantDeclUnsignedValue :: proc(C: Cursor) -> c.ulonglong --- 5059 5060 /** 5061 * Returns non-zero if the cursor specifies a Record member that is a bit-field. 5062 */ 5063 Cursor_isBitField :: proc(C: Cursor) -> c.uint --- 5064 5065 /** 5066 * Retrieve the bit width of a bit-field declaration as an integer. 5067 * 5068 * If the cursor does not reference a bit-field, or if the bit-field's width 5069 * expression cannot be evaluated, -1 is returned. 5070 * 5071 * For example: 5072 * \code 5073 * if (clang_Cursor_isBitField(Cursor)) { 5074 * int Width = clang_getFieldDeclBitWidth(Cursor); 5075 * if (Width != -1) { 5076 * // The bit-field width is not value-dependent. 5077 * } 5078 * } 5079 * \endcode 5080 */ 5081 getFieldDeclBitWidth :: proc(C: Cursor) -> c.int --- 5082 5083 /** 5084 * Retrieve the number of non-variadic arguments associated with a given 5085 * cursor. 5086 * 5087 * The number of arguments can be determined for calls as well as for 5088 * declarations of functions or methods. For other cursors -1 is returned. 5089 */ 5090 Cursor_getNumArguments :: proc(C: Cursor) -> c.int --- 5091 5092 /** 5093 * Retrieve the argument cursor of a function or method. 5094 * 5095 * The argument cursor can be determined for calls as well as for declarations 5096 * of functions or methods. For other cursors and for invalid indices, an 5097 * invalid cursor is returned. 5098 */ 5099 Cursor_getArgument :: proc(C: Cursor, i: c.uint) -> Cursor --- 5100 5101 /** 5102 * Returns the number of template args of a function, struct, or class decl 5103 * representing a template specialization. 5104 * 5105 * If the argument cursor cannot be converted into a template function 5106 * declaration, -1 is returned. 5107 * 5108 * For example, for the following declaration and specialization: 5109 * template <typename T, int kInt, bool kBool> 5110 * void foo() { ... } 5111 * 5112 * template <> 5113 * void foo<float, -7, true>(); 5114 * 5115 * The value 3 would be returned from this call. 5116 */ 5117 Cursor_getNumTemplateArguments :: proc(C: Cursor) -> c.int --- 5118 5119 /** 5120 * Retrieve the kind of the I'th template argument of the CXCursor C. 5121 * 5122 * If the argument CXCursor does not represent a FunctionDecl, StructDecl, or 5123 * ClassTemplatePartialSpecialization, an invalid template argument kind is 5124 * returned. 5125 * 5126 * For example, for the following declaration and specialization: 5127 * template <typename T, int kInt, bool kBool> 5128 * void foo() { ... } 5129 * 5130 * template <> 5131 * void foo<float, -7, true>(); 5132 * 5133 * For I = 0, 1, and 2, Type, Integral, and Integral will be returned, 5134 * respectively. 5135 */ 5136 Cursor_getTemplateArgumentKind :: proc(C: Cursor, I: c.uint) -> Template_Argument_Kind --- 5137 5138 /** 5139 * Retrieve a CXType representing the type of a TemplateArgument of a 5140 * function decl representing a template specialization. 5141 * 5142 * If the argument CXCursor does not represent a FunctionDecl, StructDecl, 5143 * ClassDecl or ClassTemplatePartialSpecialization whose I'th template argument 5144 * has a kind of CXTemplateArgKind_Integral, an invalid type is returned. 5145 * 5146 * For example, for the following declaration and specialization: 5147 * template <typename T, int kInt, bool kBool> 5148 * void foo() { ... } 5149 * 5150 * template <> 5151 * void foo<float, -7, true>(); 5152 * 5153 * If called with I = 0, "float", will be returned. 5154 * Invalid types will be returned for I == 1 or 2. 5155 */ 5156 Cursor_getTemplateArgumentType :: proc(C: Cursor, I: c.uint) -> Type --- 5157 5158 /** 5159 * Retrieve the value of an Integral TemplateArgument (of a function 5160 * decl representing a template specialization) as a signed long long. 5161 * 5162 * It is undefined to call this function on a CXCursor that does not represent a 5163 * FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization 5164 * whose I'th template argument is not an integral value. 5165 * 5166 * For example, for the following declaration and specialization: 5167 * template <typename T, int kInt, bool kBool> 5168 * void foo() { ... } 5169 * 5170 * template <> 5171 * void foo<float, -7, true>(); 5172 * 5173 * If called with I = 1 or 2, -7 or true will be returned, respectively. 5174 * For I == 0, this function's behavior is undefined. 5175 */ 5176 Cursor_getTemplateArgumentValue :: proc(C: Cursor, I: c.uint) -> c.longlong --- 5177 5178 /** 5179 * Retrieve the value of an Integral TemplateArgument (of a function 5180 * decl representing a template specialization) as an unsigned long long. 5181 * 5182 * It is undefined to call this function on a CXCursor that does not represent a 5183 * FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization or 5184 * whose I'th template argument is not an integral value. 5185 * 5186 * For example, for the following declaration and specialization: 5187 * template <typename T, int kInt, bool kBool> 5188 * void foo() { ... } 5189 * 5190 * template <> 5191 * void foo<float, 2147483649, true>(); 5192 * 5193 * If called with I = 1 or 2, 2147483649 or true will be returned, respectively. 5194 * For I == 0, this function's behavior is undefined. 5195 */ 5196 Cursor_getTemplateArgumentUnsignedValue :: proc(C: Cursor, I: c.uint) -> c.ulonglong --- 5197 5198 /** 5199 * Determine whether two CXTypes represent the same type. 5200 * 5201 * \returns non-zero if the CXTypes represent the same type and 5202 * zero otherwise. 5203 */ 5204 equalTypes :: proc(A: Type, B: Type) -> c.uint --- 5205 5206 /** 5207 * Return the canonical type for a CXType. 5208 * 5209 * Clang's type system explicitly models typedefs and all the ways 5210 * a specific type can be represented. The canonical type is the underlying 5211 * type with all the "sugar" removed. For example, if 'T' is a typedef 5212 * for 'int', the canonical type for 'T' would be 'int'. 5213 */ 5214 getCanonicalType :: proc(T: Type) -> Type --- 5215 5216 /** 5217 * Determine whether a CXType has the "const" qualifier set, 5218 * without looking through typedefs that may have added "const" at a 5219 * different level. 5220 */ 5221 isConstQualifiedType :: proc(T: Type) -> c.uint --- 5222 5223 /** 5224 * Determine whether a CXCursor that is a macro, is 5225 * function like. 5226 */ 5227 Cursor_isMacroFunctionLike :: proc(C: Cursor) -> c.uint --- 5228 5229 /** 5230 * Determine whether a CXCursor that is a macro, is a 5231 * builtin one. 5232 */ 5233 Cursor_isMacroBuiltin :: proc(C: Cursor) -> c.uint --- 5234 5235 /** 5236 * Determine whether a CXCursor that is a function declaration, is an 5237 * inline declaration. 5238 */ 5239 Cursor_isFunctionInlined :: proc(C: Cursor) -> c.uint --- 5240 5241 /** 5242 * Determine whether a CXType has the "volatile" qualifier set, 5243 * without looking through typedefs that may have added "volatile" at 5244 * a different level. 5245 */ 5246 isVolatileQualifiedType :: proc(T: Type) -> c.uint --- 5247 5248 /** 5249 * Determine whether a CXType has the "restrict" qualifier set, 5250 * without looking through typedefs that may have added "restrict" at a 5251 * different level. 5252 */ 5253 isRestrictQualifiedType :: proc(T: Type) -> c.uint --- 5254 5255 /** 5256 * Returns the address space of the given type. 5257 */ 5258 getAddressSpace :: proc(T: Type) -> c.uint --- 5259 5260 /** 5261 * Returns the typedef name of the given type. 5262 */ 5263 getTypedefName :: proc(CT: Type) -> String --- 5264 5265 /** 5266 * For pointer types, returns the type of the pointee. 5267 */ 5268 getPointeeType :: proc(T: Type) -> Type --- 5269 5270 /** 5271 * Retrieve the unqualified variant of the given type, removing as 5272 * little sugar as possible. 5273 * 5274 * For example, given the following series of typedefs: 5275 * 5276 * \code 5277 * typedef int Integer; 5278 * typedef const Integer CInteger; 5279 * typedef CInteger DifferenceType; 5280 * \endcode 5281 * 5282 * Executing \c clang_getUnqualifiedType() on a \c CXType that 5283 * represents \c DifferenceType, will desugar to a type representing 5284 * \c Integer, that has no qualifiers. 5285 * 5286 * And, executing \c clang_getUnqualifiedType() on the type of the 5287 * first argument of the following function declaration: 5288 * 5289 * \code 5290 * void foo(const int); 5291 * \endcode 5292 * 5293 * Will return a type representing \c int, removing the \c const 5294 * qualifier. 5295 * 5296 * Sugar over array types is not desugared. 5297 * 5298 * A type can be checked for qualifiers with \c 5299 * clang_isConstQualifiedType(), \c clang_isVolatileQualifiedType() 5300 * and \c clang_isRestrictQualifiedType(). 5301 * 5302 * A type that resulted from a call to \c clang_getUnqualifiedType 5303 * will return \c false for all of the above calls. 5304 */ 5305 getUnqualifiedType :: proc(CT: Type) -> Type --- 5306 5307 /** 5308 * For reference types (e.g., "const int&"), returns the type that the 5309 * reference refers to (e.g "const int"). 5310 * 5311 * Otherwise, returns the type itself. 5312 * 5313 * A type that has kind \c CXType_LValueReference or 5314 * \c CXType_RValueReference is a reference type. 5315 */ 5316 getNonReferenceType :: proc(CT: Type) -> Type --- 5317 5318 /** 5319 * Return the cursor for the declaration of the given type. 5320 */ 5321 getTypeDeclaration :: proc(T: Type) -> Cursor --- 5322 5323 /** 5324 * Returns the Objective-C type encoding for the specified declaration. 5325 */ 5326 getDeclObjCTypeEncoding :: proc(C: Cursor) -> String --- 5327 5328 /** 5329 * Returns the Objective-C type encoding for the specified CXType. 5330 */ 5331 Type_getObjCEncoding :: proc(type: Type) -> String --- 5332 5333 /** 5334 * Retrieve the spelling of a given CXTypeKind. 5335 */ 5336 getTypeKindSpelling :: proc(K: Type_Kind) -> String --- 5337 5338 /** 5339 * Retrieve the calling convention associated with a function type. 5340 * 5341 * If a non-function type is passed in, CXCallingConv_Invalid is returned. 5342 */ 5343 getFunctionTypeCallingConv :: proc(T: Type) -> Calling_Conv --- 5344 5345 /** 5346 * Retrieve the return type associated with a function type. 5347 * 5348 * If a non-function type is passed in, an invalid type is returned. 5349 */ 5350 getResultType :: proc(T: Type) -> Type --- 5351 5352 /** 5353 * Retrieve the exception specification type associated with a function type. 5354 * This is a value of type CXCursor_ExceptionSpecificationKind. 5355 * 5356 * If a non-function type is passed in, an error code of -1 is returned. 5357 */ 5358 getExceptionSpecificationType :: proc(T: Type) -> c.int --- 5359 5360 /** 5361 * Retrieve the number of non-variadic parameters associated with a 5362 * function type. 5363 * 5364 * If a non-function type is passed in, -1 is returned. 5365 */ 5366 getNumArgTypes :: proc(T: Type) -> c.int --- 5367 5368 /** 5369 * Retrieve the type of a parameter of a function type. 5370 * 5371 * If a non-function type is passed in or the function does not have enough 5372 * parameters, an invalid type is returned. 5373 */ 5374 getArgType :: proc(T: Type, i: c.uint) -> Type --- 5375 5376 /** 5377 * Retrieves the base type of the ObjCObjectType. 5378 * 5379 * If the type is not an ObjC object, an invalid type is returned. 5380 */ 5381 Type_getObjCObjectBaseType :: proc(T: Type) -> Type --- 5382 5383 /** 5384 * Retrieve the number of protocol references associated with an ObjC object/id. 5385 * 5386 * If the type is not an ObjC object, 0 is returned. 5387 */ 5388 Type_getNumObjCProtocolRefs :: proc(T: Type) -> c.uint --- 5389 5390 /** 5391 * Retrieve the decl for a protocol reference for an ObjC object/id. 5392 * 5393 * If the type is not an ObjC object or there are not enough protocol 5394 * references, an invalid cursor is returned. 5395 */ 5396 Type_getObjCProtocolDecl :: proc(T: Type, i: c.uint) -> Cursor --- 5397 5398 /** 5399 * Retrieve the number of type arguments associated with an ObjC object. 5400 * 5401 * If the type is not an ObjC object, 0 is returned. 5402 */ 5403 Type_getNumObjCTypeArgs :: proc(T: Type) -> c.uint --- 5404 5405 /** 5406 * Retrieve a type argument associated with an ObjC object. 5407 * 5408 * If the type is not an ObjC or the index is not valid, 5409 * an invalid type is returned. 5410 */ 5411 Type_getObjCTypeArg :: proc(T: Type, i: c.uint) -> Type --- 5412 5413 /** 5414 * Return 1 if the CXType is a variadic function type, and 0 otherwise. 5415 */ 5416 isFunctionTypeVariadic :: proc(T: Type) -> c.uint --- 5417 5418 /** 5419 * Retrieve the return type associated with a given cursor. 5420 * 5421 * This only returns a valid type if the cursor refers to a function or method. 5422 */ 5423 getCursorResultType :: proc(C: Cursor) -> Type --- 5424 5425 /** 5426 * Retrieve the exception specification type associated with a given cursor. 5427 * This is a value of type CXCursor_ExceptionSpecificationKind. 5428 * 5429 * This only returns a valid result if the cursor refers to a function or 5430 * method. 5431 */ 5432 getCursorExceptionSpecificationType :: proc(C: Cursor) -> c.int --- 5433 5434 /** 5435 * Return 1 if the CXType is a POD (plain old data) type, and 0 5436 * otherwise. 5437 */ 5438 isPODType :: proc(T: Type) -> c.uint --- 5439 5440 /** 5441 * Return the element type of an array, complex, or vector type. 5442 * 5443 * If a type is passed in that is not an array, complex, or vector type, 5444 * an invalid type is returned. 5445 */ 5446 getElementType :: proc(T: Type) -> Type --- 5447 5448 /** 5449 * Return the number of elements of an array or vector type. 5450 * 5451 * If a type is passed in that is not an array or vector type, 5452 * -1 is returned. 5453 */ 5454 getNumElements :: proc(T: Type) -> c.longlong --- 5455 5456 /** 5457 * Return the element type of an array type. 5458 * 5459 * If a non-array type is passed in, an invalid type is returned. 5460 */ 5461 getArrayElementType :: proc(T: Type) -> Type --- 5462 5463 /** 5464 * Return the array size of a constant array. 5465 * 5466 * If a non-array type is passed in, -1 is returned. 5467 */ 5468 getArraySize :: proc(T: Type) -> c.longlong --- 5469 5470 /** 5471 * Retrieve the type named by the qualified-id. 5472 * 5473 * If a non-elaborated type is passed in, an invalid type is returned. 5474 */ 5475 Type_getNamedType :: proc(T: Type) -> Type --- 5476 5477 /** 5478 * Determine if a typedef is 'transparent' tag. 5479 * 5480 * A typedef is considered 'transparent' if it shares a name and spelling 5481 * location with its underlying tag type, as is the case with the NS_ENUM macro. 5482 * 5483 * \returns non-zero if transparent and zero otherwise. 5484 */ 5485 Type_isTransparentTagTypedef :: proc(T: Type) -> c.uint --- 5486 5487 /** 5488 * Retrieve the nullability kind of a pointer type. 5489 */ 5490 Type_getNullability :: proc(T: Type) -> Type_Nullability_Kind --- 5491 5492 /** 5493 * Return the alignment of a type in bytes as per C++[expr.alignof] 5494 * standard. 5495 * 5496 * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. 5497 * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete 5498 * is returned. 5499 * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is 5500 * returned. 5501 * If the type declaration is not a constant size type, 5502 * CXTypeLayoutError_NotConstantSize is returned. 5503 */ 5504 Type_getAlignOf :: proc(T: Type) -> c.longlong --- 5505 5506 /** 5507 * Return the class type of an member pointer type. 5508 * 5509 * If a non-member-pointer type is passed in, an invalid type is returned. 5510 */ 5511 Type_getClassType :: proc(T: Type) -> Type --- 5512 5513 /** 5514 * Return the size of a type in bytes as per C++[expr.sizeof] standard. 5515 * 5516 * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. 5517 * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete 5518 * is returned. 5519 * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is 5520 * returned. 5521 */ 5522 Type_getSizeOf :: proc(T: Type) -> c.longlong --- 5523 5524 /** 5525 * Return the offset of a field named S in a record of type T in bits 5526 * as it would be returned by __offsetof__ as per C++11[18.2p4] 5527 * 5528 * If the cursor is not a record field declaration, CXTypeLayoutError_Invalid 5529 * is returned. 5530 * If the field's type declaration is an incomplete type, 5531 * CXTypeLayoutError_Incomplete is returned. 5532 * If the field's type declaration is a dependent type, 5533 * CXTypeLayoutError_Dependent is returned. 5534 * If the field's name S is not found, 5535 * CXTypeLayoutError_InvalidFieldName is returned. 5536 */ 5537 Type_getOffsetOf :: proc(T: Type, S: cstring) -> c.longlong --- 5538 5539 /** 5540 * Return the type that was modified by this attributed type. 5541 * 5542 * If the type is not an attributed type, an invalid type is returned. 5543 */ 5544 Type_getModifiedType :: proc(T: Type) -> Type --- 5545 5546 /** 5547 * Gets the type contained by this atomic type. 5548 * 5549 * If a non-atomic type is passed in, an invalid type is returned. 5550 */ 5551 Type_getValueType :: proc(CT: Type) -> Type --- 5552 5553 /** 5554 * Return the offset of the field represented by the Cursor. 5555 * 5556 * If the cursor is not a field declaration, -1 is returned. 5557 * If the cursor semantic parent is not a record field declaration, 5558 * CXTypeLayoutError_Invalid is returned. 5559 * If the field's type declaration is an incomplete type, 5560 * CXTypeLayoutError_Incomplete is returned. 5561 * If the field's type declaration is a dependent type, 5562 * CXTypeLayoutError_Dependent is returned. 5563 * If the field's name S is not found, 5564 * CXTypeLayoutError_InvalidFieldName is returned. 5565 */ 5566 Cursor_getOffsetOfField :: proc(C: Cursor) -> c.longlong --- 5567 5568 /** 5569 * Determine whether the given cursor represents an anonymous 5570 * tag or namespace 5571 */ 5572 Cursor_isAnonymous :: proc(C: Cursor) -> c.uint --- 5573 5574 /** 5575 * Determine whether the given cursor represents an anonymous record 5576 * declaration. 5577 */ 5578 Cursor_isAnonymousRecordDecl :: proc(C: Cursor) -> c.uint --- 5579 5580 /** 5581 * Determine whether the given cursor represents an inline namespace 5582 * declaration. 5583 */ 5584 Cursor_isInlineNamespace :: proc(C: Cursor) -> c.uint --- 5585 5586 /** 5587 * Returns the number of template arguments for given template 5588 * specialization, or -1 if type \c T is not a template specialization. 5589 */ 5590 Type_getNumTemplateArguments :: proc(T: Type) -> c.int --- 5591 5592 /** 5593 * Returns the type template argument of a template class specialization 5594 * at given index. 5595 * 5596 * This function only returns template type arguments and does not handle 5597 * template template arguments or variadic packs. 5598 */ 5599 Type_getTemplateArgumentAsType :: proc(T: Type, i: c.uint) -> Type --- 5600 5601 /** 5602 * Retrieve the ref-qualifier kind of a function or method. 5603 * 5604 * The ref-qualifier is returned for C++ functions or methods. For other types 5605 * or non-C++ declarations, CXRefQualifier_None is returned. 5606 */ 5607 Type_getCXXRefQualifier :: proc(T: Type) -> Ref_Qualifier_Kind --- 5608 5609 /** 5610 * Returns 1 if the base class specified by the cursor with kind 5611 * CX_CXXBaseSpecifier is virtual. 5612 */ 5613 isVirtualBase :: proc(_: Cursor) -> c.uint --- 5614 5615 /** 5616 * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent 5617 * class. 5618 * 5619 * Returns a small negative number if the offset cannot be computed. See 5620 * CXTypeLayoutError for error codes. 5621 */ 5622 getOffsetOfBase :: proc(Parent: Cursor, Base: Cursor) -> c.longlong --- 5623 5624 /** 5625 * Returns the access control level for the referenced object. 5626 * 5627 * If the cursor refers to a C++ declaration, its access control level within 5628 * its parent scope is returned. Otherwise, if the cursor refers to a base 5629 * specifier or access specifier, the specifier itself is returned. 5630 */ 5631 getCXXAccessSpecifier :: proc(_: Cursor) -> Cxxaccess_Specifier --- 5632 5633 /** 5634 * \brief Returns the operator code for the binary operator. 5635 */ 5636 Cursor_getBinaryOpcode :: proc(C: Cursor) -> CX_Binary_Operator_Kind --- 5637 5638 /** 5639 * \brief Returns a string containing the spelling of the binary operator. 5640 */ 5641 Cursor_getBinaryOpcodeStr :: proc(Op: CX_Binary_Operator_Kind) -> String --- 5642 5643 /** 5644 * Returns the storage class for a function or variable declaration. 5645 * 5646 * If the passed in Cursor is not a function or variable declaration, 5647 * CX_SC_Invalid is returned else the storage class. 5648 */ 5649 Cursor_getStorageClass :: proc(_: Cursor) -> Storage_Class --- 5650 5651 /** 5652 * Determine the number of overloaded declarations referenced by a 5653 * \c CXCursor_OverloadedDeclRef cursor. 5654 * 5655 * \param cursor The cursor whose overloaded declarations are being queried. 5656 * 5657 * \returns The number of overloaded declarations referenced by \c cursor. If it 5658 * is not a \c CXCursor_OverloadedDeclRef cursor, returns 0. 5659 */ 5660 getNumOverloadedDecls :: proc(cursor: Cursor) -> c.uint --- 5661 5662 /** 5663 * Retrieve a cursor for one of the overloaded declarations referenced 5664 * by a \c CXCursor_OverloadedDeclRef cursor. 5665 * 5666 * \param cursor The cursor whose overloaded declarations are being queried. 5667 * 5668 * \param index The zero-based index into the set of overloaded declarations in 5669 * the cursor. 5670 * 5671 * \returns A cursor representing the declaration referenced by the given 5672 * \c cursor at the specified \c index. If the cursor does not have an 5673 * associated set of overloaded declarations, or if the index is out of bounds, 5674 * returns \c clang_getNullCursor(); 5675 */ 5676 getOverloadedDecl :: proc(cursor: Cursor, index: c.uint) -> Cursor --- 5677 5678 /** 5679 * For cursors representing an iboutletcollection attribute, 5680 * this function returns the collection element type. 5681 * 5682 */ 5683 getIBOutletCollectionType :: proc(_: Cursor) -> Type --- 5684 5685 /** 5686 * Visit the children of a particular cursor. 5687 * 5688 * This function visits all the direct children of the given cursor, 5689 * invoking the given \p visitor function with the cursors of each 5690 * visited child. The traversal may be recursive, if the visitor returns 5691 * \c CXChildVisit_Recurse. The traversal may also be ended prematurely, if 5692 * the visitor returns \c CXChildVisit_Break. 5693 * 5694 * \param parent the cursor whose child may be visited. All kinds of 5695 * cursors can be visited, including invalid cursors (which, by 5696 * definition, have no children). 5697 * 5698 * \param visitor the visitor function that will be invoked for each 5699 * child of \p parent. 5700 * 5701 * \param client_data pointer data supplied by the client, which will 5702 * be passed to the visitor each time it is invoked. 5703 * 5704 * \returns a non-zero value if the traversal was terminated 5705 * prematurely by the visitor returning \c CXChildVisit_Break. 5706 */ 5707 visitChildren :: proc(parent: Cursor, visitor: Cursor_Visitor, client_data: Client_Data) -> c.uint --- 5708 5709 /** 5710 * Visits the children of a cursor using the specified block. Behaves 5711 * identically to clang_visitChildren() in all other respects. 5712 */ 5713 visitChildrenWithBlock :: proc(parent: Cursor, block: Cursor_Visitor_Block) -> c.uint --- 5714 5715 /** 5716 * Retrieve a Unified Symbol Resolution (USR) for the entity referenced 5717 * by the given cursor. 5718 * 5719 * A Unified Symbol Resolution (USR) is a string that identifies a particular 5720 * entity (function, class, variable, etc.) within a program. USRs can be 5721 * compared across translation units to determine, e.g., when references in 5722 * one translation refer to an entity defined in another translation unit. 5723 */ 5724 getCursorUSR :: proc(_: Cursor) -> String --- 5725 5726 /** 5727 * Construct a USR for a specified Objective-C class. 5728 */ 5729 constructUSR_ObjCClass :: proc(class_name: cstring) -> String --- 5730 5731 /** 5732 * Construct a USR for a specified Objective-C category. 5733 */ 5734 constructUSR_ObjCCategory :: proc(class_name: cstring, category_name: cstring) -> String --- 5735 5736 /** 5737 * Construct a USR for a specified Objective-C protocol. 5738 */ 5739 constructUSR_ObjCProtocol :: proc(protocol_name: cstring) -> String --- 5740 5741 /** 5742 * Construct a USR for a specified Objective-C instance variable and 5743 * the USR for its containing class. 5744 */ 5745 constructUSR_ObjCIvar :: proc(name: cstring, classUSR: String) -> String --- 5746 5747 /** 5748 * Construct a USR for a specified Objective-C method and 5749 * the USR for its containing class. 5750 */ 5751 constructUSR_ObjCMethod :: proc(name: cstring, isInstanceMethod: c.uint, classUSR: String) -> String --- 5752 5753 /** 5754 * Construct a USR for a specified Objective-C property and the USR 5755 * for its containing class. 5756 */ 5757 constructUSR_ObjCProperty :: proc(property: cstring, classUSR: String) -> String --- 5758 5759 /** 5760 * Retrieve a name for the entity referenced by this cursor. 5761 */ 5762 getCursorSpelling :: proc(_: Cursor) -> String --- 5763 5764 /** 5765 * Retrieve a range for a piece that forms the cursors spelling name. 5766 * Most of the times there is only one range for the complete spelling but for 5767 * Objective-C methods and Objective-C message expressions, there are multiple 5768 * pieces for each selector identifier. 5769 * 5770 * \param pieceIndex the index of the spelling name piece. If this is greater 5771 * than the actual number of pieces, it will return a NULL (invalid) range. 5772 * 5773 * \param options Reserved. 5774 */ 5775 Cursor_getSpellingNameRange :: proc(_: Cursor, pieceIndex: c.uint, options: c.uint) -> Source_Range --- 5776 5777 /** 5778 * Get a property value for the given printing policy. 5779 */ 5780 PrintingPolicy_getProperty :: proc(Policy: Printing_Policy, Property: Printing_Policy_Property) -> c.uint --- 5781 5782 /** 5783 * Set a property value for the given printing policy. 5784 */ 5785 PrintingPolicy_setProperty :: proc(Policy: Printing_Policy, Property: Printing_Policy_Property, Value: c.uint) --- 5786 5787 /** 5788 * Retrieve the default policy for the cursor. 5789 * 5790 * The policy should be released after use with \c 5791 * clang_PrintingPolicy_dispose. 5792 */ 5793 getCursorPrintingPolicy :: proc(_: Cursor) -> Printing_Policy --- 5794 5795 /** 5796 * Release a printing policy. 5797 */ 5798 PrintingPolicy_dispose :: proc(Policy: Printing_Policy) --- 5799 5800 /** 5801 * Pretty print declarations. 5802 * 5803 * \param Cursor The cursor representing a declaration. 5804 * 5805 * \param Policy The policy to control the entities being printed. If 5806 * NULL, a default policy is used. 5807 * 5808 * \returns The pretty printed declaration or the empty string for 5809 * other cursors. 5810 */ 5811 getCursorPrettyPrinted :: proc(Cursor: Cursor, Policy: Printing_Policy) -> String --- 5812 5813 /** 5814 * Pretty-print the underlying type using a custom printing policy. 5815 * 5816 * If the type is invalid, an empty string is returned. 5817 */ 5818 getTypePrettyPrinted :: proc(CT: Type, cxPolicy: Printing_Policy) -> String --- 5819 5820 /** 5821 * Retrieve the display name for the entity referenced by this cursor. 5822 * 5823 * The display name contains extra information that helps identify the cursor, 5824 * such as the parameters of a function or template or the arguments of a 5825 * class template specialization. 5826 */ 5827 getCursorDisplayName :: proc(_: Cursor) -> String --- 5828 5829 /** For a cursor that is a reference, retrieve a cursor representing the 5830 * entity that it references. 5831 * 5832 * Reference cursors refer to other entities in the AST. For example, an 5833 * Objective-C superclass reference cursor refers to an Objective-C class. 5834 * This function produces the cursor for the Objective-C class from the 5835 * cursor for the superclass reference. If the input cursor is a declaration or 5836 * definition, it returns that declaration or definition unchanged. 5837 * Otherwise, returns the NULL cursor. 5838 */ 5839 getCursorReferenced :: proc(_: Cursor) -> Cursor --- 5840 5841 /** 5842 * For a cursor that is either a reference to or a declaration 5843 * of some entity, retrieve a cursor that describes the definition of 5844 * that entity. 5845 * 5846 * Some entities can be declared multiple times within a translation 5847 * unit, but only one of those declarations can also be a 5848 * definition. For example, given: 5849 * 5850 * \code 5851 * int f(int, int); 5852 * int g(int x, int y) { return f(x, y); } 5853 * int f(int a, int b) { return a + b; } 5854 * int f(int, int); 5855 * \endcode 5856 * 5857 * there are three declarations of the function "f", but only the 5858 * second one is a definition. The clang_getCursorDefinition() 5859 * function will take any cursor pointing to a declaration of "f" 5860 * (the first or fourth lines of the example) or a cursor referenced 5861 * that uses "f" (the call to "f' inside "g") and will return a 5862 * declaration cursor pointing to the definition (the second "f" 5863 * declaration). 5864 * 5865 * If given a cursor for which there is no corresponding definition, 5866 * e.g., because there is no definition of that entity within this 5867 * translation unit, returns a NULL cursor. 5868 */ 5869 getCursorDefinition :: proc(_: Cursor) -> Cursor --- 5870 5871 /** 5872 * Determine whether the declaration pointed to by this cursor 5873 * is also a definition of that entity. 5874 */ 5875 isCursorDefinition :: proc(_: Cursor) -> c.uint --- 5876 5877 /** 5878 * Retrieve the canonical cursor corresponding to the given cursor. 5879 * 5880 * In the C family of languages, many kinds of entities can be declared several 5881 * times within a single translation unit. For example, a structure type can 5882 * be forward-declared (possibly multiple times) and later defined: 5883 * 5884 * \code 5885 * struct X; 5886 * struct X; 5887 * struct X { 5888 * int member; 5889 * }; 5890 * \endcode 5891 * 5892 * The declarations and the definition of \c X are represented by three 5893 * different cursors, all of which are declarations of the same underlying 5894 * entity. One of these cursor is considered the "canonical" cursor, which 5895 * is effectively the representative for the underlying entity. One can 5896 * determine if two cursors are declarations of the same underlying entity by 5897 * comparing their canonical cursors. 5898 * 5899 * \returns The canonical cursor for the entity referred to by the given cursor. 5900 */ 5901 getCanonicalCursor :: proc(_: Cursor) -> Cursor --- 5902 5903 /** 5904 * If the cursor points to a selector identifier in an Objective-C 5905 * method or message expression, this returns the selector index. 5906 * 5907 * After getting a cursor with #clang_getCursor, this can be called to 5908 * determine if the location points to a selector identifier. 5909 * 5910 * \returns The selector index if the cursor is an Objective-C method or message 5911 * expression and the cursor is pointing to a selector identifier, or -1 5912 * otherwise. 5913 */ 5914 Cursor_getObjCSelectorIndex :: proc(_: Cursor) -> c.int --- 5915 5916 /** 5917 * Given a cursor pointing to a C++ method call or an Objective-C 5918 * message, returns non-zero if the method/message is "dynamic", meaning: 5919 * 5920 * For a C++ method: the call is virtual. 5921 * For an Objective-C message: the receiver is an object instance, not 'super' 5922 * or a specific class. 5923 * 5924 * If the method/message is "static" or the cursor does not point to a 5925 * method/message, it will return zero. 5926 */ 5927 Cursor_isDynamicCall :: proc(C: Cursor) -> c.int --- 5928 5929 /** 5930 * Given a cursor pointing to an Objective-C message or property 5931 * reference, or C++ method call, returns the CXType of the receiver. 5932 */ 5933 Cursor_getReceiverType :: proc(C: Cursor) -> Type --- 5934 5935 /** 5936 * Given a cursor that represents a property declaration, return the 5937 * associated property attributes. The bits are formed from 5938 * \c CXObjCPropertyAttrKind. 5939 * 5940 * \param reserved Reserved for future use, pass 0. 5941 */ 5942 Cursor_getObjCPropertyAttributes :: proc(C: Cursor, reserved: c.uint) -> c.uint --- 5943 5944 /** 5945 * Given a cursor that represents a property declaration, return the 5946 * name of the method that implements the getter. 5947 */ 5948 Cursor_getObjCPropertyGetterName :: proc(C: Cursor) -> String --- 5949 5950 /** 5951 * Given a cursor that represents a property declaration, return the 5952 * name of the method that implements the setter, if any. 5953 */ 5954 Cursor_getObjCPropertySetterName :: proc(C: Cursor) -> String --- 5955 5956 /** 5957 * Given a cursor that represents an Objective-C method or parameter 5958 * declaration, return the associated Objective-C qualifiers for the return 5959 * type or the parameter respectively. The bits are formed from 5960 * CXObjCDeclQualifierKind. 5961 */ 5962 Cursor_getObjCDeclQualifiers :: proc(C: Cursor) -> c.uint --- 5963 5964 /** 5965 * Given a cursor that represents an Objective-C method or property 5966 * declaration, return non-zero if the declaration was affected by "\@optional". 5967 * Returns zero if the cursor is not such a declaration or it is "\@required". 5968 */ 5969 Cursor_isObjCOptional :: proc(C: Cursor) -> c.uint --- 5970 5971 /** 5972 * Returns non-zero if the given cursor is a variadic function or method. 5973 */ 5974 Cursor_isVariadic :: proc(C: Cursor) -> c.uint --- 5975 5976 /** 5977 * Returns non-zero if the given cursor points to a symbol marked with 5978 * external_source_symbol attribute. 5979 * 5980 * \param language If non-NULL, and the attribute is present, will be set to 5981 * the 'language' string from the attribute. 5982 * 5983 * \param definedIn If non-NULL, and the attribute is present, will be set to 5984 * the 'definedIn' string from the attribute. 5985 * 5986 * \param isGenerated If non-NULL, and the attribute is present, will be set to 5987 * non-zero if the 'generated_declaration' is set in the attribute. 5988 */ 5989 Cursor_isExternalSymbol :: proc(C: Cursor, language: ^String, definedIn: ^String, isGenerated: ^c.uint) -> c.uint --- 5990 5991 /** 5992 * Given a cursor that represents a declaration, return the associated 5993 * comment's source range. The range may include multiple consecutive comments 5994 * with whitespace in between. 5995 */ 5996 Cursor_getCommentRange :: proc(C: Cursor) -> Source_Range --- 5997 5998 /** 5999 * Given a cursor that represents a declaration, return the associated 6000 * comment text, including comment markers. 6001 */ 6002 Cursor_getRawCommentText :: proc(C: Cursor) -> String --- 6003 6004 /** 6005 * Given a cursor that represents a documentable entity (e.g., 6006 * declaration), return the associated \paragraph; otherwise return the 6007 * first paragraph. 6008 */ 6009 Cursor_getBriefCommentText :: proc(C: Cursor) -> String --- 6010 6011 /** 6012 * Retrieve the CXString representing the mangled name of the cursor. 6013 */ 6014 Cursor_getMangling :: proc(_: Cursor) -> String --- 6015 6016 /** 6017 * Retrieve the CXStrings representing the mangled symbols of the C++ 6018 * constructor or destructor at the cursor. 6019 */ 6020 Cursor_getCXXManglings :: proc(_: Cursor) -> ^String_Set --- 6021 6022 /** 6023 * Retrieve the CXStrings representing the mangled symbols of the ObjC 6024 * class interface or implementation at the cursor. 6025 */ 6026 Cursor_getObjCManglings :: proc(_: Cursor) -> ^String_Set --- 6027 6028 /** 6029 * Given a CXCursor_ModuleImportDecl cursor, return the associated module. 6030 */ 6031 Cursor_getModule :: proc(C: Cursor) -> CXModule --- 6032 6033 /** 6034 * Given a CXFile header file, return the module that contains it, if one 6035 * exists. 6036 */ 6037 getModuleForFile :: proc(_: Translation_Unit, _: File) -> CXModule --- 6038 6039 /** 6040 * \param Module a module object. 6041 * 6042 * \returns the module file where the provided module object came from. 6043 */ 6044 Module_getASTFile :: proc(Module: CXModule) -> File --- 6045 6046 /** 6047 * \param Module a module object. 6048 * 6049 * \returns the parent of a sub-module or NULL if the given module is top-level, 6050 * e.g. for 'std.vector' it will return the 'std' module. 6051 */ 6052 Module_getParent :: proc(Module: CXModule) -> CXModule --- 6053 6054 /** 6055 * \param Module a module object. 6056 * 6057 * \returns the name of the module, e.g. for the 'std.vector' sub-module it 6058 * will return "vector". 6059 */ 6060 Module_getName :: proc(Module: CXModule) -> String --- 6061 6062 /** 6063 * \param Module a module object. 6064 * 6065 * \returns the full name of the module, e.g. "std.vector". 6066 */ 6067 Module_getFullName :: proc(Module: CXModule) -> String --- 6068 6069 /** 6070 * \param Module a module object. 6071 * 6072 * \returns non-zero if the module is a system one. 6073 */ 6074 Module_isSystem :: proc(Module: CXModule) -> c.int --- 6075 6076 /** 6077 * \param Module a module object. 6078 * 6079 * \returns the number of top level headers associated with this module. 6080 */ 6081 Module_getNumTopLevelHeaders :: proc(_: Translation_Unit, Module: CXModule) -> c.uint --- 6082 6083 /** 6084 * \param Module a module object. 6085 * 6086 * \param Index top level header index (zero-based). 6087 * 6088 * \returns the specified top level header associated with the module. 6089 */ 6090 Module_getTopLevelHeader :: proc(_: Translation_Unit, Module: CXModule, Index: c.uint) -> File --- 6091 6092 /** 6093 * Determine if a C++ constructor is a converting constructor. 6094 */ 6095 CXXConstructor_isConvertingConstructor :: proc(C: Cursor) -> c.uint --- 6096 6097 /** 6098 * Determine if a C++ constructor is a copy constructor. 6099 */ 6100 CXXConstructor_isCopyConstructor :: proc(C: Cursor) -> c.uint --- 6101 6102 /** 6103 * Determine if a C++ constructor is the default constructor. 6104 */ 6105 CXXConstructor_isDefaultConstructor :: proc(C: Cursor) -> c.uint --- 6106 6107 /** 6108 * Determine if a C++ constructor is a move constructor. 6109 */ 6110 CXXConstructor_isMoveConstructor :: proc(C: Cursor) -> c.uint --- 6111 6112 /** 6113 * Determine if a C++ field is declared 'mutable'. 6114 */ 6115 CXXField_isMutable :: proc(C: Cursor) -> c.uint --- 6116 6117 /** 6118 * Determine if a C++ method is declared '= default'. 6119 */ 6120 CXXMethod_isDefaulted :: proc(C: Cursor) -> c.uint --- 6121 6122 /** 6123 * Determine if a C++ method is declared '= delete'. 6124 */ 6125 CXXMethod_isDeleted :: proc(C: Cursor) -> c.uint --- 6126 6127 /** 6128 * Determine if a C++ member function or member function template is 6129 * pure virtual. 6130 */ 6131 CXXMethod_isPureVirtual :: proc(C: Cursor) -> c.uint --- 6132 6133 /** 6134 * Determine if a C++ member function or member function template is 6135 * declared 'static'. 6136 */ 6137 CXXMethod_isStatic :: proc(C: Cursor) -> c.uint --- 6138 6139 /** 6140 * Determine if a C++ member function or member function template is 6141 * explicitly declared 'virtual' or if it overrides a virtual method from 6142 * one of the base classes. 6143 */ 6144 CXXMethod_isVirtual :: proc(C: Cursor) -> c.uint --- 6145 6146 /** 6147 * Determine if a C++ member function is a copy-assignment operator, 6148 * returning 1 if such is the case and 0 otherwise. 6149 * 6150 * > A copy-assignment operator `X::operator=` is a non-static, 6151 * > non-template member function of _class_ `X` with exactly one 6152 * > parameter of type `X`, `X&`, `const X&`, `volatile X&` or `const 6153 * > volatile X&`. 6154 * 6155 * That is, for example, the `operator=` in: 6156 * 6157 * class Foo { 6158 * bool operator=(const volatile Foo&); 6159 * }; 6160 * 6161 * Is a copy-assignment operator, while the `operator=` in: 6162 * 6163 * class Bar { 6164 * bool operator=(const int&); 6165 * }; 6166 * 6167 * Is not. 6168 */ 6169 CXXMethod_isCopyAssignmentOperator :: proc(C: Cursor) -> c.uint --- 6170 6171 /** 6172 * Determine if a C++ member function is a move-assignment operator, 6173 * returning 1 if such is the case and 0 otherwise. 6174 * 6175 * > A move-assignment operator `X::operator=` is a non-static, 6176 * > non-template member function of _class_ `X` with exactly one 6177 * > parameter of type `X&&`, `const X&&`, `volatile X&&` or `const 6178 * > volatile X&&`. 6179 * 6180 * That is, for example, the `operator=` in: 6181 * 6182 * class Foo { 6183 * bool operator=(const volatile Foo&&); 6184 * }; 6185 * 6186 * Is a move-assignment operator, while the `operator=` in: 6187 * 6188 * class Bar { 6189 * bool operator=(const int&&); 6190 * }; 6191 * 6192 * Is not. 6193 */ 6194 CXXMethod_isMoveAssignmentOperator :: proc(C: Cursor) -> c.uint --- 6195 6196 /** 6197 * Determines if a C++ constructor or conversion function was declared 6198 * explicit, returning 1 if such is the case and 0 otherwise. 6199 * 6200 * Constructors or conversion functions are declared explicit through 6201 * the use of the explicit specifier. 6202 * 6203 * For example, the following constructor and conversion function are 6204 * not explicit as they lack the explicit specifier: 6205 * 6206 * class Foo { 6207 * Foo(); 6208 * operator int(); 6209 * }; 6210 * 6211 * While the following constructor and conversion function are 6212 * explicit as they are declared with the explicit specifier. 6213 * 6214 * class Foo { 6215 * explicit Foo(); 6216 * explicit operator int(); 6217 * }; 6218 * 6219 * This function will return 0 when given a cursor pointing to one of 6220 * the former declarations and it will return 1 for a cursor pointing 6221 * to the latter declarations. 6222 * 6223 * The explicit specifier allows the user to specify a 6224 * conditional compile-time expression whose value decides 6225 * whether the marked element is explicit or not. 6226 * 6227 * For example: 6228 * 6229 * constexpr bool foo(int i) { return i % 2 == 0; } 6230 * 6231 * class Foo { 6232 * explicit(foo(1)) Foo(); 6233 * explicit(foo(2)) operator int(); 6234 * } 6235 * 6236 * This function will return 0 for the constructor and 1 for 6237 * the conversion function. 6238 */ 6239 CXXMethod_isExplicit :: proc(C: Cursor) -> c.uint --- 6240 6241 /** 6242 * Determine if a C++ record is abstract, i.e. whether a class or struct 6243 * has a pure virtual member function. 6244 */ 6245 CXXRecord_isAbstract :: proc(C: Cursor) -> c.uint --- 6246 6247 /** 6248 * Determine if an enum declaration refers to a scoped enum. 6249 */ 6250 EnumDecl_isScoped :: proc(C: Cursor) -> c.uint --- 6251 6252 /** 6253 * Determine if a C++ member function or member function template is 6254 * declared 'const'. 6255 */ 6256 CXXMethod_isConst :: proc(C: Cursor) -> c.uint --- 6257 6258 /** 6259 * Given a cursor that represents a template, determine 6260 * the cursor kind of the specializations would be generated by instantiating 6261 * the template. 6262 * 6263 * This routine can be used to determine what flavor of function template, 6264 * class template, or class template partial specialization is stored in the 6265 * cursor. For example, it can describe whether a class template cursor is 6266 * declared with "struct", "class" or "union". 6267 * 6268 * \param C The cursor to query. This cursor should represent a template 6269 * declaration. 6270 * 6271 * \returns The cursor kind of the specializations that would be generated 6272 * by instantiating the template \p C. If \p C is not a template, returns 6273 * \c CXCursor_NoDeclFound. 6274 */ 6275 getTemplateCursorKind :: proc(C: Cursor) -> Cursor_Kind --- 6276 6277 /** 6278 * Given a cursor that may represent a specialization or instantiation 6279 * of a template, retrieve the cursor that represents the template that it 6280 * specializes or from which it was instantiated. 6281 * 6282 * This routine determines the template involved both for explicit 6283 * specializations of templates and for implicit instantiations of the template, 6284 * both of which are referred to as "specializations". For a class template 6285 * specialization (e.g., \c std::vector<bool>), this routine will return 6286 * either the primary template (\c std::vector) or, if the specialization was 6287 * instantiated from a class template partial specialization, the class template 6288 * partial specialization. For a class template partial specialization and a 6289 * function template specialization (including instantiations), this 6290 * this routine will return the specialized template. 6291 * 6292 * For members of a class template (e.g., member functions, member classes, or 6293 * static data members), returns the specialized or instantiated member. 6294 * Although not strictly "templates" in the C++ language, members of class 6295 * templates have the same notions of specializations and instantiations that 6296 * templates do, so this routine treats them similarly. 6297 * 6298 * \param C A cursor that may be a specialization of a template or a member 6299 * of a template. 6300 * 6301 * \returns If the given cursor is a specialization or instantiation of a 6302 * template or a member thereof, the template or member that it specializes or 6303 * from which it was instantiated. Otherwise, returns a NULL cursor. 6304 */ 6305 getSpecializedCursorTemplate :: proc(C: Cursor) -> Cursor --- 6306 6307 /** 6308 * Given a cursor that references something else, return the source range 6309 * covering that reference. 6310 * 6311 * \param C A cursor pointing to a member reference, a declaration reference, or 6312 * an operator call. 6313 * \param NameFlags A bitset with three independent flags: 6314 * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and 6315 * CXNameRange_WantSinglePiece. 6316 * \param PieceIndex For contiguous names or when passing the flag 6317 * CXNameRange_WantSinglePiece, only one piece with index 0 is 6318 * available. When the CXNameRange_WantSinglePiece flag is not passed for a 6319 * non-contiguous names, this index can be used to retrieve the individual 6320 * pieces of the name. See also CXNameRange_WantSinglePiece. 6321 * 6322 * \returns The piece of the name pointed to by the given cursor. If there is no 6323 * name, or if the PieceIndex is out-of-range, a null-cursor will be returned. 6324 */ 6325 getCursorReferenceNameRange :: proc(C: Cursor, NameFlags: c.uint, PieceIndex: c.uint) -> Source_Range --- 6326 6327 /** 6328 * Get the raw lexical token starting with the given location. 6329 * 6330 * \param TU the translation unit whose text is being tokenized. 6331 * 6332 * \param Location the source location with which the token starts. 6333 * 6334 * \returns The token starting with the given location or NULL if no such token 6335 * exist. The returned pointer must be freed with clang_disposeTokens before the 6336 * translation unit is destroyed. 6337 */ 6338 getToken :: proc(TU: Translation_Unit, Location: Source_Location) -> [^]Token --- 6339 6340 /** 6341 * Determine the kind of the given token. 6342 */ 6343 getTokenKind :: proc(_: Token) -> Token_Kind --- 6344 6345 /** 6346 * Determine the spelling of the given token. 6347 * 6348 * The spelling of a token is the textual representation of that token, e.g., 6349 * the text of an identifier or keyword. 6350 */ 6351 getTokenSpelling :: proc(_: Translation_Unit, _: Token) -> String --- 6352 6353 /** 6354 * Retrieve the source location of the given token. 6355 */ 6356 getTokenLocation :: proc(_: Translation_Unit, _: Token) -> Source_Location --- 6357 6358 /** 6359 * Retrieve a source range that covers the given token. 6360 */ 6361 getTokenExtent :: proc(_: Translation_Unit, _: Token) -> Source_Range --- 6362 6363 /** 6364 * Tokenize the source code described by the given range into raw 6365 * lexical tokens. 6366 * 6367 * \param TU the translation unit whose text is being tokenized. 6368 * 6369 * \param Range the source range in which text should be tokenized. All of the 6370 * tokens produced by tokenization will fall within this source range, 6371 * 6372 * \param Tokens this pointer will be set to point to the array of tokens 6373 * that occur within the given source range. The returned pointer must be 6374 * freed with clang_disposeTokens() before the translation unit is destroyed. 6375 * 6376 * \param NumTokens will be set to the number of tokens in the \c *Tokens 6377 * array. 6378 * 6379 */ 6380 tokenize :: proc(TU: Translation_Unit, Range: Source_Range, Tokens: ^[^]Token, NumTokens: [^]c.uint) --- 6381 6382 /** 6383 * Annotate the given set of tokens by providing cursors for each token 6384 * that can be mapped to a specific entity within the abstract syntax tree. 6385 * 6386 * This token-annotation routine is equivalent to invoking 6387 * clang_getCursor() for the source locations of each of the 6388 * tokens. The cursors provided are filtered, so that only those 6389 * cursors that have a direct correspondence to the token are 6390 * accepted. For example, given a function call \c f(x), 6391 * clang_getCursor() would provide the following cursors: 6392 * 6393 * * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. 6394 * * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. 6395 * * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'. 6396 * 6397 * Only the first and last of these cursors will occur within the 6398 * annotate, since the tokens "f" and "x' directly refer to a function 6399 * and a variable, respectively, but the parentheses are just a small 6400 * part of the full syntax of the function call expression, which is 6401 * not provided as an annotation. 6402 * 6403 * \param TU the translation unit that owns the given tokens. 6404 * 6405 * \param Tokens the set of tokens to annotate. 6406 * 6407 * \param NumTokens the number of tokens in \p Tokens. 6408 * 6409 * \param Cursors an array of \p NumTokens cursors, whose contents will be 6410 * replaced with the cursors corresponding to each token. 6411 */ 6412 annotateTokens :: proc(TU: Translation_Unit, Tokens: [^]Token, NumTokens: c.uint, Cursors: [^]Cursor) --- 6413 6414 /** 6415 * Free the given set of tokens. 6416 */ 6417 disposeTokens :: proc(TU: Translation_Unit, Tokens: [^]Token, NumTokens: c.uint) --- 6418 6419 /* for debug/testing */ 6420 getCursorKindSpelling :: proc(Kind: Cursor_Kind) -> String --- 6421 getDefinitionSpellingAndExtent :: proc(_: Cursor, startBuf: [^]cstring, endBuf: [^]cstring, startLine: ^c.uint, startColumn: ^c.uint, endLine: ^c.uint, endColumn: ^c.uint) --- 6422 enableStackTraces :: proc() --- 6423 executeOnThread :: proc(fn: proc "c" (rawptr), user_data: rawptr, stack_size: c.uint) --- 6424 6425 /** 6426 * Determine the kind of a particular chunk within a completion string. 6427 * 6428 * \param completion_string the completion string to query. 6429 * 6430 * \param chunk_number the 0-based index of the chunk in the completion string. 6431 * 6432 * \returns the kind of the chunk at the index \c chunk_number. 6433 */ 6434 getCompletionChunkKind :: proc(completion_string: Completion_String, chunk_number: c.uint) -> Completion_Chunk_Kind --- 6435 6436 /** 6437 * Retrieve the text associated with a particular chunk within a 6438 * completion string. 6439 * 6440 * \param completion_string the completion string to query. 6441 * 6442 * \param chunk_number the 0-based index of the chunk in the completion string. 6443 * 6444 * \returns the text associated with the chunk at index \c chunk_number. 6445 */ 6446 getCompletionChunkText :: proc(completion_string: Completion_String, chunk_number: c.uint) -> String --- 6447 6448 /** 6449 * Retrieve the completion string associated with a particular chunk 6450 * within a completion string. 6451 * 6452 * \param completion_string the completion string to query. 6453 * 6454 * \param chunk_number the 0-based index of the chunk in the completion string. 6455 * 6456 * \returns the completion string associated with the chunk at index 6457 * \c chunk_number. 6458 */ 6459 getCompletionChunkCompletionString :: proc(completion_string: Completion_String, chunk_number: c.uint) -> Completion_String --- 6460 6461 /** 6462 * Retrieve the number of chunks in the given code-completion string. 6463 */ 6464 getNumCompletionChunks :: proc(completion_string: Completion_String) -> c.uint --- 6465 6466 /** 6467 * Determine the priority of this code completion. 6468 * 6469 * The priority of a code completion indicates how likely it is that this 6470 * particular completion is the completion that the user will select. The 6471 * priority is selected by various internal heuristics. 6472 * 6473 * \param completion_string The completion string to query. 6474 * 6475 * \returns The priority of this completion string. Smaller values indicate 6476 * higher-priority (more likely) completions. 6477 */ 6478 getCompletionPriority :: proc(completion_string: Completion_String) -> c.uint --- 6479 6480 /** 6481 * Determine the availability of the entity that this code-completion 6482 * string refers to. 6483 * 6484 * \param completion_string The completion string to query. 6485 * 6486 * \returns The availability of the completion string. 6487 */ 6488 getCompletionAvailability :: proc(completion_string: Completion_String) -> Availability_Kind --- 6489 6490 /** 6491 * Retrieve the number of annotations associated with the given 6492 * completion string. 6493 * 6494 * \param completion_string the completion string to query. 6495 * 6496 * \returns the number of annotations associated with the given completion 6497 * string. 6498 */ 6499 getCompletionNumAnnotations :: proc(completion_string: Completion_String) -> c.uint --- 6500 6501 /** 6502 * Retrieve the annotation associated with the given completion string. 6503 * 6504 * \param completion_string the completion string to query. 6505 * 6506 * \param annotation_number the 0-based index of the annotation of the 6507 * completion string. 6508 * 6509 * \returns annotation string associated with the completion at index 6510 * \c annotation_number, or a NULL string if that annotation is not available. 6511 */ 6512 getCompletionAnnotation :: proc(completion_string: Completion_String, annotation_number: c.uint) -> String --- 6513 6514 /** 6515 * Retrieve the parent context of the given completion string. 6516 * 6517 * The parent context of a completion string is the semantic parent of 6518 * the declaration (if any) that the code completion represents. For example, 6519 * a code completion for an Objective-C method would have the method's class 6520 * or protocol as its context. 6521 * 6522 * \param completion_string The code completion string whose parent is 6523 * being queried. 6524 * 6525 * \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL. 6526 * 6527 * \returns The name of the completion parent, e.g., "NSObject" if 6528 * the completion string represents a method in the NSObject class. 6529 */ 6530 getCompletionParent :: proc(completion_string: Completion_String, kind: ^Cursor_Kind) -> String --- 6531 6532 /** 6533 * Retrieve the brief documentation comment attached to the declaration 6534 * that corresponds to the given completion string. 6535 */ 6536 getCompletionBriefComment :: proc(completion_string: Completion_String) -> String --- 6537 6538 /** 6539 * Retrieve a completion string for an arbitrary declaration or macro 6540 * definition cursor. 6541 * 6542 * \param cursor The cursor to query. 6543 * 6544 * \returns A non-context-sensitive completion string for declaration and macro 6545 * definition cursors, or NULL for other kinds of cursors. 6546 */ 6547 getCursorCompletionString :: proc(cursor: Cursor) -> Completion_String --- 6548 6549 /** 6550 * Retrieve the number of fix-its for the given completion index. 6551 * 6552 * Calling this makes sense only if CXCodeComplete_IncludeCompletionsWithFixIts 6553 * option was set. 6554 * 6555 * \param results The structure keeping all completion results 6556 * 6557 * \param completion_index The index of the completion 6558 * 6559 * \return The number of fix-its which must be applied before the completion at 6560 * completion_index can be applied 6561 */ 6562 getCompletionNumFixIts :: proc(results: ^Code_Complete_Results, completion_index: c.uint) -> c.uint --- 6563 6564 /** 6565 * Fix-its that *must* be applied before inserting the text for the 6566 * corresponding completion. 6567 * 6568 * By default, clang_codeCompleteAt() only returns completions with empty 6569 * fix-its. Extra completions with non-empty fix-its should be explicitly 6570 * requested by setting CXCodeComplete_IncludeCompletionsWithFixIts. 6571 * 6572 * For the clients to be able to compute position of the cursor after applying 6573 * fix-its, the following conditions are guaranteed to hold for 6574 * replacement_range of the stored fix-its: 6575 * - Ranges in the fix-its are guaranteed to never contain the completion 6576 * point (or identifier under completion point, if any) inside them, except 6577 * at the start or at the end of the range. 6578 * - If a fix-it range starts or ends with completion point (or starts or 6579 * ends after the identifier under completion point), it will contain at 6580 * least one character. It allows to unambiguously recompute completion 6581 * point after applying the fix-it. 6582 * 6583 * The intuition is that provided fix-its change code around the identifier we 6584 * complete, but are not allowed to touch the identifier itself or the 6585 * completion point. One example of completions with corrections are the ones 6586 * replacing '.' with '->' and vice versa: 6587 * 6588 * std::unique_ptr<std::vector<int>> vec_ptr; 6589 * In 'vec_ptr.^', one of the completions is 'push_back', it requires 6590 * replacing '.' with '->'. 6591 * In 'vec_ptr->^', one of the completions is 'release', it requires 6592 * replacing '->' with '.'. 6593 * 6594 * \param results The structure keeping all completion results 6595 * 6596 * \param completion_index The index of the completion 6597 * 6598 * \param fixit_index The index of the fix-it for the completion at 6599 * completion_index 6600 * 6601 * \param replacement_range The fix-it range that must be replaced before the 6602 * completion at completion_index can be applied 6603 * 6604 * \returns The fix-it string that must replace the code at replacement_range 6605 * before the completion at completion_index can be applied 6606 */ 6607 getCompletionFixIt :: proc(results: ^Code_Complete_Results, completion_index: c.uint, fixit_index: c.uint, replacement_range: ^Source_Range) -> String --- 6608 6609 /** 6610 * Returns a default set of code-completion options that can be 6611 * passed to\c clang_codeCompleteAt(). 6612 */ 6613 defaultCodeCompleteOptions :: proc() -> c.uint --- 6614 6615 /** 6616 * Perform code completion at a given location in a translation unit. 6617 * 6618 * This function performs code completion at a particular file, line, and 6619 * column within source code, providing results that suggest potential 6620 * code snippets based on the context of the completion. The basic model 6621 * for code completion is that Clang will parse a complete source file, 6622 * performing syntax checking up to the location where code-completion has 6623 * been requested. At that point, a special code-completion token is passed 6624 * to the parser, which recognizes this token and determines, based on the 6625 * current location in the C/Objective-C/C++ grammar and the state of 6626 * semantic analysis, what completions to provide. These completions are 6627 * returned via a new \c CXCodeCompleteResults structure. 6628 * 6629 * Code completion itself is meant to be triggered by the client when the 6630 * user types punctuation characters or whitespace, at which point the 6631 * code-completion location will coincide with the cursor. For example, if \c p 6632 * is a pointer, code-completion might be triggered after the "-" and then 6633 * after the ">" in \c p->. When the code-completion location is after the ">", 6634 * the completion results will provide, e.g., the members of the struct that 6635 * "p" points to. The client is responsible for placing the cursor at the 6636 * beginning of the token currently being typed, then filtering the results 6637 * based on the contents of the token. For example, when code-completing for 6638 * the expression \c p->get, the client should provide the location just after 6639 * the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the 6640 * client can filter the results based on the current token text ("get"), only 6641 * showing those results that start with "get". The intent of this interface 6642 * is to separate the relatively high-latency acquisition of code-completion 6643 * results from the filtering of results on a per-character basis, which must 6644 * have a lower latency. 6645 * 6646 * \param TU The translation unit in which code-completion should 6647 * occur. The source files for this translation unit need not be 6648 * completely up-to-date (and the contents of those source files may 6649 * be overridden via \p unsaved_files). Cursors referring into the 6650 * translation unit may be invalidated by this invocation. 6651 * 6652 * \param complete_filename The name of the source file where code 6653 * completion should be performed. This filename may be any file 6654 * included in the translation unit. 6655 * 6656 * \param complete_line The line at which code-completion should occur. 6657 * 6658 * \param complete_column The column at which code-completion should occur. 6659 * Note that the column should point just after the syntactic construct that 6660 * initiated code completion, and not in the middle of a lexical token. 6661 * 6662 * \param unsaved_files the Files that have not yet been saved to disk 6663 * but may be required for parsing or code completion, including the 6664 * contents of those files. The contents and name of these files (as 6665 * specified by CXUnsavedFile) are copied when necessary, so the 6666 * client only needs to guarantee their validity until the call to 6667 * this function returns. 6668 * 6669 * \param num_unsaved_files The number of unsaved file entries in \p 6670 * unsaved_files. 6671 * 6672 * \param options Extra options that control the behavior of code 6673 * completion, expressed as a bitwise OR of the enumerators of the 6674 * CXCodeComplete_Flags enumeration. The 6675 * \c clang_defaultCodeCompleteOptions() function returns a default set 6676 * of code-completion options. 6677 * 6678 * \returns If successful, a new \c CXCodeCompleteResults structure 6679 * containing code-completion results, which should eventually be 6680 * freed with \c clang_disposeCodeCompleteResults(). If code 6681 * completion fails, returns NULL. 6682 */ 6683 codeCompleteAt :: proc(TU: Translation_Unit, complete_filename: cstring, complete_line: c.uint, complete_column: c.uint, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, options: c.uint) -> ^Code_Complete_Results --- 6684 6685 /** 6686 * Sort the code-completion results in case-insensitive alphabetical 6687 * order. 6688 * 6689 * \param Results The set of results to sort. 6690 * \param NumResults The number of results in \p Results. 6691 */ 6692 sortCodeCompletionResults :: proc(Results: ^Completion_Result, NumResults: c.uint) --- 6693 6694 /** 6695 * Free the given set of code-completion results. 6696 */ 6697 disposeCodeCompleteResults :: proc(Results: ^Code_Complete_Results) --- 6698 6699 /** 6700 * Determine the number of diagnostics produced prior to the 6701 * location where code completion was performed. 6702 */ 6703 codeCompleteGetNumDiagnostics :: proc(Results: ^Code_Complete_Results) -> c.uint --- 6704 6705 /** 6706 * Retrieve a diagnostic associated with the given code completion. 6707 * 6708 * \param Results the code completion results to query. 6709 * \param Index the zero-based diagnostic number to retrieve. 6710 * 6711 * \returns the requested diagnostic. This diagnostic must be freed 6712 * via a call to \c clang_disposeDiagnostic(). 6713 */ 6714 codeCompleteGetDiagnostic :: proc(Results: ^Code_Complete_Results, Index: c.uint) -> Diagnostic --- 6715 6716 /** 6717 * Determines what completions are appropriate for the context 6718 * the given code completion. 6719 * 6720 * \param Results the code completion results to query 6721 * 6722 * \returns the kinds of completions that are appropriate for use 6723 * along with the given code completion results. 6724 */ 6725 codeCompleteGetContexts :: proc(Results: ^Code_Complete_Results) -> c.ulonglong --- 6726 6727 /** 6728 * Returns the cursor kind for the container for the current code 6729 * completion context. The container is only guaranteed to be set for 6730 * contexts where a container exists (i.e. member accesses or Objective-C 6731 * message sends); if there is not a container, this function will return 6732 * CXCursor_InvalidCode. 6733 * 6734 * \param Results the code completion results to query 6735 * 6736 * \param IsIncomplete on return, this value will be false if Clang has complete 6737 * information about the container. If Clang does not have complete 6738 * information, this value will be true. 6739 * 6740 * \returns the container kind, or CXCursor_InvalidCode if there is not a 6741 * container 6742 */ 6743 codeCompleteGetContainerKind :: proc(Results: ^Code_Complete_Results, IsIncomplete: ^c.uint) -> Cursor_Kind --- 6744 6745 /** 6746 * Returns the USR for the container for the current code completion 6747 * context. If there is not a container for the current context, this 6748 * function will return the empty string. 6749 * 6750 * \param Results the code completion results to query 6751 * 6752 * \returns the USR for the container 6753 */ 6754 codeCompleteGetContainerUSR :: proc(Results: ^Code_Complete_Results) -> String --- 6755 6756 /** 6757 * Returns the currently-entered selector for an Objective-C message 6758 * send, formatted like "initWithFoo:bar:". Only guaranteed to return a 6759 * non-empty string for CXCompletionContext_ObjCInstanceMessage and 6760 * CXCompletionContext_ObjCClassMessage. 6761 * 6762 * \param Results the code completion results to query 6763 * 6764 * \returns the selector (or partial selector) that has been entered thus far 6765 * for an Objective-C message send. 6766 */ 6767 codeCompleteGetObjCSelector :: proc(Results: ^Code_Complete_Results) -> String --- 6768 6769 /** 6770 * Return a version string, suitable for showing to a user, but not 6771 * intended to be parsed (the format is not guaranteed to be stable). 6772 */ 6773 getClangVersion :: proc() -> String --- 6774 6775 /** 6776 * Enable/disable crash recovery. 6777 * 6778 * \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero 6779 * value enables crash recovery, while 0 disables it. 6780 */ 6781 toggleCrashRecovery :: proc(isEnabled: c.uint) --- 6782 6783 /** 6784 * Visit the set of preprocessor inclusions in a translation unit. 6785 * The visitor function is called with the provided data for every included 6786 * file. This does not include headers included by the PCH file (unless one 6787 * is inspecting the inclusions in the PCH file itself). 6788 */ 6789 getInclusions :: proc(tu: Translation_Unit, visitor: Inclusion_Visitor, client_data: Client_Data) --- 6790 6791 /** 6792 * If cursor is a statement declaration tries to evaluate the 6793 * statement and if its variable, tries to evaluate its initializer, 6794 * into its corresponding type. 6795 * If it's an expression, tries to evaluate the expression. 6796 */ 6797 Cursor_Evaluate :: proc(C: Cursor) -> Eval_Result --- 6798 6799 /** 6800 * Returns the kind of the evaluated result. 6801 */ 6802 EvalResult_getKind :: proc(E: Eval_Result) -> Eval_Result_Kind --- 6803 6804 /** 6805 * Returns the evaluation result as integer if the 6806 * kind is Int. 6807 */ 6808 EvalResult_getAsInt :: proc(E: Eval_Result) -> c.int --- 6809 6810 /** 6811 * Returns the evaluation result as a long long integer if the 6812 * kind is Int. This prevents overflows that may happen if the result is 6813 * returned with clang_EvalResult_getAsInt. 6814 */ 6815 EvalResult_getAsLongLong :: proc(E: Eval_Result) -> c.longlong --- 6816 6817 /** 6818 * Returns a non-zero value if the kind is Int and the evaluation 6819 * result resulted in an unsigned integer. 6820 */ 6821 EvalResult_isUnsignedInt :: proc(E: Eval_Result) -> c.uint --- 6822 6823 /** 6824 * Returns the evaluation result as an unsigned integer if 6825 * the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. 6826 */ 6827 EvalResult_getAsUnsigned :: proc(E: Eval_Result) -> c.ulonglong --- 6828 6829 /** 6830 * Returns the evaluation result as double if the 6831 * kind is double. 6832 */ 6833 EvalResult_getAsDouble :: proc(E: Eval_Result) -> f64 --- 6834 6835 /** 6836 * Returns the evaluation result as a constant string if the 6837 * kind is other than Int or float. User must not free this pointer, 6838 * instead call clang_EvalResult_dispose on the CXEvalResult returned 6839 * by clang_Cursor_Evaluate. 6840 */ 6841 EvalResult_getAsStr :: proc(E: Eval_Result) -> cstring --- 6842 6843 /** 6844 * Disposes the created Eval memory. 6845 */ 6846 EvalResult_dispose :: proc(E: Eval_Result) --- 6847 6848 /** 6849 * Retrieve a remapping. 6850 * 6851 * \param path the path that contains metadata about remappings. 6852 * 6853 * \returns the requested remapping. This remapping must be freed 6854 * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. 6855 */ 6856 getRemappings :: proc(path: cstring) -> Remapping --- 6857 6858 /** 6859 * Retrieve a remapping. 6860 * 6861 * \param filePaths pointer to an array of file paths containing remapping info. 6862 * 6863 * \param numFiles number of file paths. 6864 * 6865 * \returns the requested remapping. This remapping must be freed 6866 * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. 6867 */ 6868 getRemappingsFromFileList :: proc(filePaths: [^]cstring, numFiles: c.uint) -> Remapping --- 6869 6870 /** 6871 * Determine the number of remappings. 6872 */ 6873 remap_getNumFiles :: proc(_: Remapping) -> c.uint --- 6874 6875 /** 6876 * Get the original and the associated filename from the remapping. 6877 * 6878 * \param original If non-NULL, will be set to the original filename. 6879 * 6880 * \param transformed If non-NULL, will be set to the filename that the original 6881 * is associated with. 6882 */ 6883 remap_getFilenames :: proc(_: Remapping, index: c.uint, original: ^String, transformed: ^String) --- 6884 6885 /** 6886 * Dispose the remapping. 6887 */ 6888 remap_dispose :: proc(_: Remapping) --- 6889 6890 /** 6891 * Find references of a declaration in a specific file. 6892 * 6893 * \param cursor pointing to a declaration or a reference of one. 6894 * 6895 * \param file to search for references. 6896 * 6897 * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for 6898 * each reference found. 6899 * The CXSourceRange will point inside the file; if the reference is inside 6900 * a macro (and not a macro argument) the CXSourceRange will be invalid. 6901 * 6902 * \returns one of the CXResult enumerators. 6903 */ 6904 findReferencesInFile :: proc(cursor: Cursor, file: File, visitor: Cursor_And_Range_Visitor) -> Result --- 6905 6906 /** 6907 * Find #import/#include directives in a specific file. 6908 * 6909 * \param TU translation unit containing the file to query. 6910 * 6911 * \param file to search for #import/#include directives. 6912 * 6913 * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for 6914 * each directive found. 6915 * 6916 * \returns one of the CXResult enumerators. 6917 */ 6918 findIncludesInFile :: proc(TU: Translation_Unit, file: File, visitor: Cursor_And_Range_Visitor) -> Result --- 6919 findReferencesInFileWithBlock :: proc(_: Cursor, _: File, _: Cursor_And_Range_Visitor_Block) -> Result --- 6920 findIncludesInFileWithBlock :: proc(_: Translation_Unit, _: File, _: Cursor_And_Range_Visitor_Block) -> Result --- 6921 index_isEntityObjCContainerKind :: proc(_: Idx_Entity_Kind) -> c.int --- 6922 index_getObjCContainerDeclInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Obj_Ccontainer_Decl_Info --- 6923 index_getObjCInterfaceDeclInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Obj_Cinterface_Decl_Info --- 6924 index_getObjCCategoryDeclInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Obj_Ccategory_Decl_Info --- 6925 index_getObjCProtocolRefListInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Obj_Cprotocol_Ref_List_Info --- 6926 index_getObjCPropertyDeclInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Obj_Cproperty_Decl_Info --- 6927 index_getIBOutletCollectionAttrInfo :: proc(_: ^Idx_Attr_Info) -> ^Idx_Iboutlet_Collection_Attr_Info --- 6928 index_getCXXClassDeclInfo :: proc(_: ^Idx_Decl_Info) -> ^Idx_Cxxclass_Decl_Info --- 6929 6930 /** 6931 * For retrieving a custom CXIdxClientContainer attached to a 6932 * container. 6933 */ 6934 index_getClientContainer :: proc(_: ^Idx_Container_Info) -> Idx_Client_Container --- 6935 6936 /** 6937 * For setting a custom CXIdxClientContainer attached to a 6938 * container. 6939 */ 6940 index_setClientContainer :: proc(_: ^Idx_Container_Info, _: Idx_Client_Container) --- 6941 6942 /** 6943 * For retrieving a custom CXIdxClientEntity attached to an entity. 6944 */ 6945 index_getClientEntity :: proc(_: ^Idx_Entity_Info) -> Idx_Client_Entity --- 6946 6947 /** 6948 * For setting a custom CXIdxClientEntity attached to an entity. 6949 */ 6950 index_setClientEntity :: proc(_: ^Idx_Entity_Info, _: Idx_Client_Entity) --- 6951 6952 /** 6953 * An indexing action/session, to be applied to one or multiple 6954 * translation units. 6955 * 6956 * \param CIdx The index object with which the index action will be associated. 6957 */ 6958 IndexAction_create :: proc(CIdx: Index) -> Index_Action --- 6959 6960 /** 6961 * Destroy the given index action. 6962 * 6963 * The index action must not be destroyed until all of the translation units 6964 * created within that index action have been destroyed. 6965 */ 6966 IndexAction_dispose :: proc(_: Index_Action) --- 6967 6968 /** 6969 * Index the given source file and the translation unit corresponding 6970 * to that file via callbacks implemented through #IndexerCallbacks. 6971 * 6972 * \param client_data pointer data supplied by the client, which will 6973 * be passed to the invoked callbacks. 6974 * 6975 * \param index_callbacks Pointer to indexing callbacks that the client 6976 * implements. 6977 * 6978 * \param index_callbacks_size Size of #IndexerCallbacks structure that gets 6979 * passed in index_callbacks. 6980 * 6981 * \param index_options A bitmask of options that affects how indexing is 6982 * performed. This should be a bitwise OR of the CXIndexOpt_XXX flags. 6983 * 6984 * \param[out] out_TU pointer to store a \c CXTranslationUnit that can be 6985 * reused after indexing is finished. Set to \c NULL if you do not require it. 6986 * 6987 * \returns 0 on success or if there were errors from which the compiler could 6988 * recover. If there is a failure from which there is no recovery, returns 6989 * a non-zero \c CXErrorCode. 6990 * 6991 * The rest of the parameters are the same as #clang_parseTranslationUnit. 6992 */ 6993 indexSourceFile :: proc(_: Index_Action, client_data: Client_Data, index_callbacks: ^Indexer_Callbacks, index_callbacks_size: c.uint, index_options: c.uint, source_filename: cstring, command_line_args: [^]cstring, num_command_line_args: c.int, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, out_TU: ^Translation_Unit, TU_options: c.uint) -> c.int --- 6994 6995 /** 6996 * Same as clang_indexSourceFile but requires a full command line 6997 * for \c command_line_args including argv[0]. This is useful if the standard 6998 * library paths are relative to the binary. 6999 */ 7000 indexSourceFileFullArgv :: proc(_: Index_Action, client_data: Client_Data, index_callbacks: ^Indexer_Callbacks, index_callbacks_size: c.uint, index_options: c.uint, source_filename: cstring, command_line_args: [^]cstring, num_command_line_args: c.int, unsaved_files: ^Unsaved_File, num_unsaved_files: c.uint, out_TU: ^Translation_Unit, TU_options: c.uint) -> c.int --- 7001 7002 /** 7003 * Index the given translation unit via callbacks implemented through 7004 * #IndexerCallbacks. 7005 * 7006 * The order of callback invocations is not guaranteed to be the same as 7007 * when indexing a source file. The high level order will be: 7008 * 7009 * -Preprocessor callbacks invocations 7010 * -Declaration/reference callbacks invocations 7011 * -Diagnostic callback invocations 7012 * 7013 * The parameters are the same as #clang_indexSourceFile. 7014 * 7015 * \returns If there is a failure from which there is no recovery, returns 7016 * non-zero, otherwise returns 0. 7017 */ 7018 indexTranslationUnit :: proc(_: Index_Action, client_data: Client_Data, index_callbacks: ^Indexer_Callbacks, index_callbacks_size: c.uint, index_options: c.uint, _: Translation_Unit) -> c.int --- 7019 7020 /** 7021 * Retrieve the CXIdxFile, file, line, column, and offset represented by 7022 * the given CXIdxLoc. 7023 * 7024 * If the location refers into a macro expansion, retrieves the 7025 * location of the macro expansion and if it refers into a macro argument 7026 * retrieves the location of the argument. 7027 */ 7028 indexLoc_getFileLocation :: proc(loc: Idx_Loc, indexFile: ^Idx_Client_File, file: ^File, line: ^c.uint, column: ^c.uint, offset: ^c.uint) --- 7029 7030 /** 7031 * Retrieve the CXSourceLocation represented by the given CXIdxLoc. 7032 */ 7033 indexLoc_getCXSourceLocation :: proc(loc: Idx_Loc) -> Source_Location --- 7034 7035 /** 7036 * Visit the fields of a particular type. 7037 * 7038 * This function visits all the direct fields of the given cursor, 7039 * invoking the given \p visitor function with the cursors of each 7040 * visited field. The traversal may be ended prematurely, if 7041 * the visitor returns \c CXFieldVisit_Break. 7042 * 7043 * \param T the record type whose field may be visited. 7044 * 7045 * \param visitor the visitor function that will be invoked for each 7046 * field of \p T. 7047 * 7048 * \param client_data pointer data supplied by the client, which will 7049 * be passed to the visitor each time it is invoked. 7050 * 7051 * \returns a non-zero value if the traversal was terminated 7052 * prematurely by the visitor returning \c CXFieldVisit_Break. 7053 */ 7054 Type_visitFields :: proc(T: Type, visitor: Field_Visitor, client_data: Client_Data) -> c.uint --- 7055 7056 /** 7057 * Visit the base classes of a type. 7058 * 7059 * This function visits all the direct base classes of a the given cursor, 7060 * invoking the given \p visitor function with the cursors of each 7061 * visited base. The traversal may be ended prematurely, if 7062 * the visitor returns \c CXFieldVisit_Break. 7063 * 7064 * \param T the record type whose field may be visited. 7065 * 7066 * \param visitor the visitor function that will be invoked for each 7067 * field of \p T. 7068 * 7069 * \param client_data pointer data supplied by the client, which will 7070 * be passed to the visitor each time it is invoked. 7071 * 7072 * \returns a non-zero value if the traversal was terminated 7073 * prematurely by the visitor returning \c CXFieldVisit_Break. 7074 */ 7075 visitCXXBaseClasses :: proc(T: Type, visitor: Field_Visitor, client_data: Client_Data) -> c.uint --- 7076 7077 /** 7078 * Retrieve the spelling of a given CXBinaryOperatorKind. 7079 */ 7080 getBinaryOperatorKindSpelling :: proc(kind: CXBinary_Operator_Kind) -> String --- 7081 7082 /** 7083 * Retrieve the binary operator kind of this cursor. 7084 * 7085 * If this cursor is not a binary operator then returns Invalid. 7086 */ 7087 getCursorBinaryOperatorKind :: proc(cursor: Cursor) -> CXBinary_Operator_Kind --- 7088 7089 /** 7090 * Retrieve the spelling of a given CXUnaryOperatorKind. 7091 */ 7092 getUnaryOperatorKindSpelling :: proc(kind: Unary_Operator_Kind) -> String --- 7093 7094 /** 7095 * Retrieve the unary operator kind of this cursor. 7096 * 7097 * If this cursor is not a unary operator then returns Invalid. 7098 */ 7099 getCursorUnaryOperatorKind :: proc(cursor: Cursor) -> Unary_Operator_Kind --- 7100 }