clang  19.0.0git
Index.h
Go to the documentation of this file.
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 
16 #ifndef LLVM_CLANG_C_INDEX_H
17 #define LLVM_CLANG_C_INDEX_H
18 
19 #include "clang-c/BuildSystem.h"
20 #include "clang-c/CXDiagnostic.h"
21 #include "clang-c/CXErrorCode.h"
22 #include "clang-c/CXFile.h"
24 #include "clang-c/CXString.h"
25 #include "clang-c/ExternC.h"
26 #include "clang-c/Platform.h"
27 
28 /**
29  * The version constants for the libclang API.
30  * CINDEX_VERSION_MINOR should increase when there are API additions.
31  * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
32  *
33  * The policy about the libclang API was always to keep it source and ABI
34  * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
35  */
36 #define CINDEX_VERSION_MAJOR 0
37 #define CINDEX_VERSION_MINOR 64
38 
39 #define CINDEX_VERSION_ENCODE(major, minor) (((major)*10000) + ((minor)*1))
40 
41 #define CINDEX_VERSION \
42  CINDEX_VERSION_ENCODE(CINDEX_VERSION_MAJOR, CINDEX_VERSION_MINOR)
43 
44 #define CINDEX_VERSION_STRINGIZE_(major, minor) #major "." #minor
45 #define CINDEX_VERSION_STRINGIZE(major, minor) \
46  CINDEX_VERSION_STRINGIZE_(major, minor)
47 
48 #define CINDEX_VERSION_STRING \
49  CINDEX_VERSION_STRINGIZE(CINDEX_VERSION_MAJOR, CINDEX_VERSION_MINOR)
50 
51 #ifndef __has_feature
52 #define __has_feature(feature) 0
53 #endif
54 
56 
57 /** \defgroup CINDEX libclang: C Interface to Clang
58  *
59  * The C Interface to Clang provides a relatively small API that exposes
60  * facilities for parsing source code into an abstract syntax tree (AST),
61  * loading already-parsed ASTs, traversing the AST, associating
62  * physical source locations with elements within the AST, and other
63  * facilities that support Clang-based development tools.
64  *
65  * This C interface to Clang will never provide all of the information
66  * representation stored in Clang's C++ AST, nor should it: the intent is to
67  * maintain an API that is relatively stable from one release to the next,
68  * providing only the basic functionality needed to support development tools.
69  *
70  * To avoid namespace pollution, data types are prefixed with "CX" and
71  * functions are prefixed with "clang_".
72  *
73  * @{
74  */
75 
76 /**
77  * An "index" that consists of a set of translation units that would
78  * typically be linked together into an executable or library.
79  */
80 typedef void *CXIndex;
81 
82 /**
83  * An opaque type representing target information for a given translation
84  * unit.
85  */
86 typedef struct CXTargetInfoImpl *CXTargetInfo;
87 
88 /**
89  * A single translation unit, which resides in an index.
90  */
91 typedef struct CXTranslationUnitImpl *CXTranslationUnit;
92 
93 /**
94  * Opaque pointer representing client data that will be passed through
95  * to various callbacks and visitors.
96  */
97 typedef void *CXClientData;
98 
99 /**
100  * Provides the contents of a file that has not yet been saved to disk.
101  *
102  * Each CXUnsavedFile instance provides the name of a file on the
103  * system along with the current contents of that file that have not
104  * yet been saved to disk.
105  */
107  /**
108  * The file whose contents have not yet been saved.
109  *
110  * This file must already exist in the file system.
111  */
112  const char *Filename;
113 
114  /**
115  * A buffer containing the unsaved contents of this file.
116  */
117  const char *Contents;
118 
119  /**
120  * The length of the unsaved contents of this buffer.
121  */
122  unsigned long Length;
123 };
124 
125 /**
126  * Describes the availability of a particular entity, which indicates
127  * whether the use of this entity will result in a warning or error due to
128  * it being deprecated or unavailable.
129  */
131  /**
132  * The entity is available.
133  */
135  /**
136  * The entity is available, but has been deprecated (and its use is
137  * not recommended).
138  */
140  /**
141  * The entity is not available; any use of it will be an error.
142  */
144  /**
145  * The entity is available, but not accessible; any use of it will be
146  * an error.
147  */
149 };
150 
151 /**
152  * Describes a version number of the form major.minor.subminor.
153  */
154 typedef struct CXVersion {
155  /**
156  * The major version number, e.g., the '10' in '10.7.3'. A negative
157  * value indicates that there is no version number at all.
158  */
159  int Major;
160  /**
161  * The minor version number, e.g., the '7' in '10.7.3'. This value
162  * will be negative if no minor version number was provided, e.g., for
163  * version '10'.
164  */
165  int Minor;
166  /**
167  * The subminor version number, e.g., the '3' in '10.7.3'. This value
168  * will be negative if no minor or subminor version number was provided,
169  * e.g., in version '10' or '10.7'.
170  */
171  int Subminor;
173 
174 /**
175  * Describes the exception specification of a cursor.
176  *
177  * A negative value indicates that the cursor is not a function declaration.
178  */
180  /**
181  * The cursor has no exception specification.
182  */
184 
185  /**
186  * The cursor has exception specification throw()
187  */
189 
190  /**
191  * The cursor has exception specification throw(T1, T2)
192  */
194 
195  /**
196  * The cursor has exception specification throw(...).
197  */
199 
200  /**
201  * The cursor has exception specification basic noexcept.
202  */
204 
205  /**
206  * The cursor has exception specification computed noexcept.
207  */
209 
210  /**
211  * The exception specification has not yet been evaluated.
212  */
214 
215  /**
216  * The exception specification has not yet been instantiated.
217  */
219 
220  /**
221  * The exception specification has not been parsed yet.
222  */
224 
225  /**
226  * The cursor has a __declspec(nothrow) exception specification.
227  */
229 };
230 
231 /**
232  * Provides a shared context for creating translation units.
233  *
234  * It provides two options:
235  *
236  * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local"
237  * declarations (when loading any new translation units). A "local" declaration
238  * is one that belongs in the translation unit itself and not in a precompiled
239  * header that was used by the translation unit. If zero, all declarations
240  * will be enumerated.
241  *
242  * Here is an example:
243  *
244  * \code
245  * // excludeDeclsFromPCH = 1, displayDiagnostics=1
246  * Idx = clang_createIndex(1, 1);
247  *
248  * // IndexTest.pch was produced with the following command:
249  * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch"
250  * TU = clang_createTranslationUnit(Idx, "IndexTest.pch");
251  *
252  * // This will load all the symbols from 'IndexTest.pch'
253  * clang_visitChildren(clang_getTranslationUnitCursor(TU),
254  * TranslationUnitVisitor, 0);
255  * clang_disposeTranslationUnit(TU);
256  *
257  * // This will load all the symbols from 'IndexTest.c', excluding symbols
258  * // from 'IndexTest.pch'.
259  * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" };
260  * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args,
261  * 0, 0);
262  * clang_visitChildren(clang_getTranslationUnitCursor(TU),
263  * TranslationUnitVisitor, 0);
264  * clang_disposeTranslationUnit(TU);
265  * \endcode
266  *
267  * This process of creating the 'pch', loading it separately, and using it (via
268  * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks
269  * (which gives the indexer the same performance benefit as the compiler).
270  */
271 CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
272  int displayDiagnostics);
273 
274 /**
275  * Destroy the given index.
276  *
277  * The index must not be destroyed until all of the translation units created
278  * within that index have been destroyed.
279  */
281 
282 typedef enum {
283  /**
284  * Use the default value of an option that may depend on the process
285  * environment.
286  */
288  /**
289  * Enable the option.
290  */
292  /**
293  * Disable the option.
294  */
297 
298 typedef enum {
299  /**
300  * Used to indicate that no special CXIndex options are needed.
301  */
303 
304  /**
305  * Used to indicate that threads that libclang creates for indexing
306  * purposes should use background priority.
307  *
308  * Affects #clang_indexSourceFile, #clang_indexTranslationUnit,
309  * #clang_parseTranslationUnit, #clang_saveTranslationUnit.
310  */
312 
313  /**
314  * Used to indicate that threads that libclang creates for editing
315  * purposes should use background priority.
316  *
317  * Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt,
318  * #clang_annotateTokens
319  */
321 
322  /**
323  * Used to indicate that all threads that libclang creates should use
324  * background priority.
325  */
329 
331 
332 /**
333  * Index initialization options.
334  *
335  * 0 is the default value of each member of this struct except for Size.
336  * Initialize the struct in one of the following three ways to avoid adapting
337  * code each time a new member is added to it:
338  * \code
339  * CXIndexOptions Opts;
340  * memset(&Opts, 0, sizeof(Opts));
341  * Opts.Size = sizeof(CXIndexOptions);
342  * \endcode
343  * or explicitly initialize the first data member and zero-initialize the rest:
344  * \code
345  * CXIndexOptions Opts = { sizeof(CXIndexOptions) };
346  * \endcode
347  * or to prevent the -Wmissing-field-initializers warning for the above version:
348  * \code
349  * CXIndexOptions Opts{};
350  * Opts.Size = sizeof(CXIndexOptions);
351  * \endcode
352  */
353 typedef struct CXIndexOptions {
354  /**
355  * The size of struct CXIndexOptions used for option versioning.
356  *
357  * Always initialize this member to sizeof(CXIndexOptions), or assign
358  * sizeof(CXIndexOptions) to it right after creating a CXIndexOptions object.
359  */
360  unsigned Size;
361  /**
362  * A CXChoice enumerator that specifies the indexing priority policy.
363  * \sa CXGlobalOpt_ThreadBackgroundPriorityForIndexing
364  */
366  /**
367  * A CXChoice enumerator that specifies the editing priority policy.
368  * \sa CXGlobalOpt_ThreadBackgroundPriorityForEditing
369  */
371  /**
372  * \see clang_createIndex()
373  */
375  /**
376  * \see clang_createIndex()
377  */
378  unsigned DisplayDiagnostics : 1;
379  /**
380  * Store PCH in memory. If zero, PCH are stored in temporary files.
381  */
383  unsigned /*Reserved*/ : 13;
384 
385  /**
386  * The path to a directory, in which to store temporary PCH files. If null or
387  * empty, the default system temporary directory is used. These PCH files are
388  * deleted on clean exit but stay on disk if the program crashes or is killed.
389  *
390  * This option is ignored if \a StorePreamblesInMemory is non-zero.
391  *
392  * Libclang does not create the directory at the specified path in the file
393  * system. Therefore it must exist, or storing PCH files will fail.
394  */
395  const char *PreambleStoragePath;
396  /**
397  * Specifies a path which will contain log files for certain libclang
398  * invocations. A null value implies that libclang invocations are not logged.
399  */
402 
403 /**
404  * Provides a shared context for creating translation units.
405  *
406  * Call this function instead of clang_createIndex() if you need to configure
407  * the additional options in CXIndexOptions.
408  *
409  * \returns The created index or null in case of error, such as an unsupported
410  * value of options->Size.
411  *
412  * For example:
413  * \code
414  * CXIndex createIndex(const char *ApplicationTemporaryPath) {
415  * const int ExcludeDeclarationsFromPCH = 1;
416  * const int DisplayDiagnostics = 1;
417  * CXIndex Idx;
418  * #if CINDEX_VERSION_MINOR >= 64
419  * CXIndexOptions Opts;
420  * memset(&Opts, 0, sizeof(Opts));
421  * Opts.Size = sizeof(CXIndexOptions);
422  * Opts.ThreadBackgroundPriorityForIndexing = 1;
423  * Opts.ExcludeDeclarationsFromPCH = ExcludeDeclarationsFromPCH;
424  * Opts.DisplayDiagnostics = DisplayDiagnostics;
425  * Opts.PreambleStoragePath = ApplicationTemporaryPath;
426  * Idx = clang_createIndexWithOptions(&Opts);
427  * if (Idx)
428  * return Idx;
429  * fprintf(stderr,
430  * "clang_createIndexWithOptions() failed. "
431  * "CINDEX_VERSION_MINOR = %d, sizeof(CXIndexOptions) = %u\n",
432  * CINDEX_VERSION_MINOR, Opts.Size);
433  * #else
434  * (void)ApplicationTemporaryPath;
435  * #endif
436  * Idx = clang_createIndex(ExcludeDeclarationsFromPCH, DisplayDiagnostics);
437  * clang_CXIndex_setGlobalOptions(
438  * Idx, clang_CXIndex_getGlobalOptions(Idx) |
439  * CXGlobalOpt_ThreadBackgroundPriorityForIndexing);
440  * return Idx;
441  * }
442  * \endcode
443  *
444  * \sa clang_createIndex()
445  */
448 
449 /**
450  * Sets general options associated with a CXIndex.
451  *
452  * This function is DEPRECATED. Set
453  * CXIndexOptions::ThreadBackgroundPriorityForIndexing and/or
454  * CXIndexOptions::ThreadBackgroundPriorityForEditing and call
455  * clang_createIndexWithOptions() instead.
456  *
457  * For example:
458  * \code
459  * CXIndex idx = ...;
460  * clang_CXIndex_setGlobalOptions(idx,
461  * clang_CXIndex_getGlobalOptions(idx) |
462  * CXGlobalOpt_ThreadBackgroundPriorityForIndexing);
463  * \endcode
464  *
465  * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags.
466  */
468 
469 /**
470  * Gets the general options associated with a CXIndex.
471  *
472  * This function allows to obtain the final option values used by libclang after
473  * specifying the option policies via CXChoice enumerators.
474  *
475  * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that
476  * are associated with the given CXIndex object.
477  */
479 
480 /**
481  * Sets the invocation emission path option in a CXIndex.
482  *
483  * This function is DEPRECATED. Set CXIndexOptions::InvocationEmissionPath and
484  * call clang_createIndexWithOptions() instead.
485  *
486  * The invocation emission path specifies a path which will contain log
487  * files for certain libclang invocations. A null value (default) implies that
488  * libclang invocations are not logged..
489  */
490 CINDEX_LINKAGE void
492 
493 /**
494  * Determine whether the given header is guarded against
495  * multiple inclusions, either with the conventional
496  * \#ifndef/\#define/\#endif macro guards or with \#pragma once.
497  */
499  CXFile file);
500 
501 /**
502  * Retrieve a file handle within the given translation unit.
503  *
504  * \param tu the translation unit
505  *
506  * \param file_name the name of the file.
507  *
508  * \returns the file handle for the named file in the translation unit \p tu,
509  * or a NULL file handle if the file was not a part of this translation unit.
510  */
512  const char *file_name);
513 
514 /**
515  * Retrieve the buffer associated with the given file.
516  *
517  * \param tu the translation unit
518  *
519  * \param file the file for which to retrieve the buffer.
520  *
521  * \param size [out] if non-NULL, will be set to the size of the buffer.
522  *
523  * \returns a pointer to the buffer in memory that holds the contents of
524  * \p file, or a NULL pointer when the file is not loaded.
525  */
527  CXFile file, size_t *size);
528 
529 /**
530  * Retrieves the source location associated with a given file/line/column
531  * in a particular translation unit.
532  */
534  CXFile file, unsigned line,
535  unsigned column);
536 /**
537  * Retrieves the source location associated with a given character offset
538  * in a particular translation unit.
539  */
541  CXFile file,
542  unsigned offset);
543 
544 /**
545  * Retrieve all ranges that were skipped by the preprocessor.
546  *
547  * The preprocessor will skip lines when they are surrounded by an
548  * if/ifdef/ifndef directive whose condition does not evaluate to true.
549  */
551  CXFile file);
552 
553 /**
554  * Retrieve all ranges from all files that were skipped by the
555  * preprocessor.
556  *
557  * The preprocessor will skip lines when they are surrounded by an
558  * if/ifdef/ifndef directive whose condition does not evaluate to true.
559  */
562 
563 /**
564  * Determine the number of diagnostics produced for the given
565  * translation unit.
566  */
568 
569 /**
570  * Retrieve a diagnostic associated with the given translation unit.
571  *
572  * \param Unit the translation unit to query.
573  * \param Index the zero-based diagnostic number to retrieve.
574  *
575  * \returns the requested diagnostic. This diagnostic must be freed
576  * via a call to \c clang_disposeDiagnostic().
577  */
579  unsigned Index);
580 
581 /**
582  * Retrieve the complete set of diagnostics associated with a
583  * translation unit.
584  *
585  * \param Unit the translation unit to query.
586  */
589 
590 /**
591  * \defgroup CINDEX_TRANSLATION_UNIT Translation unit manipulation
592  *
593  * The routines in this group provide the ability to create and destroy
594  * translation units from files, either by parsing the contents of the files or
595  * by reading in a serialized representation of a translation unit.
596  *
597  * @{
598  */
599 
600 /**
601  * Get the original translation unit source file name.
602  */
605 
606 /**
607  * Return the CXTranslationUnit for a given source file and the provided
608  * command line arguments one would pass to the compiler.
609  *
610  * Note: The 'source_filename' argument is optional. If the caller provides a
611  * NULL pointer, the name of the source file is expected to reside in the
612  * specified command line arguments.
613  *
614  * Note: When encountered in 'clang_command_line_args', the following options
615  * are ignored:
616  *
617  * '-c'
618  * '-emit-ast'
619  * '-fsyntax-only'
620  * '-o <output file>' (both '-o' and '<output file>' are ignored)
621  *
622  * \param CIdx The index object with which the translation unit will be
623  * associated.
624  *
625  * \param source_filename The name of the source file to load, or NULL if the
626  * source file is included in \p clang_command_line_args.
627  *
628  * \param num_clang_command_line_args The number of command-line arguments in
629  * \p clang_command_line_args.
630  *
631  * \param clang_command_line_args The command-line arguments that would be
632  * passed to the \c clang executable if it were being invoked out-of-process.
633  * These command-line options will be parsed and will affect how the translation
634  * unit is parsed. Note that the following options are ignored: '-c',
635  * '-emit-ast', '-fsyntax-only' (which is the default), and '-o <output file>'.
636  *
637  * \param num_unsaved_files the number of unsaved file entries in \p
638  * unsaved_files.
639  *
640  * \param unsaved_files the files that have not yet been saved to disk
641  * but may be required for code completion, including the contents of
642  * those files. The contents and name of these files (as specified by
643  * CXUnsavedFile) are copied when necessary, so the client only needs to
644  * guarantee their validity until the call to this function returns.
645  */
647  CXIndex CIdx, const char *source_filename, int num_clang_command_line_args,
648  const char *const *clang_command_line_args, unsigned num_unsaved_files,
649  struct CXUnsavedFile *unsaved_files);
650 
651 /**
652  * Same as \c clang_createTranslationUnit2, but returns
653  * the \c CXTranslationUnit instead of an error code. In case of an error this
654  * routine returns a \c NULL \c CXTranslationUnit, without further detailed
655  * error codes.
656  */
658 clang_createTranslationUnit(CXIndex CIdx, const char *ast_filename);
659 
660 /**
661  * Create a translation unit from an AST file (\c -emit-ast).
662  *
663  * \param[out] out_TU A non-NULL pointer to store the created
664  * \c CXTranslationUnit.
665  *
666  * \returns Zero on success, otherwise returns an error code.
667  */
669 clang_createTranslationUnit2(CXIndex CIdx, const char *ast_filename,
670  CXTranslationUnit *out_TU);
671 
672 /**
673  * Flags that control the creation of translation units.
674  *
675  * The enumerators in this enumeration type are meant to be bitwise
676  * ORed together to specify which options should be used when
677  * constructing the translation unit.
678  */
680  /**
681  * Used to indicate that no special translation-unit options are
682  * needed.
683  */
685 
686  /**
687  * Used to indicate that the parser should construct a "detailed"
688  * preprocessing record, including all macro definitions and instantiations.
689  *
690  * Constructing a detailed preprocessing record requires more memory
691  * and time to parse, since the information contained in the record
692  * is usually not retained. However, it can be useful for
693  * applications that require more detailed information about the
694  * behavior of the preprocessor.
695  */
697 
698  /**
699  * Used to indicate that the translation unit is incomplete.
700  *
701  * When a translation unit is considered "incomplete", semantic
702  * analysis that is typically performed at the end of the
703  * translation unit will be suppressed. For example, this suppresses
704  * the completion of tentative declarations in C and of
705  * instantiation of implicitly-instantiation function templates in
706  * C++. This option is typically used when parsing a header with the
707  * intent of producing a precompiled header.
708  */
710 
711  /**
712  * Used to indicate that the translation unit should be built with an
713  * implicit precompiled header for the preamble.
714  *
715  * An implicit precompiled header is used as an optimization when a
716  * particular translation unit is likely to be reparsed many times
717  * when the sources aren't changing that often. In this case, an
718  * implicit precompiled header will be built containing all of the
719  * initial includes at the top of the main file (what we refer to as
720  * the "preamble" of the file). In subsequent parses, if the
721  * preamble or the files in it have not changed, \c
722  * clang_reparseTranslationUnit() will re-use the implicit
723  * precompiled header to improve parsing performance.
724  */
726 
727  /**
728  * Used to indicate that the translation unit should cache some
729  * code-completion results with each reparse of the source file.
730  *
731  * Caching of code-completion results is a performance optimization that
732  * introduces some overhead to reparsing but improves the performance of
733  * code-completion operations.
734  */
736 
737  /**
738  * Used to indicate that the translation unit will be serialized with
739  * \c clang_saveTranslationUnit.
740  *
741  * This option is typically used when parsing a header with the intent of
742  * producing a precompiled header.
743  */
745 
746  /**
747  * DEPRECATED: Enabled chained precompiled preambles in C++.
748  *
749  * Note: this is a *temporary* option that is available only while
750  * we are testing C++ precompiled preamble support. It is deprecated.
751  */
753 
754  /**
755  * Used to indicate that function/method bodies should be skipped while
756  * parsing.
757  *
758  * This option can be used to search for declarations/definitions while
759  * ignoring the usages.
760  */
762 
763  /**
764  * Used to indicate that brief documentation comments should be
765  * included into the set of code completions returned from this translation
766  * unit.
767  */
769 
770  /**
771  * Used to indicate that the precompiled preamble should be created on
772  * the first parse. Otherwise it will be created on the first reparse. This
773  * trades runtime on the first parse (serializing the preamble takes time) for
774  * reduced runtime on the second parse (can now reuse the preamble).
775  */
777 
778  /**
779  * Do not stop processing when fatal errors are encountered.
780  *
781  * When fatal errors are encountered while parsing a translation unit,
782  * semantic analysis is typically stopped early when compiling code. A common
783  * source for fatal errors are unresolvable include files. For the
784  * purposes of an IDE, this is undesirable behavior and as much information
785  * as possible should be reported. Use this flag to enable this behavior.
786  */
788 
789  /**
790  * Sets the preprocessor in a mode for parsing a single file only.
791  */
793 
794  /**
795  * Used in combination with CXTranslationUnit_SkipFunctionBodies to
796  * constrain the skipping of function bodies to the preamble.
797  *
798  * The function bodies of the main file are not skipped.
799  */
801 
802  /**
803  * Used to indicate that attributed types should be included in CXType.
804  */
806 
807  /**
808  * Used to indicate that implicit attributes should be visited.
809  */
811 
812  /**
813  * Used to indicate that non-errors from included files should be ignored.
814  *
815  * If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from
816  * included files anymore. This speeds up clang_getDiagnosticSetFromTU() for
817  * the case where these warnings are not of interest, as for an IDE for
818  * example, which typically shows only the diagnostics in the main file.
819  */
821 
822  /**
823  * Tells the preprocessor not to skip excluded conditional blocks.
824  */
826 };
827 
828 /**
829  * Returns the set of flags that is suitable for parsing a translation
830  * unit that is being edited.
831  *
832  * The set of flags returned provide options for \c clang_parseTranslationUnit()
833  * to indicate that the translation unit is likely to be reparsed many times,
834  * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly
835  * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag
836  * set contains an unspecified set of optimizations (e.g., the precompiled
837  * preamble) geared toward improving the performance of these routines. The
838  * set of optimizations enabled may change from one version to the next.
839  */
841 
842 /**
843  * Same as \c clang_parseTranslationUnit2, but returns
844  * the \c CXTranslationUnit instead of an error code. In case of an error this
845  * routine returns a \c NULL \c CXTranslationUnit, without further detailed
846  * error codes.
847  */
849  CXIndex CIdx, const char *source_filename,
850  const char *const *command_line_args, int num_command_line_args,
851  struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
852  unsigned options);
853 
854 /**
855  * Parse the given source file and the translation unit corresponding
856  * to that file.
857  *
858  * This routine is the main entry point for the Clang C API, providing the
859  * ability to parse a source file into a translation unit that can then be
860  * queried by other functions in the API. This routine accepts a set of
861  * command-line arguments so that the compilation can be configured in the same
862  * way that the compiler is configured on the command line.
863  *
864  * \param CIdx The index object with which the translation unit will be
865  * associated.
866  *
867  * \param source_filename The name of the source file to load, or NULL if the
868  * source file is included in \c command_line_args.
869  *
870  * \param command_line_args The command-line arguments that would be
871  * passed to the \c clang executable if it were being invoked out-of-process.
872  * These command-line options will be parsed and will affect how the translation
873  * unit is parsed. Note that the following options are ignored: '-c',
874  * '-emit-ast', '-fsyntax-only' (which is the default), and '-o <output file>'.
875  *
876  * \param num_command_line_args The number of command-line arguments in
877  * \c command_line_args.
878  *
879  * \param unsaved_files the files that have not yet been saved to disk
880  * but may be required for parsing, including the contents of
881  * those files. The contents and name of these files (as specified by
882  * CXUnsavedFile) are copied when necessary, so the client only needs to
883  * guarantee their validity until the call to this function returns.
884  *
885  * \param num_unsaved_files the number of unsaved file entries in \p
886  * unsaved_files.
887  *
888  * \param options A bitmask of options that affects how the translation unit
889  * is managed but not its compilation. This should be a bitwise OR of the
890  * CXTranslationUnit_XXX flags.
891  *
892  * \param[out] out_TU A non-NULL pointer to store the created
893  * \c CXTranslationUnit, describing the parsed code and containing any
894  * diagnostics produced by the compiler.
895  *
896  * \returns Zero on success, otherwise returns an error code.
897  */
899  CXIndex CIdx, const char *source_filename,
900  const char *const *command_line_args, int num_command_line_args,
901  struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
902  unsigned options, CXTranslationUnit *out_TU);
903 
904 /**
905  * Same as clang_parseTranslationUnit2 but requires a full command line
906  * for \c command_line_args including argv[0]. This is useful if the standard
907  * library paths are relative to the binary.
908  */
910  CXIndex CIdx, const char *source_filename,
911  const char *const *command_line_args, int num_command_line_args,
912  struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
913  unsigned options, CXTranslationUnit *out_TU);
914 
915 /**
916  * Flags that control how translation units are saved.
917  *
918  * The enumerators in this enumeration type are meant to be bitwise
919  * ORed together to specify which options should be used when
920  * saving the translation unit.
921  */
923  /**
924  * Used to indicate that no special saving options are needed.
925  */
927 };
928 
929 /**
930  * Returns the set of flags that is suitable for saving a translation
931  * unit.
932  *
933  * The set of flags returned provide options for
934  * \c clang_saveTranslationUnit() by default. The returned flag
935  * set contains an unspecified set of options that save translation units with
936  * the most commonly-requested data.
937  */
939 
940 /**
941  * Describes the kind of error that occurred (if any) in a call to
942  * \c clang_saveTranslationUnit().
943  */
945  /**
946  * Indicates that no error occurred while saving a translation unit.
947  */
949 
950  /**
951  * Indicates that an unknown error occurred while attempting to save
952  * the file.
953  *
954  * This error typically indicates that file I/O failed when attempting to
955  * write the file.
956  */
958 
959  /**
960  * Indicates that errors during translation prevented this attempt
961  * to save the translation unit.
962  *
963  * Errors that prevent the translation unit from being saved can be
964  * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic().
965  */
967 
968  /**
969  * Indicates that the translation unit to be saved was somehow
970  * invalid (e.g., NULL).
971  */
973 };
974 
975 /**
976  * Saves a translation unit into a serialized representation of
977  * that translation unit on disk.
978  *
979  * Any translation unit that was parsed without error can be saved
980  * into a file. The translation unit can then be deserialized into a
981  * new \c CXTranslationUnit with \c clang_createTranslationUnit() or,
982  * if it is an incomplete translation unit that corresponds to a
983  * header, used as a precompiled header when parsing other translation
984  * units.
985  *
986  * \param TU The translation unit to save.
987  *
988  * \param FileName The file to which the translation unit will be saved.
989  *
990  * \param options A bitmask of options that affects how the translation unit
991  * is saved. This should be a bitwise OR of the
992  * CXSaveTranslationUnit_XXX flags.
993  *
994  * \returns A value that will match one of the enumerators of the CXSaveError
995  * enumeration. Zero (CXSaveError_None) indicates that the translation unit was
996  * saved successfully, while a non-zero value indicates that a problem occurred.
997  */
999  const char *FileName,
1000  unsigned options);
1001 
1002 /**
1003  * Suspend a translation unit in order to free memory associated with it.
1004  *
1005  * A suspended translation unit uses significantly less memory but on the other
1006  * side does not support any other calls than \c clang_reparseTranslationUnit
1007  * to resume it or \c clang_disposeTranslationUnit to dispose it completely.
1008  */
1010 
1011 /**
1012  * Destroy the specified CXTranslationUnit object.
1013  */
1015 
1016 /**
1017  * Flags that control the reparsing of translation units.
1018  *
1019  * The enumerators in this enumeration type are meant to be bitwise
1020  * ORed together to specify which options should be used when
1021  * reparsing the translation unit.
1022  */
1024  /**
1025  * Used to indicate that no special reparsing options are needed.
1026  */
1027  CXReparse_None = 0x0
1028 };
1029 
1030 /**
1031  * Returns the set of flags that is suitable for reparsing a translation
1032  * unit.
1033  *
1034  * The set of flags returned provide options for
1035  * \c clang_reparseTranslationUnit() by default. The returned flag
1036  * set contains an unspecified set of optimizations geared toward common uses
1037  * of reparsing. The set of optimizations enabled may change from one version
1038  * to the next.
1039  */
1041 
1042 /**
1043  * Reparse the source files that produced this translation unit.
1044  *
1045  * This routine can be used to re-parse the source files that originally
1046  * created the given translation unit, for example because those source files
1047  * have changed (either on disk or as passed via \p unsaved_files). The
1048  * source code will be reparsed with the same command-line options as it
1049  * was originally parsed.
1050  *
1051  * Reparsing a translation unit invalidates all cursors and source locations
1052  * that refer into that translation unit. This makes reparsing a translation
1053  * unit semantically equivalent to destroying the translation unit and then
1054  * creating a new translation unit with the same command-line arguments.
1055  * However, it may be more efficient to reparse a translation
1056  * unit using this routine.
1057  *
1058  * \param TU The translation unit whose contents will be re-parsed. The
1059  * translation unit must originally have been built with
1060  * \c clang_createTranslationUnitFromSourceFile().
1061  *
1062  * \param num_unsaved_files The number of unsaved file entries in \p
1063  * unsaved_files.
1064  *
1065  * \param unsaved_files The files that have not yet been saved to disk
1066  * but may be required for parsing, including the contents of
1067  * those files. The contents and name of these files (as specified by
1068  * CXUnsavedFile) are copied when necessary, so the client only needs to
1069  * guarantee their validity until the call to this function returns.
1070  *
1071  * \param options A bitset of options composed of the flags in CXReparse_Flags.
1072  * The function \c clang_defaultReparseOptions() produces a default set of
1073  * options recommended for most uses, based on the translation unit.
1074  *
1075  * \returns 0 if the sources could be reparsed. A non-zero error code will be
1076  * returned if reparsing was impossible, such that the translation unit is
1077  * invalid. In such cases, the only valid call for \c TU is
1078  * \c clang_disposeTranslationUnit(TU). The error codes returned by this
1079  * routine are described by the \c CXErrorCode enum.
1080  */
1081 CINDEX_LINKAGE int
1082 clang_reparseTranslationUnit(CXTranslationUnit TU, unsigned num_unsaved_files,
1083  struct CXUnsavedFile *unsaved_files,
1084  unsigned options);
1085 
1086 /**
1087  * Categorizes how memory is being used by a translation unit.
1088  */
1107 
1110 };
1111 
1112 /**
1113  * Returns the human-readable null-terminated C string that represents
1114  * the name of the memory category. This string should never be freed.
1115  */
1118 
1119 typedef struct CXTUResourceUsageEntry {
1120  /* The memory usage category. */
1122  /* Amount of resources used.
1123  The units will depend on the resource kind. */
1124  unsigned long amount;
1126 
1127 /**
1128  * The memory usage of a CXTranslationUnit, broken into categories.
1129  */
1130 typedef struct CXTUResourceUsage {
1131  /* Private data member, used for queries. */
1132  void *data;
1133 
1134  /* The number of entries in the 'entries' array. */
1135  unsigned numEntries;
1136 
1137  /* An array of key-value pairs, representing the breakdown of memory
1138  usage. */
1140 
1142 
1143 /**
1144  * Return the memory usage of a translation unit. This object
1145  * should be released with clang_disposeCXTUResourceUsage().
1146  */
1149 
1151 
1152 /**
1153  * Get target information for this translation unit.
1154  *
1155  * The CXTargetInfo object cannot outlive the CXTranslationUnit object.
1156  */
1159 
1160 /**
1161  * Destroy the CXTargetInfo object.
1162  */
1164 
1165 /**
1166  * Get the normalized target triple as a string.
1167  *
1168  * Returns the empty string in case of any error.
1169  */
1171 
1172 /**
1173  * Get the pointer width of the target in bits.
1174  *
1175  * Returns -1 in case of error.
1176  */
1178 
1179 /**
1180  * @}
1181  */
1182 
1183 /**
1184  * Describes the kind of entity that a cursor refers to.
1185  */
1187  /* Declarations */
1188  /**
1189  * A declaration whose specific kind is not exposed via this
1190  * interface.
1191  *
1192  * Unexposed declarations have the same operations as any other kind
1193  * of declaration; one can extract their location information,
1194  * spelling, find their definitions, etc. However, the specific kind
1195  * of the declaration is not reported.
1196  */
1198  /** A C or C++ struct. */
1200  /** A C or C++ union. */
1202  /** A C++ class. */
1204  /** An enumeration. */
1206  /**
1207  * A field (in C) or non-static data member (in C++) in a
1208  * struct, union, or C++ class.
1209  */
1211  /** An enumerator constant. */
1213  /** A function. */
1215  /** A variable. */
1217  /** A function or method parameter. */
1219  /** An Objective-C \@interface. */
1221  /** An Objective-C \@interface for a category. */
1223  /** An Objective-C \@protocol declaration. */
1225  /** An Objective-C \@property declaration. */
1227  /** An Objective-C instance variable. */
1229  /** An Objective-C instance method. */
1231  /** An Objective-C class method. */
1233  /** An Objective-C \@implementation. */
1235  /** An Objective-C \@implementation for a category. */
1237  /** A typedef. */
1239  /** A C++ class method. */
1241  /** A C++ namespace. */
1243  /** A linkage specification, e.g. 'extern "C"'. */
1245  /** A C++ constructor. */
1247  /** A C++ destructor. */
1249  /** A C++ conversion function. */
1251  /** A C++ template type parameter. */
1253  /** A C++ non-type template parameter. */
1255  /** A C++ template template parameter. */
1257  /** A C++ function template. */
1259  /** A C++ class template. */
1261  /** A C++ class template partial specialization. */
1263  /** A C++ namespace alias declaration. */
1265  /** A C++ using directive. */
1267  /** A C++ using declaration. */
1269  /** A C++ alias declaration */
1271  /** An Objective-C \@synthesize definition. */
1273  /** An Objective-C \@dynamic definition. */
1275  /** An access specifier. */
1277 
1280 
1281  /* References */
1282  CXCursor_FirstRef = 40, /* Decl references */
1286  /**
1287  * A reference to a type declaration.
1288  *
1289  * A type reference occurs anywhere where a type is named but not
1290  * declared. For example, given:
1291  *
1292  * \code
1293  * typedef unsigned size_type;
1294  * size_type size;
1295  * \endcode
1296  *
1297  * The typedef is a declaration of size_type (CXCursor_TypedefDecl),
1298  * while the type of the variable "size" is referenced. The cursor
1299  * referenced by the type of size is the typedef for size_type.
1300  */
1303  /**
1304  * A reference to a class template, function template, template
1305  * template parameter, or class template partial specialization.
1306  */
1308  /**
1309  * A reference to a namespace or namespace alias.
1310  */
1312  /**
1313  * A reference to a member of a struct, union, or class that occurs in
1314  * some non-expression context, e.g., a designated initializer.
1315  */
1317  /**
1318  * A reference to a labeled statement.
1319  *
1320  * This cursor kind is used to describe the jump to "start_over" in the
1321  * goto statement in the following example:
1322  *
1323  * \code
1324  * start_over:
1325  * ++counter;
1326  *
1327  * goto start_over;
1328  * \endcode
1329  *
1330  * A label reference cursor refers to a label statement.
1331  */
1333 
1334  /**
1335  * A reference to a set of overloaded functions or function templates
1336  * that has not yet been resolved to a specific function or function template.
1337  *
1338  * An overloaded declaration reference cursor occurs in C++ templates where
1339  * a dependent name refers to a function. For example:
1340  *
1341  * \code
1342  * template<typename T> void swap(T&, T&);
1343  *
1344  * struct X { ... };
1345  * void swap(X&, X&);
1346  *
1347  * template<typename T>
1348  * void reverse(T* first, T* last) {
1349  * while (first < last - 1) {
1350  * swap(*first, *--last);
1351  * ++first;
1352  * }
1353  * }
1354  *
1355  * struct Y { };
1356  * void swap(Y&, Y&);
1357  * \endcode
1358  *
1359  * Here, the identifier "swap" is associated with an overloaded declaration
1360  * reference. In the template definition, "swap" refers to either of the two
1361  * "swap" functions declared above, so both results will be available. At
1362  * instantiation time, "swap" may also refer to other functions found via
1363  * argument-dependent lookup (e.g., the "swap" function at the end of the
1364  * example).
1365  *
1366  * The functions \c clang_getNumOverloadedDecls() and
1367  * \c clang_getOverloadedDecl() can be used to retrieve the definitions
1368  * referenced by this cursor.
1369  */
1371 
1372  /**
1373  * A reference to a variable that occurs in some non-expression
1374  * context, e.g., a C++ lambda capture list.
1375  */
1377 
1379 
1380  /* Error conditions */
1387 
1388  /* Expressions */
1390 
1391  /**
1392  * An expression whose specific kind is not exposed via this
1393  * interface.
1394  *
1395  * Unexposed expressions have the same operations as any other kind
1396  * of expression; one can extract their location information,
1397  * spelling, children, etc. However, the specific kind of the
1398  * expression is not reported.
1399  */
1401 
1402  /**
1403  * An expression that refers to some value declaration, such
1404  * as a function, variable, or enumerator.
1405  */
1407 
1408  /**
1409  * An expression that refers to a member of a struct, union,
1410  * class, Objective-C class, etc.
1411  */
1413 
1414  /** An expression that calls a function. */
1416 
1417  /** An expression that sends a message to an Objective-C
1418  object or class. */
1420 
1421  /** An expression that represents a block literal. */
1423 
1424  /** An integer literal.
1425  */
1427 
1428  /** A floating point number literal.
1429  */
1431 
1432  /** An imaginary number literal.
1433  */
1435 
1436  /** A string literal.
1437  */
1439 
1440  /** A character literal.
1441  */
1443 
1444  /** A parenthesized expression, e.g. "(1)".
1445  *
1446  * This AST node is only formed if full location information is requested.
1447  */
1449 
1450  /** This represents the unary-expression's (except sizeof and
1451  * alignof).
1452  */
1454 
1455  /** [C99 6.5.2.1] Array Subscripting.
1456  */
1458 
1459  /** A builtin binary operation expression such as "x + y" or
1460  * "x <= y".
1461  */
1463 
1464  /** Compound assignment such as "+=".
1465  */
1467 
1468  /** The ?: ternary operator.
1469  */
1471 
1472  /** An explicit cast in C (C99 6.5.4) or a C-style cast in C++
1473  * (C++ [expr.cast]), which uses the syntax (Type)expr.
1474  *
1475  * For example: (int)f.
1476  */
1478 
1479  /** [C99 6.5.2.5]
1480  */
1482 
1483  /** Describes an C or C++ initializer list.
1484  */
1486 
1487  /** The GNU address of label extension, representing &&label.
1488  */
1490 
1491  /** This is the GNU Statement Expression extension: ({int X=4; X;})
1492  */
1494 
1495  /** Represents a C11 generic selection.
1496  */
1498 
1499  /** Implements the GNU __null extension, which is a name for a null
1500  * pointer constant that has integral type (e.g., int or long) and is the same
1501  * size and alignment as a pointer.
1502  *
1503  * The __null extension is typically only used by system headers, which define
1504  * NULL as __null in C++ rather than using 0 (which is an integer that may not
1505  * match the size of a pointer).
1506  */
1508 
1509  /** C++'s static_cast<> expression.
1510  */
1512 
1513  /** C++'s dynamic_cast<> expression.
1514  */
1516 
1517  /** C++'s reinterpret_cast<> expression.
1518  */
1520 
1521  /** C++'s const_cast<> expression.
1522  */
1524 
1525  /** Represents an explicit C++ type conversion that uses "functional"
1526  * notion (C++ [expr.type.conv]).
1527  *
1528  * Example:
1529  * \code
1530  * x = int(0.5);
1531  * \endcode
1532  */
1534 
1535  /** A C++ typeid expression (C++ [expr.typeid]).
1536  */
1538 
1539  /** [C++ 2.13.5] C++ Boolean Literal.
1540  */
1542 
1543  /** [C++0x 2.14.7] C++ Pointer Literal.
1544  */
1546 
1547  /** Represents the "this" expression in C++
1548  */
1550 
1551  /** [C++ 15] C++ Throw Expression.
1552  *
1553  * This handles 'throw' and 'throw' assignment-expression. When
1554  * assignment-expression isn't present, Op will be null.
1555  */
1557 
1558  /** A new expression for memory allocation and constructor calls, e.g:
1559  * "new CXXNewExpr(foo)".
1560  */
1562 
1563  /** A delete expression for memory deallocation and destructor calls,
1564  * e.g. "delete[] pArray".
1565  */
1567 
1568  /** A unary expression. (noexcept, sizeof, or other traits)
1569  */
1571 
1572  /** An Objective-C string literal i.e. @"foo".
1573  */
1575 
1576  /** An Objective-C \@encode expression.
1577  */
1579 
1580  /** An Objective-C \@selector expression.
1581  */
1583 
1584  /** An Objective-C \@protocol expression.
1585  */
1587 
1588  /** An Objective-C "bridged" cast expression, which casts between
1589  * Objective-C pointers and C pointers, transferring ownership in the process.
1590  *
1591  * \code
1592  * NSString *str = (__bridge_transfer NSString *)CFCreateString();
1593  * \endcode
1594  */
1596 
1597  /** Represents a C++0x pack expansion that produces a sequence of
1598  * expressions.
1599  *
1600  * A pack expansion expression contains a pattern (which itself is an
1601  * expression) followed by an ellipsis. For example:
1602  *
1603  * \code
1604  * template<typename F, typename ...Types>
1605  * void forward(F f, Types &&...args) {
1606  * f(static_cast<Types&&>(args)...);
1607  * }
1608  * \endcode
1609  */
1611 
1612  /** Represents an expression that computes the length of a parameter
1613  * pack.
1614  *
1615  * \code
1616  * template<typename ...Types>
1617  * struct count {
1618  * static const unsigned value = sizeof...(Types);
1619  * };
1620  * \endcode
1621  */
1623 
1624  /* Represents a C++ lambda expression that produces a local function
1625  * object.
1626  *
1627  * \code
1628  * void abssort(float *x, unsigned N) {
1629  * std::sort(x, x + N,
1630  * [](float a, float b) {
1631  * return std::abs(a) < std::abs(b);
1632  * });
1633  * }
1634  * \endcode
1635  */
1637 
1638  /** Objective-c Boolean Literal.
1639  */
1641 
1642  /** Represents the "self" expression in an Objective-C method.
1643  */
1645 
1646  /** OpenMP 5.0 [2.1.5, Array Section].
1647  * OpenACC 3.3 [2.7.1, Data Specification for Data Clauses (Sub Arrays)]
1648  */
1650 
1651  /** Represents an @available(...) check.
1652  */
1654 
1655  /**
1656  * Fixed point literal
1657  */
1659 
1660  /** OpenMP 5.0 [2.1.4, Array Shaping].
1661  */
1663 
1664  /**
1665  * OpenMP 5.0 [2.1.6 Iterators]
1666  */
1668 
1669  /** OpenCL's addrspace_cast<> expression.
1670  */
1672 
1673  /**
1674  * Expression that references a C++20 concept.
1675  */
1677 
1678  /**
1679  * Expression that references a C++20 requires expression.
1680  */
1682 
1683  /**
1684  * Expression that references a C++20 parenthesized list aggregate
1685  * initializer.
1686  */
1688 
1689  /**
1690  * Represents a C++26 pack indexing expression.
1691  */
1693 
1695 
1696  /* Statements */
1698  /**
1699  * A statement whose specific kind is not exposed via this
1700  * interface.
1701  *
1702  * Unexposed statements have the same operations as any other kind of
1703  * statement; one can extract their location information, spelling,
1704  * children, etc. However, the specific kind of the statement is not
1705  * reported.
1706  */
1708 
1709  /** A labelled statement in a function.
1710  *
1711  * This cursor kind is used to describe the "start_over:" label statement in
1712  * the following example:
1713  *
1714  * \code
1715  * start_over:
1716  * ++counter;
1717  * \endcode
1718  *
1719  */
1721 
1722  /** A group of statements like { stmt stmt }.
1723  *
1724  * This cursor kind is used to describe compound statements, e.g. function
1725  * bodies.
1726  */
1728 
1729  /** A case statement.
1730  */
1732 
1733  /** A default statement.
1734  */
1736 
1737  /** An if statement
1738  */
1740 
1741  /** A switch statement.
1742  */
1744 
1745  /** A while statement.
1746  */
1748 
1749  /** A do statement.
1750  */
1752 
1753  /** A for statement.
1754  */
1756 
1757  /** A goto statement.
1758  */
1760 
1761  /** An indirect goto statement.
1762  */
1764 
1765  /** A continue statement.
1766  */
1768 
1769  /** A break statement.
1770  */
1772 
1773  /** A return statement.
1774  */
1776 
1777  /** A GCC inline assembly statement extension.
1778  */
1781 
1782  /** Objective-C's overall \@try-\@catch-\@finally statement.
1783  */
1785 
1786  /** Objective-C's \@catch statement.
1787  */
1789 
1790  /** Objective-C's \@finally statement.
1791  */
1793 
1794  /** Objective-C's \@throw statement.
1795  */
1797 
1798  /** Objective-C's \@synchronized statement.
1799  */
1801 
1802  /** Objective-C's autorelease pool statement.
1803  */
1805 
1806  /** Objective-C's collection statement.
1807  */
1809 
1810  /** C++'s catch statement.
1811  */
1813 
1814  /** C++'s try statement.
1815  */
1817 
1818  /** C++'s for (* : *) statement.
1819  */
1821 
1822  /** Windows Structured Exception Handling's try statement.
1823  */
1825 
1826  /** Windows Structured Exception Handling's except statement.
1827  */
1829 
1830  /** Windows Structured Exception Handling's finally statement.
1831  */
1833 
1834  /** A MS inline assembly statement extension.
1835  */
1837 
1838  /** The null statement ";": C99 6.8.3p3.
1839  *
1840  * This cursor kind is used to describe the null statement.
1841  */
1843 
1844  /** Adaptor class for mixing declarations with statements and
1845  * expressions.
1846  */
1848 
1849  /** OpenMP parallel directive.
1850  */
1852 
1853  /** OpenMP SIMD directive.
1854  */
1856 
1857  /** OpenMP for directive.
1858  */
1860 
1861  /** OpenMP sections directive.
1862  */
1864 
1865  /** OpenMP section directive.
1866  */
1868 
1869  /** OpenMP single directive.
1870  */
1872 
1873  /** OpenMP parallel for directive.
1874  */
1876 
1877  /** OpenMP parallel sections directive.
1878  */
1880 
1881  /** OpenMP task directive.
1882  */
1884 
1885  /** OpenMP master directive.
1886  */
1888 
1889  /** OpenMP critical directive.
1890  */
1892 
1893  /** OpenMP taskyield directive.
1894  */
1896 
1897  /** OpenMP barrier directive.
1898  */
1900 
1901  /** OpenMP taskwait directive.
1902  */
1904 
1905  /** OpenMP flush directive.
1906  */
1908 
1909  /** Windows Structured Exception Handling's leave statement.
1910  */
1912 
1913  /** OpenMP ordered directive.
1914  */
1916 
1917  /** OpenMP atomic directive.
1918  */
1920 
1921  /** OpenMP for SIMD directive.
1922  */
1924 
1925  /** OpenMP parallel for SIMD directive.
1926  */
1928 
1929  /** OpenMP target directive.
1930  */
1932 
1933  /** OpenMP teams directive.
1934  */
1936 
1937  /** OpenMP taskgroup directive.
1938  */
1940 
1941  /** OpenMP cancellation point directive.
1942  */
1944 
1945  /** OpenMP cancel directive.
1946  */
1948 
1949  /** OpenMP target data directive.
1950  */
1952 
1953  /** OpenMP taskloop directive.
1954  */
1956 
1957  /** OpenMP taskloop simd directive.
1958  */
1960 
1961  /** OpenMP distribute directive.
1962  */
1964 
1965  /** OpenMP target enter data directive.
1966  */
1968 
1969  /** OpenMP target exit data directive.
1970  */
1972 
1973  /** OpenMP target parallel directive.
1974  */
1976 
1977  /** OpenMP target parallel for directive.
1978  */
1980 
1981  /** OpenMP target update directive.
1982  */
1984 
1985  /** OpenMP distribute parallel for directive.
1986  */
1988 
1989  /** OpenMP distribute parallel for simd directive.
1990  */
1992 
1993  /** OpenMP distribute simd directive.
1994  */
1996 
1997  /** OpenMP target parallel for simd directive.
1998  */
2000 
2001  /** OpenMP target simd directive.
2002  */
2004 
2005  /** OpenMP teams distribute directive.
2006  */
2008 
2009  /** OpenMP teams distribute simd directive.
2010  */
2012 
2013  /** OpenMP teams distribute parallel for simd directive.
2014  */
2016 
2017  /** OpenMP teams distribute parallel for directive.
2018  */
2020 
2021  /** OpenMP target teams directive.
2022  */
2024 
2025  /** OpenMP target teams distribute directive.
2026  */
2028 
2029  /** OpenMP target teams distribute parallel for directive.
2030  */
2032 
2033  /** OpenMP target teams distribute parallel for simd directive.
2034  */
2036 
2037  /** OpenMP target teams distribute simd directive.
2038  */
2040 
2041  /** C++2a std::bit_cast expression.
2042  */
2044 
2045  /** OpenMP master taskloop directive.
2046  */
2048 
2049  /** OpenMP parallel master taskloop directive.
2050  */
2052 
2053  /** OpenMP master taskloop simd directive.
2054  */
2056 
2057  /** OpenMP parallel master taskloop simd directive.
2058  */
2060 
2061  /** OpenMP parallel master directive.
2062  */
2064 
2065  /** OpenMP depobj directive.
2066  */
2068 
2069  /** OpenMP scan directive.
2070  */
2072 
2073  /** OpenMP tile directive.
2074  */
2076 
2077  /** OpenMP canonical loop.
2078  */
2080 
2081  /** OpenMP interop directive.
2082  */
2084 
2085  /** OpenMP dispatch directive.
2086  */
2088 
2089  /** OpenMP masked directive.
2090  */
2092 
2093  /** OpenMP unroll directive.
2094  */
2096 
2097  /** OpenMP metadirective directive.
2098  */
2100 
2101  /** OpenMP loop directive.
2102  */
2104 
2105  /** OpenMP teams loop directive.
2106  */
2108 
2109  /** OpenMP target teams loop directive.
2110  */
2112 
2113  /** OpenMP parallel loop directive.
2114  */
2116 
2117  /** OpenMP target parallel loop directive.
2118  */
2120 
2121  /** OpenMP parallel masked directive.
2122  */
2124 
2125  /** OpenMP masked taskloop directive.
2126  */
2128 
2129  /** OpenMP masked taskloop simd directive.
2130  */
2132 
2133  /** OpenMP parallel masked taskloop directive.
2134  */
2136 
2137  /** OpenMP parallel masked taskloop simd directive.
2138  */
2140 
2141  /** OpenMP error directive.
2142  */
2144 
2145  /** OpenMP scope directive.
2146  */
2148 
2149  /** OpenACC Compute Construct.
2150  */
2152 
2154 
2155  /**
2156  * Cursor that represents the translation unit itself.
2157  *
2158  * The translation unit cursor exists primarily to act as the root
2159  * cursor for traversing the contents of a translation unit.
2160  */
2162 
2163  /* Attributes */
2165  /**
2166  * An attribute whose specific kind is not exposed via this
2167  * interface.
2168  */
2170 
2213 
2214  /* Preprocessing */
2222 
2223  /* Extra Declarations */
2224  /**
2225  * A module import declaration.
2226  */
2229  /**
2230  * A static_assert or _Static_assert node
2231  */
2233  /**
2234  * a friend declaration.
2235  */
2237  /**
2238  * a concept declaration.
2239  */
2241 
2244 
2245  /**
2246  * A code completion overload candidate.
2247  */
2249 };
2250 
2251 /**
2252  * A cursor representing some element in the abstract syntax tree for
2253  * a translation unit.
2254  *
2255  * The cursor abstraction unifies the different kinds of entities in a
2256  * program--declaration, statements, expressions, references to declarations,
2257  * etc.--under a single "cursor" abstraction with a common set of operations.
2258  * Common operation for a cursor include: getting the physical location in
2259  * a source file where the cursor points, getting the name associated with a
2260  * cursor, and retrieving cursors for any child nodes of a particular cursor.
2261  *
2262  * Cursors can be produced in two specific ways.
2263  * clang_getTranslationUnitCursor() produces a cursor for a translation unit,
2264  * from which one can use clang_visitChildren() to explore the rest of the
2265  * translation unit. clang_getCursor() maps from a physical source location
2266  * to the entity that resides at that location, allowing one to map from the
2267  * source code into the AST.
2268  */
2269 typedef struct {
2270  enum CXCursorKind kind;
2271  int xdata;
2272  const void *data[3];
2273 } CXCursor;
2274 
2275 /**
2276  * \defgroup CINDEX_CURSOR_MANIP Cursor manipulations
2277  *
2278  * @{
2279  */
2280 
2281 /**
2282  * Retrieve the NULL cursor, which represents no entity.
2283  */
2285 
2286 /**
2287  * Retrieve the cursor that represents the given translation unit.
2288  *
2289  * The translation unit cursor can be used to start traversing the
2290  * various declarations within the given translation unit.
2291  */
2293 
2294 /**
2295  * Determine whether two cursors are equivalent.
2296  */
2298 
2299 /**
2300  * Returns non-zero if \p cursor is null.
2301  */
2303 
2304 /**
2305  * Compute a hash value for the given cursor.
2306  */
2308 
2309 /**
2310  * Retrieve the kind of the given cursor.
2311  */
2313 
2314 /**
2315  * Determine whether the given cursor kind represents a declaration.
2316  */
2318 
2319 /**
2320  * Determine whether the given declaration is invalid.
2321  *
2322  * A declaration is invalid if it could not be parsed successfully.
2323  *
2324  * \returns non-zero if the cursor represents a declaration and it is
2325  * invalid, otherwise NULL.
2326  */
2328 
2329 /**
2330  * Determine whether the given cursor kind represents a simple
2331  * reference.
2332  *
2333  * Note that other kinds of cursors (such as expressions) can also refer to
2334  * other cursors. Use clang_getCursorReferenced() to determine whether a
2335  * particular cursor refers to another entity.
2336  */
2338 
2339 /**
2340  * Determine whether the given cursor kind represents an expression.
2341  */
2343 
2344 /**
2345  * Determine whether the given cursor kind represents a statement.
2346  */
2348 
2349 /**
2350  * Determine whether the given cursor kind represents an attribute.
2351  */
2353 
2354 /**
2355  * Determine whether the given cursor has any attributes.
2356  */
2358 
2359 /**
2360  * Determine whether the given cursor kind represents an invalid
2361  * cursor.
2362  */
2364 
2365 /**
2366  * Determine whether the given cursor kind represents a translation
2367  * unit.
2368  */
2370 
2371 /***
2372  * Determine whether the given cursor represents a preprocessing
2373  * element, such as a preprocessor directive or macro instantiation.
2374  */
2376 
2377 /***
2378  * Determine whether the given cursor represents a currently
2379  * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
2380  */
2382 
2383 /**
2384  * Describe the linkage of the entity referred to by a cursor.
2385  */
2387  /** This value indicates that no linkage information is available
2388  * for a provided CXCursor. */
2390  /**
2391  * This is the linkage for variables, parameters, and so on that
2392  * have automatic storage. This covers normal (non-extern) local variables.
2393  */
2395  /** This is the linkage for static variables and static functions. */
2397  /** This is the linkage for entities with external linkage that live
2398  * in C++ anonymous namespaces.*/
2400  /** This is the linkage for entities with true, external linkage. */
2402 };
2403 
2404 /**
2405  * Determine the linkage of the entity referred to by a given cursor.
2406  */
2408 
2410  /** This value indicates that no visibility information is available
2411  * for a provided CXCursor. */
2413 
2414  /** Symbol not seen by the linker. */
2416  /** Symbol seen by the linker but resolves to a symbol inside this object. */
2418  /** Symbol seen by the linker and acts like a normal symbol. */
2420 };
2421 
2422 /**
2423  * Describe the visibility of the entity referred to by a cursor.
2424  *
2425  * This returns the default visibility if not explicitly specified by
2426  * a visibility attribute. The default visibility may be changed by
2427  * commandline arguments.
2428  *
2429  * \param cursor The cursor to query.
2430  *
2431  * \returns The visibility of the cursor.
2432  */
2434 
2435 /**
2436  * Determine the availability of the entity that this cursor refers to,
2437  * taking the current target platform into account.
2438  *
2439  * \param cursor The cursor to query.
2440  *
2441  * \returns The availability of the cursor.
2442  */
2445 
2446 /**
2447  * Describes the availability of a given entity on a particular platform, e.g.,
2448  * a particular class might only be available on Mac OS 10.7 or newer.
2449  */
2450 typedef struct CXPlatformAvailability {
2451  /**
2452  * A string that describes the platform for which this structure
2453  * provides availability information.
2454  *
2455  * Possible values are "ios" or "macos".
2456  */
2458  /**
2459  * The version number in which this entity was introduced.
2460  */
2462  /**
2463  * The version number in which this entity was deprecated (but is
2464  * still available).
2465  */
2467  /**
2468  * The version number in which this entity was obsoleted, and therefore
2469  * is no longer available.
2470  */
2472  /**
2473  * Whether the entity is unconditionally unavailable on this platform.
2474  */
2476  /**
2477  * An optional message to provide to a user of this API, e.g., to
2478  * suggest replacement APIs.
2479  */
2482 
2483 /**
2484  * Determine the availability of the entity that this cursor refers to
2485  * on any platforms for which availability information is known.
2486  *
2487  * \param cursor The cursor to query.
2488  *
2489  * \param always_deprecated If non-NULL, will be set to indicate whether the
2490  * entity is deprecated on all platforms.
2491  *
2492  * \param deprecated_message If non-NULL, will be set to the message text
2493  * provided along with the unconditional deprecation of this entity. The client
2494  * is responsible for deallocating this string.
2495  *
2496  * \param always_unavailable If non-NULL, will be set to indicate whether the
2497  * entity is unavailable on all platforms.
2498  *
2499  * \param unavailable_message If non-NULL, will be set to the message text
2500  * provided along with the unconditional unavailability of this entity. The
2501  * client is responsible for deallocating this string.
2502  *
2503  * \param availability If non-NULL, an array of CXPlatformAvailability instances
2504  * that will be populated with platform availability information, up to either
2505  * the number of platforms for which availability information is available (as
2506  * returned by this function) or \c availability_size, whichever is smaller.
2507  *
2508  * \param availability_size The number of elements available in the
2509  * \c availability array.
2510  *
2511  * \returns The number of platforms (N) for which availability information is
2512  * available (which is unrelated to \c availability_size).
2513  *
2514  * Note that the client is responsible for calling
2515  * \c clang_disposeCXPlatformAvailability to free each of the
2516  * platform-availability structures returned. There are
2517  * \c min(N, availability_size) such structures.
2518  */
2520  CXCursor cursor, int *always_deprecated, CXString *deprecated_message,
2521  int *always_unavailable, CXString *unavailable_message,
2522  CXPlatformAvailability *availability, int availability_size);
2523 
2524 /**
2525  * Free the memory associated with a \c CXPlatformAvailability structure.
2526  */
2527 CINDEX_LINKAGE void
2529 
2530 /**
2531  * If cursor refers to a variable declaration and it has initializer returns
2532  * cursor referring to the initializer otherwise return null cursor.
2533  */
2535 
2536 /**
2537  * If cursor refers to a variable declaration that has global storage returns 1.
2538  * If cursor refers to a variable declaration that doesn't have global storage
2539  * returns 0. Otherwise returns -1.
2540  */
2542 
2543 /**
2544  * If cursor refers to a variable declaration that has external storage
2545  * returns 1. If cursor refers to a variable declaration that doesn't have
2546  * external storage returns 0. Otherwise returns -1.
2547  */
2549 
2550 /**
2551  * Describe the "language" of the entity referred to by a cursor.
2552  */
2558 };
2559 
2560 /**
2561  * Determine the "language" of the entity referred to by a given cursor.
2562  */
2564 
2565 /**
2566  * Describe the "thread-local storage (TLS) kind" of the declaration
2567  * referred to by a cursor.
2568  */
2570 
2571 /**
2572  * Determine the "thread-local storage (TLS) kind" of the declaration
2573  * referred to by a cursor.
2574  */
2576 
2577 /**
2578  * Returns the translation unit that a cursor originated from.
2579  */
2581 
2582 /**
2583  * A fast container representing a set of CXCursors.
2584  */
2585 typedef struct CXCursorSetImpl *CXCursorSet;
2586 
2587 /**
2588  * Creates an empty CXCursorSet.
2589  */
2591 
2592 /**
2593  * Disposes a CXCursorSet and releases its associated memory.
2594  */
2596 
2597 /**
2598  * Queries a CXCursorSet to see if it contains a specific CXCursor.
2599  *
2600  * \returns non-zero if the set contains the specified cursor.
2601  */
2603  CXCursor cursor);
2604 
2605 /**
2606  * Inserts a CXCursor into a CXCursorSet.
2607  *
2608  * \returns zero if the CXCursor was already in the set, and non-zero otherwise.
2609  */
2611  CXCursor cursor);
2612 
2613 /**
2614  * Determine the semantic parent of the given cursor.
2615  *
2616  * The semantic parent of a cursor is the cursor that semantically contains
2617  * the given \p cursor. For many declarations, the lexical and semantic parents
2618  * are equivalent (the lexical parent is returned by
2619  * \c clang_getCursorLexicalParent()). They diverge when declarations or
2620  * definitions are provided out-of-line. For example:
2621  *
2622  * \code
2623  * class C {
2624  * void f();
2625  * };
2626  *
2627  * void C::f() { }
2628  * \endcode
2629  *
2630  * In the out-of-line definition of \c C::f, the semantic parent is
2631  * the class \c C, of which this function is a member. The lexical parent is
2632  * the place where the declaration actually occurs in the source code; in this
2633  * case, the definition occurs in the translation unit. In general, the
2634  * lexical parent for a given entity can change without affecting the semantics
2635  * of the program, and the lexical parent of different declarations of the
2636  * same entity may be different. Changing the semantic parent of a declaration,
2637  * on the other hand, can have a major impact on semantics, and redeclarations
2638  * of a particular entity should all have the same semantic context.
2639  *
2640  * In the example above, both declarations of \c C::f have \c C as their
2641  * semantic context, while the lexical context of the first \c C::f is \c C
2642  * and the lexical context of the second \c C::f is the translation unit.
2643  *
2644  * For global declarations, the semantic parent is the translation unit.
2645  */
2647 
2648 /**
2649  * Determine the lexical parent of the given cursor.
2650  *
2651  * The lexical parent of a cursor is the cursor in which the given \p cursor
2652  * was actually written. For many declarations, the lexical and semantic parents
2653  * are equivalent (the semantic parent is returned by
2654  * \c clang_getCursorSemanticParent()). They diverge when declarations or
2655  * definitions are provided out-of-line. For example:
2656  *
2657  * \code
2658  * class C {
2659  * void f();
2660  * };
2661  *
2662  * void C::f() { }
2663  * \endcode
2664  *
2665  * In the out-of-line definition of \c C::f, the semantic parent is
2666  * the class \c C, of which this function is a member. The lexical parent is
2667  * the place where the declaration actually occurs in the source code; in this
2668  * case, the definition occurs in the translation unit. In general, the
2669  * lexical parent for a given entity can change without affecting the semantics
2670  * of the program, and the lexical parent of different declarations of the
2671  * same entity may be different. Changing the semantic parent of a declaration,
2672  * on the other hand, can have a major impact on semantics, and redeclarations
2673  * of a particular entity should all have the same semantic context.
2674  *
2675  * In the example above, both declarations of \c C::f have \c C as their
2676  * semantic context, while the lexical context of the first \c C::f is \c C
2677  * and the lexical context of the second \c C::f is the translation unit.
2678  *
2679  * For declarations written in the global scope, the lexical parent is
2680  * the translation unit.
2681  */
2683 
2684 /**
2685  * Determine the set of methods that are overridden by the given
2686  * method.
2687  *
2688  * In both Objective-C and C++, a method (aka virtual member function,
2689  * in C++) can override a virtual method in a base class. For
2690  * Objective-C, a method is said to override any method in the class's
2691  * base class, its protocols, or its categories' protocols, that has the same
2692  * selector and is of the same kind (class or instance).
2693  * If no such method exists, the search continues to the class's superclass,
2694  * its protocols, and its categories, and so on. A method from an Objective-C
2695  * implementation is considered to override the same methods as its
2696  * corresponding method in the interface.
2697  *
2698  * For C++, a virtual member function overrides any virtual member
2699  * function with the same signature that occurs in its base
2700  * classes. With multiple inheritance, a virtual member function can
2701  * override several virtual member functions coming from different
2702  * base classes.
2703  *
2704  * In all cases, this function determines the immediate overridden
2705  * method, rather than all of the overridden methods. For example, if
2706  * a method is originally declared in a class A, then overridden in B
2707  * (which in inherits from A) and also in C (which inherited from B),
2708  * then the only overridden method returned from this function when
2709  * invoked on C's method will be B's method. The client may then
2710  * invoke this function again, given the previously-found overridden
2711  * methods, to map out the complete method-override set.
2712  *
2713  * \param cursor A cursor representing an Objective-C or C++
2714  * method. This routine will compute the set of methods that this
2715  * method overrides.
2716  *
2717  * \param overridden A pointer whose pointee will be replaced with a
2718  * pointer to an array of cursors, representing the set of overridden
2719  * methods. If there are no overridden methods, the pointee will be
2720  * set to NULL. The pointee must be freed via a call to
2721  * \c clang_disposeOverriddenCursors().
2722  *
2723  * \param num_overridden A pointer to the number of overridden
2724  * functions, will be set to the number of overridden functions in the
2725  * array pointed to by \p overridden.
2726  */
2728  CXCursor **overridden,
2729  unsigned *num_overridden);
2730 
2731 /**
2732  * Free the set of overridden cursors returned by \c
2733  * clang_getOverriddenCursors().
2734  */
2736 
2737 /**
2738  * Retrieve the file that is included by the given inclusion directive
2739  * cursor.
2740  */
2742 
2743 /**
2744  * @}
2745  */
2746 
2747 /**
2748  * \defgroup CINDEX_CURSOR_SOURCE Mapping between cursors and source code
2749  *
2750  * Cursors represent a location within the Abstract Syntax Tree (AST). These
2751  * routines help map between cursors and the physical locations where the
2752  * described entities occur in the source code. The mapping is provided in
2753  * both directions, so one can map from source code to the AST and back.
2754  *
2755  * @{
2756  */
2757 
2758 /**
2759  * Map a source location to the cursor that describes the entity at that
2760  * location in the source code.
2761  *
2762  * clang_getCursor() maps an arbitrary source location within a translation
2763  * unit down to the most specific cursor that describes the entity at that
2764  * location. For example, given an expression \c x + y, invoking
2765  * clang_getCursor() with a source location pointing to "x" will return the
2766  * cursor for "x"; similarly for "y". If the cursor points anywhere between
2767  * "x" or "y" (e.g., on the + or the whitespace around it), clang_getCursor()
2768  * will return a cursor referring to the "+" expression.
2769  *
2770  * \returns a cursor representing the entity at the given source location, or
2771  * a NULL cursor if no such entity can be found.
2772  */
2774 
2775 /**
2776  * Retrieve the physical location of the source constructor referenced
2777  * by the given cursor.
2778  *
2779  * The location of a declaration is typically the location of the name of that
2780  * declaration, where the name of that declaration would occur if it is
2781  * unnamed, or some keyword that introduces that particular declaration.
2782  * The location of a reference is where that reference occurs within the
2783  * source code.
2784  */
2786 
2787 /**
2788  * Retrieve the physical extent of the source construct referenced by
2789  * the given cursor.
2790  *
2791  * The extent of a cursor starts with the file/line/column pointing at the
2792  * first character within the source construct that the cursor refers to and
2793  * ends with the last character within that source construct. For a
2794  * declaration, the extent covers the declaration itself. For a reference,
2795  * the extent covers the location of the reference (e.g., where the referenced
2796  * entity was actually used).
2797  */
2799 
2800 /**
2801  * @}
2802  */
2803 
2804 /**
2805  * \defgroup CINDEX_TYPES Type information for CXCursors
2806  *
2807  * @{
2808  */
2809 
2810 /**
2811  * Describes the kind of type
2812  */
2814  /**
2815  * Represents an invalid type (e.g., where no type is available).
2816  */
2818 
2819  /**
2820  * A type whose specific kind is not exposed via this
2821  * interface.
2822  */
2824 
2825  /* Builtin types */
2867 
2887 
2888  /**
2889  * Represents a type that was referred to using an elaborated type keyword.
2890  *
2891  * E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
2892  */
2894 
2895  /* OpenCL PipeType. */
2897 
2898  /* OpenCL builtin types. */
2939 
2943 
2956 
2957  /* Old aliases for AVC OpenCL extension types. */
2962 
2966 
2967  /* SPIRV builtin types. */
2980 };
2981 
2982 /**
2983  * Describes the calling convention of a function type
2984  */
2997  /* Alias for compatibility with older versions of API. */
3010 
3013 };
3014 
3015 /**
3016  * The type of an element in the abstract syntax tree.
3017  *
3018  */
3019 typedef struct {
3020  enum CXTypeKind kind;
3021  void *data[2];
3022 } CXType;
3023 
3024 /**
3025  * Retrieve the type of a CXCursor (if any).
3026  */
3028 
3029 /**
3030  * Pretty-print the underlying type using the rules of the
3031  * language of the translation unit from which it came.
3032  *
3033  * If the type is invalid, an empty string is returned.
3034  */
3036 
3037 /**
3038  * Retrieve the underlying type of a typedef declaration.
3039  *
3040  * If the cursor does not reference a typedef declaration, an invalid type is
3041  * returned.
3042  */
3044 
3045 /**
3046  * Retrieve the integer type of an enum declaration.
3047  *
3048  * If the cursor does not reference an enum declaration, an invalid type is
3049  * returned.
3050  */
3052 
3053 /**
3054  * Retrieve the integer value of an enum constant declaration as a signed
3055  * long long.
3056  *
3057  * If the cursor does not reference an enum constant declaration, LLONG_MIN is
3058  * returned. Since this is also potentially a valid constant value, the kind of
3059  * the cursor must be verified before calling this function.
3060  */
3062 
3063 /**
3064  * Retrieve the integer value of an enum constant declaration as an unsigned
3065  * long long.
3066  *
3067  * If the cursor does not reference an enum constant declaration, ULLONG_MAX is
3068  * returned. Since this is also potentially a valid constant value, the kind of
3069  * the cursor must be verified before calling this function.
3070  */
3071 CINDEX_LINKAGE unsigned long long
3073 
3074 /**
3075  * Returns non-zero if the cursor specifies a Record member that is a bit-field.
3076  */
3078 
3079 /**
3080  * Retrieve the bit width of a bit-field declaration as an integer.
3081  *
3082  * If the cursor does not reference a bit-field, or if the bit-field's width
3083  * expression cannot be evaluated, -1 is returned.
3084  *
3085  * For example:
3086  * \code
3087  * if (clang_Cursor_isBitField(Cursor)) {
3088  * int Width = clang_getFieldDeclBitWidth(Cursor);
3089  * if (Width != -1) {
3090  * // The bit-field width is not value-dependent.
3091  * }
3092  * }
3093  * \endcode
3094  */
3096 
3097 /**
3098  * Retrieve the number of non-variadic arguments associated with a given
3099  * cursor.
3100  *
3101  * The number of arguments can be determined for calls as well as for
3102  * declarations of functions or methods. For other cursors -1 is returned.
3103  */
3105 
3106 /**
3107  * Retrieve the argument cursor of a function or method.
3108  *
3109  * The argument cursor can be determined for calls as well as for declarations
3110  * of functions or methods. For other cursors and for invalid indices, an
3111  * invalid cursor is returned.
3112  */
3114 
3115 /**
3116  * Describes the kind of a template argument.
3117  *
3118  * See the definition of llvm::clang::TemplateArgument::ArgKind for full
3119  * element descriptions.
3120  */
3131  /* Indicates an error case, preventing the kind from being deduced. */
3133 };
3134 
3135 /**
3136  * Returns the number of template args of a function, struct, or class decl
3137  * representing a template specialization.
3138  *
3139  * If the argument cursor cannot be converted into a template function
3140  * declaration, -1 is returned.
3141  *
3142  * For example, for the following declaration and specialization:
3143  * template <typename T, int kInt, bool kBool>
3144  * void foo() { ... }
3145  *
3146  * template <>
3147  * void foo<float, -7, true>();
3148  *
3149  * The value 3 would be returned from this call.
3150  */
3152 
3153 /**
3154  * Retrieve the kind of the I'th template argument of the CXCursor C.
3155  *
3156  * If the argument CXCursor does not represent a FunctionDecl, StructDecl, or
3157  * ClassTemplatePartialSpecialization, an invalid template argument kind is
3158  * returned.
3159  *
3160  * For example, for the following declaration and specialization:
3161  * template <typename T, int kInt, bool kBool>
3162  * void foo() { ... }
3163  *
3164  * template <>
3165  * void foo<float, -7, true>();
3166  *
3167  * For I = 0, 1, and 2, Type, Integral, and Integral will be returned,
3168  * respectively.
3169  */
3172 
3173 /**
3174  * Retrieve a CXType representing the type of a TemplateArgument of a
3175  * function decl representing a template specialization.
3176  *
3177  * If the argument CXCursor does not represent a FunctionDecl, StructDecl,
3178  * ClassDecl or ClassTemplatePartialSpecialization whose I'th template argument
3179  * has a kind of CXTemplateArgKind_Integral, an invalid type is returned.
3180  *
3181  * For example, for the following declaration and specialization:
3182  * template <typename T, int kInt, bool kBool>
3183  * void foo() { ... }
3184  *
3185  * template <>
3186  * void foo<float, -7, true>();
3187  *
3188  * If called with I = 0, "float", will be returned.
3189  * Invalid types will be returned for I == 1 or 2.
3190  */
3192  unsigned I);
3193 
3194 /**
3195  * Retrieve the value of an Integral TemplateArgument (of a function
3196  * decl representing a template specialization) as a signed long long.
3197  *
3198  * It is undefined to call this function on a CXCursor that does not represent a
3199  * FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization
3200  * whose I'th template argument is not an integral value.
3201  *
3202  * For example, for the following declaration and specialization:
3203  * template <typename T, int kInt, bool kBool>
3204  * void foo() { ... }
3205  *
3206  * template <>
3207  * void foo<float, -7, true>();
3208  *
3209  * If called with I = 1 or 2, -7 or true will be returned, respectively.
3210  * For I == 0, this function's behavior is undefined.
3211  */
3213  unsigned I);
3214 
3215 /**
3216  * Retrieve the value of an Integral TemplateArgument (of a function
3217  * decl representing a template specialization) as an unsigned long long.
3218  *
3219  * It is undefined to call this function on a CXCursor that does not represent a
3220  * FunctionDecl, StructDecl, ClassDecl or ClassTemplatePartialSpecialization or
3221  * whose I'th template argument is not an integral value.
3222  *
3223  * For example, for the following declaration and specialization:
3224  * template <typename T, int kInt, bool kBool>
3225  * void foo() { ... }
3226  *
3227  * template <>
3228  * void foo<float, 2147483649, true>();
3229  *
3230  * If called with I = 1 or 2, 2147483649 or true will be returned, respectively.
3231  * For I == 0, this function's behavior is undefined.
3232  */
3233 CINDEX_LINKAGE unsigned long long
3235 
3236 /**
3237  * Determine whether two CXTypes represent the same type.
3238  *
3239  * \returns non-zero if the CXTypes represent the same type and
3240  * zero otherwise.
3241  */
3243 
3244 /**
3245  * Return the canonical type for a CXType.
3246  *
3247  * Clang's type system explicitly models typedefs and all the ways
3248  * a specific type can be represented. The canonical type is the underlying
3249  * type with all the "sugar" removed. For example, if 'T' is a typedef
3250  * for 'int', the canonical type for 'T' would be 'int'.
3251  */
3253 
3254 /**
3255  * Determine whether a CXType has the "const" qualifier set,
3256  * without looking through typedefs that may have added "const" at a
3257  * different level.
3258  */
3260 
3261 /**
3262  * Determine whether a CXCursor that is a macro, is
3263  * function like.
3264  */
3266 
3267 /**
3268  * Determine whether a CXCursor that is a macro, is a
3269  * builtin one.
3270  */
3272 
3273 /**
3274  * Determine whether a CXCursor that is a function declaration, is an
3275  * inline declaration.
3276  */
3278 
3279 /**
3280  * Determine whether a CXType has the "volatile" qualifier set,
3281  * without looking through typedefs that may have added "volatile" at
3282  * a different level.
3283  */
3285 
3286 /**
3287  * Determine whether a CXType has the "restrict" qualifier set,
3288  * without looking through typedefs that may have added "restrict" at a
3289  * different level.
3290  */
3292 
3293 /**
3294  * Returns the address space of the given type.
3295  */
3297 
3298 /**
3299  * Returns the typedef name of the given type.
3300  */
3302 
3303 /**
3304  * For pointer types, returns the type of the pointee.
3305  */
3307 
3308 /**
3309  * Retrieve the unqualified variant of the given type, removing as
3310  * little sugar as possible.
3311  *
3312  * For example, given the following series of typedefs:
3313  *
3314  * \code
3315  * typedef int Integer;
3316  * typedef const Integer CInteger;
3317  * typedef CInteger DifferenceType;
3318  * \endcode
3319  *
3320  * Executing \c clang_getUnqualifiedType() on a \c CXType that
3321  * represents \c DifferenceType, will desugar to a type representing
3322  * \c Integer, that has no qualifiers.
3323  *
3324  * And, executing \c clang_getUnqualifiedType() on the type of the
3325  * first argument of the following function declaration:
3326  *
3327  * \code
3328  * void foo(const int);
3329  * \endcode
3330  *
3331  * Will return a type representing \c int, removing the \c const
3332  * qualifier.
3333  *
3334  * Sugar over array types is not desugared.
3335  *
3336  * A type can be checked for qualifiers with \c
3337  * clang_isConstQualifiedType(), \c clang_isVolatileQualifiedType()
3338  * and \c clang_isRestrictQualifiedType().
3339  *
3340  * A type that resulted from a call to \c clang_getUnqualifiedType
3341  * will return \c false for all of the above calls.
3342  */
3344 
3345 /**
3346  * For reference types (e.g., "const int&"), returns the type that the
3347  * reference refers to (e.g "const int").
3348  *
3349  * Otherwise, returns the type itself.
3350  *
3351  * A type that has kind \c CXType_LValueReference or
3352  * \c CXType_RValueReference is a reference type.
3353  */
3355 
3356 /**
3357  * Return the cursor for the declaration of the given type.
3358  */
3360 
3361 /**
3362  * Returns the Objective-C type encoding for the specified declaration.
3363  */
3365 
3366 /**
3367  * Returns the Objective-C type encoding for the specified CXType.
3368  */
3370 
3371 /**
3372  * Retrieve the spelling of a given CXTypeKind.
3373  */
3375 
3376 /**
3377  * Retrieve the calling convention associated with a function type.
3378  *
3379  * If a non-function type is passed in, CXCallingConv_Invalid is returned.
3380  */
3382 
3383 /**
3384  * Retrieve the return type associated with a function type.
3385  *
3386  * If a non-function type is passed in, an invalid type is returned.
3387  */
3389 
3390 /**
3391  * Retrieve the exception specification type associated with a function type.
3392  * This is a value of type CXCursor_ExceptionSpecificationKind.
3393  *
3394  * If a non-function type is passed in, an error code of -1 is returned.
3395  */
3397 
3398 /**
3399  * Retrieve the number of non-variadic parameters associated with a
3400  * function type.
3401  *
3402  * If a non-function type is passed in, -1 is returned.
3403  */
3405 
3406 /**
3407  * Retrieve the type of a parameter of a function type.
3408  *
3409  * If a non-function type is passed in or the function does not have enough
3410  * parameters, an invalid type is returned.
3411  */
3413 
3414 /**
3415  * Retrieves the base type of the ObjCObjectType.
3416  *
3417  * If the type is not an ObjC object, an invalid type is returned.
3418  */
3420 
3421 /**
3422  * Retrieve the number of protocol references associated with an ObjC object/id.
3423  *
3424  * If the type is not an ObjC object, 0 is returned.
3425  */
3427 
3428 /**
3429  * Retrieve the decl for a protocol reference for an ObjC object/id.
3430  *
3431  * If the type is not an ObjC object or there are not enough protocol
3432  * references, an invalid cursor is returned.
3433  */
3435 
3436 /**
3437  * Retrieve the number of type arguments associated with an ObjC object.
3438  *
3439  * If the type is not an ObjC object, 0 is returned.
3440  */
3442 
3443 /**
3444  * Retrieve a type argument associated with an ObjC object.
3445  *
3446  * If the type is not an ObjC or the index is not valid,
3447  * an invalid type is returned.
3448  */
3450 
3451 /**
3452  * Return 1 if the CXType is a variadic function type, and 0 otherwise.
3453  */
3455 
3456 /**
3457  * Retrieve the return type associated with a given cursor.
3458  *
3459  * This only returns a valid type if the cursor refers to a function or method.
3460  */
3462 
3463 /**
3464  * Retrieve the exception specification type associated with a given cursor.
3465  * This is a value of type CXCursor_ExceptionSpecificationKind.
3466  *
3467  * This only returns a valid result if the cursor refers to a function or
3468  * method.
3469  */
3471 
3472 /**
3473  * Return 1 if the CXType is a POD (plain old data) type, and 0
3474  * otherwise.
3475  */
3477 
3478 /**
3479  * Return the element type of an array, complex, or vector type.
3480  *
3481  * If a type is passed in that is not an array, complex, or vector type,
3482  * an invalid type is returned.
3483  */
3485 
3486 /**
3487  * Return the number of elements of an array or vector type.
3488  *
3489  * If a type is passed in that is not an array or vector type,
3490  * -1 is returned.
3491  */
3493 
3494 /**
3495  * Return the element type of an array type.
3496  *
3497  * If a non-array type is passed in, an invalid type is returned.
3498  */
3500 
3501 /**
3502  * Return the array size of a constant array.
3503  *
3504  * If a non-array type is passed in, -1 is returned.
3505  */
3507 
3508 /**
3509  * Retrieve the type named by the qualified-id.
3510  *
3511  * If a non-elaborated type is passed in, an invalid type is returned.
3512  */
3514 
3515 /**
3516  * Determine if a typedef is 'transparent' tag.
3517  *
3518  * A typedef is considered 'transparent' if it shares a name and spelling
3519  * location with its underlying tag type, as is the case with the NS_ENUM macro.
3520  *
3521  * \returns non-zero if transparent and zero otherwise.
3522  */
3524 
3526  /**
3527  * Values of this type can never be null.
3528  */
3530  /**
3531  * Values of this type can be null.
3532  */
3534  /**
3535  * Whether values of this type can be null is (explicitly)
3536  * unspecified. This captures a (fairly rare) case where we
3537  * can't conclude anything about the nullability of the type even
3538  * though it has been considered.
3539  */
3541  /**
3542  * Nullability is not applicable to this type.
3543  */
3545 
3546  /**
3547  * Generally behaves like Nullable, except when used in a block parameter that
3548  * was imported into a swift async method. There, swift will assume that the
3549  * parameter can get null even if no error occurred. _Nullable parameters are
3550  * assumed to only get null on error.
3551  */
3553 };
3554 
3555 /**
3556  * Retrieve the nullability kind of a pointer type.
3557  */
3559 
3560 /**
3561  * List the possible error codes for \c clang_Type_getSizeOf,
3562  * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and
3563  * \c clang_Cursor_getOffsetOf.
3564  *
3565  * A value of this enumeration type can be returned if the target type is not
3566  * a valid argument to sizeof, alignof or offsetof.
3567  */
3569  /**
3570  * Type is of kind CXType_Invalid.
3571  */
3573  /**
3574  * The type is an incomplete Type.
3575  */
3577  /**
3578  * The type is a dependent Type.
3579  */
3581  /**
3582  * The type is not a constant size type.
3583  */
3585  /**
3586  * The Field name is not valid for this record.
3587  */
3589  /**
3590  * The type is undeduced.
3591  */
3593 };
3594 
3595 /**
3596  * Return the alignment of a type in bytes as per C++[expr.alignof]
3597  * standard.
3598  *
3599  * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned.
3600  * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
3601  * is returned.
3602  * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
3603  * returned.
3604  * If the type declaration is not a constant size type,
3605  * CXTypeLayoutError_NotConstantSize is returned.
3606  */
3608 
3609 /**
3610  * Return the class type of an member pointer type.
3611  *
3612  * If a non-member-pointer type is passed in, an invalid type is returned.
3613  */
3615 
3616 /**
3617  * Return the size of a type in bytes as per C++[expr.sizeof] standard.
3618  *
3619  * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned.
3620  * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
3621  * is returned.
3622  * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
3623  * returned.
3624  */
3626 
3627 /**
3628  * Return the offset of a field named S in a record of type T in bits
3629  * as it would be returned by __offsetof__ as per C++11[18.2p4]
3630  *
3631  * If the cursor is not a record field declaration, CXTypeLayoutError_Invalid
3632  * is returned.
3633  * If the field's type declaration is an incomplete type,
3634  * CXTypeLayoutError_Incomplete is returned.
3635  * If the field's type declaration is a dependent type,
3636  * CXTypeLayoutError_Dependent is returned.
3637  * If the field's name S is not found,
3638  * CXTypeLayoutError_InvalidFieldName is returned.
3639  */
3640 CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S);
3641 
3642 /**
3643  * Return the type that was modified by this attributed type.
3644  *
3645  * If the type is not an attributed type, an invalid type is returned.
3646  */
3648 
3649 /**
3650  * Gets the type contained by this atomic type.
3651  *
3652  * If a non-atomic type is passed in, an invalid type is returned.
3653  */
3655 
3656 /**
3657  * Return the offset of the field represented by the Cursor.
3658  *
3659  * If the cursor is not a field declaration, -1 is returned.
3660  * If the cursor semantic parent is not a record field declaration,
3661  * CXTypeLayoutError_Invalid is returned.
3662  * If the field's type declaration is an incomplete type,
3663  * CXTypeLayoutError_Incomplete is returned.
3664  * If the field's type declaration is a dependent type,
3665  * CXTypeLayoutError_Dependent is returned.
3666  * If the field's name S is not found,
3667  * CXTypeLayoutError_InvalidFieldName is returned.
3668  */
3670 
3671 /**
3672  * Determine whether the given cursor represents an anonymous
3673  * tag or namespace
3674  */
3676 
3677 /**
3678  * Determine whether the given cursor represents an anonymous record
3679  * declaration.
3680  */
3682 
3683 /**
3684  * Determine whether the given cursor represents an inline namespace
3685  * declaration.
3686  */
3688 
3690  /** No ref-qualifier was provided. */
3692  /** An lvalue ref-qualifier was provided (\c &). */
3694  /** An rvalue ref-qualifier was provided (\c &&). */
3696 };
3697 
3698 /**
3699  * Returns the number of template arguments for given template
3700  * specialization, or -1 if type \c T is not a template specialization.
3701  */
3703 
3704 /**
3705  * Returns the type template argument of a template class specialization
3706  * at given index.
3707  *
3708  * This function only returns template type arguments and does not handle
3709  * template template arguments or variadic packs.
3710  */
3712  unsigned i);
3713 
3714 /**
3715  * Retrieve the ref-qualifier kind of a function or method.
3716  *
3717  * The ref-qualifier is returned for C++ functions or methods. For other types
3718  * or non-C++ declarations, CXRefQualifier_None is returned.
3719  */
3721 
3722 /**
3723  * Returns 1 if the base class specified by the cursor with kind
3724  * CX_CXXBaseSpecifier is virtual.
3725  */
3727 
3728 /**
3729  * Represents the C++ access control level to a base class for a
3730  * cursor with kind CX_CXXBaseSpecifier.
3731  */
3737 };
3738 
3739 /**
3740  * Returns the access control level for the referenced object.
3741  *
3742  * If the cursor refers to a C++ declaration, its access control level within
3743  * its parent scope is returned. Otherwise, if the cursor refers to a base
3744  * specifier or access specifier, the specifier itself is returned.
3745  */
3747 
3748 /**
3749  * Represents the storage classes as declared in the source. CX_SC_Invalid
3750  * was added for the case that the passed cursor in not a declaration.
3751  */
3761 };
3762 
3763 /**
3764  * Returns the storage class for a function or variable declaration.
3765  *
3766  * If the passed in Cursor is not a function or variable declaration,
3767  * CX_SC_Invalid is returned else the storage class.
3768  */
3770 
3771 /**
3772  * Determine the number of overloaded declarations referenced by a
3773  * \c CXCursor_OverloadedDeclRef cursor.
3774  *
3775  * \param cursor The cursor whose overloaded declarations are being queried.
3776  *
3777  * \returns The number of overloaded declarations referenced by \c cursor. If it
3778  * is not a \c CXCursor_OverloadedDeclRef cursor, returns 0.
3779  */
3781 
3782 /**
3783  * Retrieve a cursor for one of the overloaded declarations referenced
3784  * by a \c CXCursor_OverloadedDeclRef cursor.
3785  *
3786  * \param cursor The cursor whose overloaded declarations are being queried.
3787  *
3788  * \param index The zero-based index into the set of overloaded declarations in
3789  * the cursor.
3790  *
3791  * \returns A cursor representing the declaration referenced by the given
3792  * \c cursor at the specified \c index. If the cursor does not have an
3793  * associated set of overloaded declarations, or if the index is out of bounds,
3794  * returns \c clang_getNullCursor();
3795  */
3797  unsigned index);
3798 
3799 /**
3800  * @}
3801  */
3802 
3803 /**
3804  * \defgroup CINDEX_ATTRIBUTES Information for attributes
3805  *
3806  * @{
3807  */
3808 
3809 /**
3810  * For cursors representing an iboutletcollection attribute,
3811  * this function returns the collection element type.
3812  *
3813  */
3815 
3816 /**
3817  * @}
3818  */
3819 
3820 /**
3821  * \defgroup CINDEX_CURSOR_TRAVERSAL Traversing the AST with cursors
3822  *
3823  * These routines provide the ability to traverse the abstract syntax tree
3824  * using cursors.
3825  *
3826  * @{
3827  */
3828 
3829 /**
3830  * Describes how the traversal of the children of a particular
3831  * cursor should proceed after visiting a particular child cursor.
3832  *
3833  * A value of this enumeration type should be returned by each
3834  * \c CXCursorVisitor to indicate how clang_visitChildren() proceed.
3835  */
3837  /**
3838  * Terminates the cursor traversal.
3839  */
3841  /**
3842  * Continues the cursor traversal with the next sibling of
3843  * the cursor just visited, without visiting its children.
3844  */
3846  /**
3847  * Recursively traverse the children of this cursor, using
3848  * the same visitor and client data.
3849  */
3851 };
3852 
3853 /**
3854  * Visitor invoked for each cursor found by a traversal.
3855  *
3856  * This visitor function will be invoked for each cursor found by
3857  * clang_visitCursorChildren(). Its first argument is the cursor being
3858  * visited, its second argument is the parent visitor for that cursor,
3859  * and its third argument is the client data provided to
3860  * clang_visitCursorChildren().
3861  *
3862  * The visitor should return one of the \c CXChildVisitResult values
3863  * to direct clang_visitCursorChildren().
3864  */
3865 typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor,
3866  CXCursor parent,
3867  CXClientData client_data);
3868 
3869 /**
3870  * Visit the children of a particular cursor.
3871  *
3872  * This function visits all the direct children of the given cursor,
3873  * invoking the given \p visitor function with the cursors of each
3874  * visited child. The traversal may be recursive, if the visitor returns
3875  * \c CXChildVisit_Recurse. The traversal may also be ended prematurely, if
3876  * the visitor returns \c CXChildVisit_Break.
3877  *
3878  * \param parent the cursor whose child may be visited. All kinds of
3879  * cursors can be visited, including invalid cursors (which, by
3880  * definition, have no children).
3881  *
3882  * \param visitor the visitor function that will be invoked for each
3883  * child of \p parent.
3884  *
3885  * \param client_data pointer data supplied by the client, which will
3886  * be passed to the visitor each time it is invoked.
3887  *
3888  * \returns a non-zero value if the traversal was terminated
3889  * prematurely by the visitor returning \c CXChildVisit_Break.
3890  */
3892  CXCursorVisitor visitor,
3893  CXClientData client_data);
3894 /**
3895  * Visitor invoked for each cursor found by a traversal.
3896  *
3897  * This visitor block will be invoked for each cursor found by
3898  * clang_visitChildrenWithBlock(). Its first argument is the cursor being
3899  * visited, its second argument is the parent visitor for that cursor.
3900  *
3901  * The visitor should return one of the \c CXChildVisitResult values
3902  * to direct clang_visitChildrenWithBlock().
3903  */
3904 #if __has_feature(blocks)
3905 typedef enum CXChildVisitResult (^CXCursorVisitorBlock)(CXCursor cursor,
3906  CXCursor parent);
3907 #else
3908 typedef struct _CXChildVisitResult *CXCursorVisitorBlock;
3909 #endif
3910 
3911 /**
3912  * Visits the children of a cursor using the specified block. Behaves
3913  * identically to clang_visitChildren() in all other respects.
3914  */
3915 CINDEX_LINKAGE unsigned
3917 
3918 /**
3919  * @}
3920  */
3921 
3922 /**
3923  * \defgroup CINDEX_CURSOR_XREF Cross-referencing in the AST
3924  *
3925  * These routines provide the ability to determine references within and
3926  * across translation units, by providing the names of the entities referenced
3927  * by cursors, follow reference cursors to the declarations they reference,
3928  * and associate declarations with their definitions.
3929  *
3930  * @{
3931  */
3932 
3933 /**
3934  * Retrieve a Unified Symbol Resolution (USR) for the entity referenced
3935  * by the given cursor.
3936  *
3937  * A Unified Symbol Resolution (USR) is a string that identifies a particular
3938  * entity (function, class, variable, etc.) within a program. USRs can be
3939  * compared across translation units to determine, e.g., when references in
3940  * one translation refer to an entity defined in another translation unit.
3941  */
3943 
3944 /**
3945  * Construct a USR for a specified Objective-C class.
3946  */
3948 
3949 /**
3950  * Construct a USR for a specified Objective-C category.
3951  */
3953  const char *class_name, const char *category_name);
3954 
3955 /**
3956  * Construct a USR for a specified Objective-C protocol.
3957  */
3959 clang_constructUSR_ObjCProtocol(const char *protocol_name);
3960 
3961 /**
3962  * Construct a USR for a specified Objective-C instance variable and
3963  * the USR for its containing class.
3964  */
3966  CXString classUSR);
3967 
3968 /**
3969  * Construct a USR for a specified Objective-C method and
3970  * the USR for its containing class.
3971  */
3973  unsigned isInstanceMethod,
3974  CXString classUSR);
3975 
3976 /**
3977  * Construct a USR for a specified Objective-C property and the USR
3978  * for its containing class.
3979  */
3981  CXString classUSR);
3982 
3983 /**
3984  * Retrieve a name for the entity referenced by this cursor.
3985  */
3987 
3988 /**
3989  * Retrieve a range for a piece that forms the cursors spelling name.
3990  * Most of the times there is only one range for the complete spelling but for
3991  * Objective-C methods and Objective-C message expressions, there are multiple
3992  * pieces for each selector identifier.
3993  *
3994  * \param pieceIndex the index of the spelling name piece. If this is greater
3995  * than the actual number of pieces, it will return a NULL (invalid) range.
3996  *
3997  * \param options Reserved.
3998  */
4000  CXCursor, unsigned pieceIndex, unsigned options);
4001 
4002 /**
4003  * Opaque pointer representing a policy that controls pretty printing
4004  * for \c clang_getCursorPrettyPrinted.
4005  */
4006 typedef void *CXPrintingPolicy;
4007 
4008 /**
4009  * Properties for the printing policy.
4010  *
4011  * See \c clang::PrintingPolicy for more information.
4012  */
4040 
4042 };
4043 
4044 /**
4045  * Get a property value for the given printing policy.
4046  */
4047 CINDEX_LINKAGE unsigned
4049  enum CXPrintingPolicyProperty Property);
4050 
4051 /**
4052  * Set a property value for the given printing policy.
4053  */
4054 CINDEX_LINKAGE void
4056  enum CXPrintingPolicyProperty Property,
4057  unsigned Value);
4058 
4059 /**
4060  * Retrieve the default policy for the cursor.
4061  *
4062  * The policy should be released after use with \c
4063  * clang_PrintingPolicy_dispose.
4064  */
4066 
4067 /**
4068  * Release a printing policy.
4069  */
4071 
4072 /**
4073  * Pretty print declarations.
4074  *
4075  * \param Cursor The cursor representing a declaration.
4076  *
4077  * \param Policy The policy to control the entities being printed. If
4078  * NULL, a default policy is used.
4079  *
4080  * \returns The pretty printed declaration or the empty string for
4081  * other cursors.
4082  */
4084  CXPrintingPolicy Policy);
4085 
4086 /**
4087  * Retrieve the display name for the entity referenced by this cursor.
4088  *
4089  * The display name contains extra information that helps identify the cursor,
4090  * such as the parameters of a function or template or the arguments of a
4091  * class template specialization.
4092  */
4094 
4095 /** For a cursor that is a reference, retrieve a cursor representing the
4096  * entity that it references.
4097  *
4098  * Reference cursors refer to other entities in the AST. For example, an
4099  * Objective-C superclass reference cursor refers to an Objective-C class.
4100  * This function produces the cursor for the Objective-C class from the
4101  * cursor for the superclass reference. If the input cursor is a declaration or
4102  * definition, it returns that declaration or definition unchanged.
4103  * Otherwise, returns the NULL cursor.
4104  */
4106 
4107 /**
4108  * For a cursor that is either a reference to or a declaration
4109  * of some entity, retrieve a cursor that describes the definition of
4110  * that entity.
4111  *
4112  * Some entities can be declared multiple times within a translation
4113  * unit, but only one of those declarations can also be a
4114  * definition. For example, given:
4115  *
4116  * \code
4117  * int f(int, int);
4118  * int g(int x, int y) { return f(x, y); }
4119  * int f(int a, int b) { return a + b; }
4120  * int f(int, int);
4121  * \endcode
4122  *
4123  * there are three declarations of the function "f", but only the
4124  * second one is a definition. The clang_getCursorDefinition()
4125  * function will take any cursor pointing to a declaration of "f"
4126  * (the first or fourth lines of the example) or a cursor referenced
4127  * that uses "f" (the call to "f' inside "g") and will return a
4128  * declaration cursor pointing to the definition (the second "f"
4129  * declaration).
4130  *
4131  * If given a cursor for which there is no corresponding definition,
4132  * e.g., because there is no definition of that entity within this
4133  * translation unit, returns a NULL cursor.
4134  */
4136 
4137 /**
4138  * Determine whether the declaration pointed to by this cursor
4139  * is also a definition of that entity.
4140  */
4142 
4143 /**
4144  * Retrieve the canonical cursor corresponding to the given cursor.
4145  *
4146  * In the C family of languages, many kinds of entities can be declared several
4147  * times within a single translation unit. For example, a structure type can
4148  * be forward-declared (possibly multiple times) and later defined:
4149  *
4150  * \code
4151  * struct X;
4152  * struct X;
4153  * struct X {
4154  * int member;
4155  * };
4156  * \endcode
4157  *
4158  * The declarations and the definition of \c X are represented by three
4159  * different cursors, all of which are declarations of the same underlying
4160  * entity. One of these cursor is considered the "canonical" cursor, which
4161  * is effectively the representative for the underlying entity. One can
4162  * determine if two cursors are declarations of the same underlying entity by
4163  * comparing their canonical cursors.
4164  *
4165  * \returns The canonical cursor for the entity referred to by the given cursor.
4166  */
4168 
4169 /**
4170  * If the cursor points to a selector identifier in an Objective-C
4171  * method or message expression, this returns the selector index.
4172  *
4173  * After getting a cursor with #clang_getCursor, this can be called to
4174  * determine if the location points to a selector identifier.
4175  *
4176  * \returns The selector index if the cursor is an Objective-C method or message
4177  * expression and the cursor is pointing to a selector identifier, or -1
4178  * otherwise.
4179  */
4181 
4182 /**
4183  * Given a cursor pointing to a C++ method call or an Objective-C
4184  * message, returns non-zero if the method/message is "dynamic", meaning:
4185  *
4186  * For a C++ method: the call is virtual.
4187  * For an Objective-C message: the receiver is an object instance, not 'super'
4188  * or a specific class.
4189  *
4190  * If the method/message is "static" or the cursor does not point to a
4191  * method/message, it will return zero.
4192  */
4194 
4195 /**
4196  * Given a cursor pointing to an Objective-C message or property
4197  * reference, or C++ method call, returns the CXType of the receiver.
4198  */
4200 
4201 /**
4202  * Property attributes for a \c CXCursor_ObjCPropertyDecl.
4203  */
4204 typedef enum {
4218  CXObjCPropertyAttr_class = 0x1000
4220 
4221 /**
4222  * Given a cursor that represents a property declaration, return the
4223  * associated property attributes. The bits are formed from
4224  * \c CXObjCPropertyAttrKind.
4225  *
4226  * \param reserved Reserved for future use, pass 0.
4227  */
4228 CINDEX_LINKAGE unsigned
4230 
4231 /**
4232  * Given a cursor that represents a property declaration, return the
4233  * name of the method that implements the getter.
4234  */
4236 
4237 /**
4238  * Given a cursor that represents a property declaration, return the
4239  * name of the method that implements the setter, if any.
4240  */
4242 
4243 /**
4244  * 'Qualifiers' written next to the return and parameter types in
4245  * Objective-C method declarations.
4246  */
4247 typedef enum {
4256 
4257 /**
4258  * Given a cursor that represents an Objective-C method or parameter
4259  * declaration, return the associated Objective-C qualifiers for the return
4260  * type or the parameter respectively. The bits are formed from
4261  * CXObjCDeclQualifierKind.
4262  */
4264 
4265 /**
4266  * Given a cursor that represents an Objective-C method or property
4267  * declaration, return non-zero if the declaration was affected by "\@optional".
4268  * Returns zero if the cursor is not such a declaration or it is "\@required".
4269  */
4271 
4272 /**
4273  * Returns non-zero if the given cursor is a variadic function or method.
4274  */
4276 
4277 /**
4278  * Returns non-zero if the given cursor points to a symbol marked with
4279  * external_source_symbol attribute.
4280  *
4281  * \param language If non-NULL, and the attribute is present, will be set to
4282  * the 'language' string from the attribute.
4283  *
4284  * \param definedIn If non-NULL, and the attribute is present, will be set to
4285  * the 'definedIn' string from the attribute.
4286  *
4287  * \param isGenerated If non-NULL, and the attribute is present, will be set to
4288  * non-zero if the 'generated_declaration' is set in the attribute.
4289  */
4291  CXString *language,
4292  CXString *definedIn,
4293  unsigned *isGenerated);
4294 
4295 /**
4296  * Given a cursor that represents a declaration, return the associated
4297  * comment's source range. The range may include multiple consecutive comments
4298  * with whitespace in between.
4299  */
4301 
4302 /**
4303  * Given a cursor that represents a declaration, return the associated
4304  * comment text, including comment markers.
4305  */
4307 
4308 /**
4309  * Given a cursor that represents a documentable entity (e.g.,
4310  * declaration), return the associated \paragraph; otherwise return the
4311  * first paragraph.
4312  */
4314 
4315 /**
4316  * @}
4317  */
4318 
4319 /** \defgroup CINDEX_MANGLE Name Mangling API Functions
4320  *
4321  * @{
4322  */
4323 
4324 /**
4325  * Retrieve the CXString representing the mangled name of the cursor.
4326  */
4328 
4329 /**
4330  * Retrieve the CXStrings representing the mangled symbols of the C++
4331  * constructor or destructor at the cursor.
4332  */
4334 
4335 /**
4336  * Retrieve the CXStrings representing the mangled symbols of the ObjC
4337  * class interface or implementation at the cursor.
4338  */
4340 
4341 /**
4342  * @}
4343  */
4344 
4345 /**
4346  * \defgroup CINDEX_MODULE Module introspection
4347  *
4348  * The functions in this group provide access to information about modules.
4349  *
4350  * @{
4351  */
4352 
4353 typedef void *CXModule;
4354 
4355 /**
4356  * Given a CXCursor_ModuleImportDecl cursor, return the associated module.
4357  */
4359 
4360 /**
4361  * Given a CXFile header file, return the module that contains it, if one
4362  * exists.
4363  */
4365 
4366 /**
4367  * \param Module a module object.
4368  *
4369  * \returns the module file where the provided module object came from.
4370  */
4372 
4373 /**
4374  * \param Module a module object.
4375  *
4376  * \returns the parent of a sub-module or NULL if the given module is top-level,
4377  * e.g. for 'std.vector' it will return the 'std' module.
4378  */
4380 
4381 /**
4382  * \param Module a module object.
4383  *
4384  * \returns the name of the module, e.g. for the 'std.vector' sub-module it
4385  * will return "vector".
4386  */
4388 
4389 /**
4390  * \param Module a module object.
4391  *
4392  * \returns the full name of the module, e.g. "std.vector".
4393  */
4395 
4396 /**
4397  * \param Module a module object.
4398  *
4399  * \returns non-zero if the module is a system one.
4400  */
4402 
4403 /**
4404  * \param Module a module object.
4405  *
4406  * \returns the number of top level headers associated with this module.
4407  */
4409  CXModule Module);
4410 
4411 /**
4412  * \param Module a module object.
4413  *
4414  * \param Index top level header index (zero-based).
4415  *
4416  * \returns the specified top level header associated with the module.
4417  */
4420  unsigned Index);
4421 
4422 /**
4423  * @}
4424  */
4425 
4426 /**
4427  * \defgroup CINDEX_CPP C++ AST introspection
4428  *
4429  * The routines in this group provide access information in the ASTs specific
4430  * to C++ language features.
4431  *
4432  * @{
4433  */
4434 
4435 /**
4436  * Determine if a C++ constructor is a converting constructor.
4437  */
4438 CINDEX_LINKAGE unsigned
4440 
4441 /**
4442  * Determine if a C++ constructor is a copy constructor.
4443  */
4445 
4446 /**
4447  * Determine if a C++ constructor is the default constructor.
4448  */
4450 
4451 /**
4452  * Determine if a C++ constructor is a move constructor.
4453  */
4455 
4456 /**
4457  * Determine if a C++ field is declared 'mutable'.
4458  */
4460 
4461 /**
4462  * Determine if a C++ method is declared '= default'.
4463  */
4465 
4466 /**
4467  * Determine if a C++ method is declared '= delete'.
4468  */
4470 
4471 /**
4472  * Determine if a C++ member function or member function template is
4473  * pure virtual.
4474  */
4476 
4477 /**
4478  * Determine if a C++ member function or member function template is
4479  * declared 'static'.
4480  */
4482 
4483 /**
4484  * Determine if a C++ member function or member function template is
4485  * explicitly declared 'virtual' or if it overrides a virtual method from
4486  * one of the base classes.
4487  */
4489 
4490 /**
4491  * Determine if a C++ member function is a copy-assignment operator,
4492  * returning 1 if such is the case and 0 otherwise.
4493  *
4494  * > A copy-assignment operator `X::operator=` is a non-static,
4495  * > non-template member function of _class_ `X` with exactly one
4496  * > parameter of type `X`, `X&`, `const X&`, `volatile X&` or `const
4497  * > volatile X&`.
4498  *
4499  * That is, for example, the `operator=` in:
4500  *
4501  * class Foo {
4502  * bool operator=(const volatile Foo&);
4503  * };
4504  *
4505  * Is a copy-assignment operator, while the `operator=` in:
4506  *
4507  * class Bar {
4508  * bool operator=(const int&);
4509  * };
4510  *
4511  * Is not.
4512  */
4514 
4515 /**
4516  * Determine if a C++ member function is a move-assignment operator,
4517  * returning 1 if such is the case and 0 otherwise.
4518  *
4519  * > A move-assignment operator `X::operator=` is a non-static,
4520  * > non-template member function of _class_ `X` with exactly one
4521  * > parameter of type `X&&`, `const X&&`, `volatile X&&` or `const
4522  * > volatile X&&`.
4523  *
4524  * That is, for example, the `operator=` in:
4525  *
4526  * class Foo {
4527  * bool operator=(const volatile Foo&&);
4528  * };
4529  *
4530  * Is a move-assignment operator, while the `operator=` in:
4531  *
4532  * class Bar {
4533  * bool operator=(const int&&);
4534  * };
4535  *
4536  * Is not.
4537  */
4539 
4540 /**
4541  * Determines if a C++ constructor or conversion function was declared
4542  * explicit, returning 1 if such is the case and 0 otherwise.
4543  *
4544  * Constructors or conversion functions are declared explicit through
4545  * the use of the explicit specifier.
4546  *
4547  * For example, the following constructor and conversion function are
4548  * not explicit as they lack the explicit specifier:
4549  *
4550  * class Foo {
4551  * Foo();
4552  * operator int();
4553  * };
4554  *
4555  * While the following constructor and conversion function are
4556  * explicit as they are declared with the explicit specifier.
4557  *
4558  * class Foo {
4559  * explicit Foo();
4560  * explicit operator int();
4561  * };
4562  *
4563  * This function will return 0 when given a cursor pointing to one of
4564  * the former declarations and it will return 1 for a cursor pointing
4565  * to the latter declarations.
4566  *
4567  * The explicit specifier allows the user to specify a
4568  * conditional compile-time expression whose value decides
4569  * whether the marked element is explicit or not.
4570  *
4571  * For example:
4572  *
4573  * constexpr bool foo(int i) { return i % 2 == 0; }
4574  *
4575  * class Foo {
4576  * explicit(foo(1)) Foo();
4577  * explicit(foo(2)) operator int();
4578  * }
4579  *
4580  * This function will return 0 for the constructor and 1 for
4581  * the conversion function.
4582  */
4584 
4585 /**
4586  * Determine if a C++ record is abstract, i.e. whether a class or struct
4587  * has a pure virtual member function.
4588  */
4590 
4591 /**
4592  * Determine if an enum declaration refers to a scoped enum.
4593  */
4595 
4596 /**
4597  * Determine if a C++ member function or member function template is
4598  * declared 'const'.
4599  */
4601 
4602 /**
4603  * Given a cursor that represents a template, determine
4604  * the cursor kind of the specializations would be generated by instantiating
4605  * the template.
4606  *
4607  * This routine can be used to determine what flavor of function template,
4608  * class template, or class template partial specialization is stored in the
4609  * cursor. For example, it can describe whether a class template cursor is
4610  * declared with "struct", "class" or "union".
4611  *
4612  * \param C The cursor to query. This cursor should represent a template
4613  * declaration.
4614  *
4615  * \returns The cursor kind of the specializations that would be generated
4616  * by instantiating the template \p C. If \p C is not a template, returns
4617  * \c CXCursor_NoDeclFound.
4618  */
4620 
4621 /**
4622  * Given a cursor that may represent a specialization or instantiation
4623  * of a template, retrieve the cursor that represents the template that it
4624  * specializes or from which it was instantiated.
4625  *
4626  * This routine determines the template involved both for explicit
4627  * specializations of templates and for implicit instantiations of the template,
4628  * both of which are referred to as "specializations". For a class template
4629  * specialization (e.g., \c std::vector<bool>), this routine will return
4630  * either the primary template (\c std::vector) or, if the specialization was
4631  * instantiated from a class template partial specialization, the class template
4632  * partial specialization. For a class template partial specialization and a
4633  * function template specialization (including instantiations), this
4634  * this routine will return the specialized template.
4635  *
4636  * For members of a class template (e.g., member functions, member classes, or
4637  * static data members), returns the specialized or instantiated member.
4638  * Although not strictly "templates" in the C++ language, members of class
4639  * templates have the same notions of specializations and instantiations that
4640  * templates do, so this routine treats them similarly.
4641  *
4642  * \param C A cursor that may be a specialization of a template or a member
4643  * of a template.
4644  *
4645  * \returns If the given cursor is a specialization or instantiation of a
4646  * template or a member thereof, the template or member that it specializes or
4647  * from which it was instantiated. Otherwise, returns a NULL cursor.
4648  */
4650 
4651 /**
4652  * Given a cursor that references something else, return the source range
4653  * covering that reference.
4654  *
4655  * \param C A cursor pointing to a member reference, a declaration reference, or
4656  * an operator call.
4657  * \param NameFlags A bitset with three independent flags:
4658  * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
4659  * CXNameRange_WantSinglePiece.
4660  * \param PieceIndex For contiguous names or when passing the flag
4661  * CXNameRange_WantSinglePiece, only one piece with index 0 is
4662  * available. When the CXNameRange_WantSinglePiece flag is not passed for a
4663  * non-contiguous names, this index can be used to retrieve the individual
4664  * pieces of the name. See also CXNameRange_WantSinglePiece.
4665  *
4666  * \returns The piece of the name pointed to by the given cursor. If there is no
4667  * name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
4668  */
4670  CXCursor C, unsigned NameFlags, unsigned PieceIndex);
4671 
4673  /**
4674  * Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the
4675  * range.
4676  */
4678 
4679  /**
4680  * Include the explicit template arguments, e.g. <int> in x.f<int>,
4681  * in the range.
4682  */
4684 
4685  /**
4686  * If the name is non-contiguous, return the full spanning range.
4687  *
4688  * Non-contiguous names occur in Objective-C when a selector with two or more
4689  * parameters is used, or in C++ when using an operator:
4690  * \code
4691  * [object doSomething:here withValue:there]; // Objective-C
4692  * return some_vector[1]; // C++
4693  * \endcode
4694  */
4696 };
4697 
4698 /**
4699  * @}
4700  */
4701 
4702 /**
4703  * \defgroup CINDEX_LEX Token extraction and manipulation
4704  *
4705  * The routines in this group provide access to the tokens within a
4706  * translation unit, along with a semantic mapping of those tokens to
4707  * their corresponding cursors.
4708  *
4709  * @{
4710  */
4711 
4712 /**
4713  * Describes a kind of token.
4714  */
4715 typedef enum CXTokenKind {
4716  /**
4717  * A token that contains some kind of punctuation.
4718  */
4720 
4721  /**
4722  * A language keyword.
4723  */
4725 
4726  /**
4727  * An identifier (that is not a keyword).
4728  */
4730 
4731  /**
4732  * A numeric, string, or character literal.
4733  */
4735 
4736  /**
4737  * A comment.
4738  */
4741 
4742 /**
4743  * Describes a single preprocessing token.
4744  */
4745 typedef struct {
4746  unsigned int_data[4];
4747  void *ptr_data;
4748 } CXToken;
4749 
4750 /**
4751  * Get the raw lexical token starting with the given location.
4752  *
4753  * \param TU the translation unit whose text is being tokenized.
4754  *
4755  * \param Location the source location with which the token starts.
4756  *
4757  * \returns The token starting with the given location or NULL if no such token
4758  * exist. The returned pointer must be freed with clang_disposeTokens before the
4759  * translation unit is destroyed.
4760  */
4762  CXSourceLocation Location);
4763 
4764 /**
4765  * Determine the kind of the given token.
4766  */
4768 
4769 /**
4770  * Determine the spelling of the given token.
4771  *
4772  * The spelling of a token is the textual representation of that token, e.g.,
4773  * the text of an identifier or keyword.
4774  */
4776 
4777 /**
4778  * Retrieve the source location of the given token.
4779  */
4781  CXToken);
4782 
4783 /**
4784  * Retrieve a source range that covers the given token.
4785  */
4787 
4788 /**
4789  * Tokenize the source code described by the given range into raw
4790  * lexical tokens.
4791  *
4792  * \param TU the translation unit whose text is being tokenized.
4793  *
4794  * \param Range the source range in which text should be tokenized. All of the
4795  * tokens produced by tokenization will fall within this source range,
4796  *
4797  * \param Tokens this pointer will be set to point to the array of tokens
4798  * that occur within the given source range. The returned pointer must be
4799  * freed with clang_disposeTokens() before the translation unit is destroyed.
4800  *
4801  * \param NumTokens will be set to the number of tokens in the \c *Tokens
4802  * array.
4803  *
4804  */
4806  CXToken **Tokens, unsigned *NumTokens);
4807 
4808 /**
4809  * Annotate the given set of tokens by providing cursors for each token
4810  * that can be mapped to a specific entity within the abstract syntax tree.
4811  *
4812  * This token-annotation routine is equivalent to invoking
4813  * clang_getCursor() for the source locations of each of the
4814  * tokens. The cursors provided are filtered, so that only those
4815  * cursors that have a direct correspondence to the token are
4816  * accepted. For example, given a function call \c f(x),
4817  * clang_getCursor() would provide the following cursors:
4818  *
4819  * * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'.
4820  * * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'.
4821  * * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'.
4822  *
4823  * Only the first and last of these cursors will occur within the
4824  * annotate, since the tokens "f" and "x' directly refer to a function
4825  * and a variable, respectively, but the parentheses are just a small
4826  * part of the full syntax of the function call expression, which is
4827  * not provided as an annotation.
4828  *
4829  * \param TU the translation unit that owns the given tokens.
4830  *
4831  * \param Tokens the set of tokens to annotate.
4832  *
4833  * \param NumTokens the number of tokens in \p Tokens.
4834  *
4835  * \param Cursors an array of \p NumTokens cursors, whose contents will be
4836  * replaced with the cursors corresponding to each token.
4837  */
4839  unsigned NumTokens, CXCursor *Cursors);
4840 
4841 /**
4842  * Free the given set of tokens.
4843  */
4845  unsigned NumTokens);
4846 
4847 /**
4848  * @}
4849  */
4850 
4851 /**
4852  * \defgroup CINDEX_DEBUG Debugging facilities
4853  *
4854  * These routines are used for testing and debugging, only, and should not
4855  * be relied upon.
4856  *
4857  * @{
4858  */
4859 
4860 /* for debug/testing */
4863  CXCursor, const char **startBuf, const char **endBuf, unsigned *startLine,
4864  unsigned *startColumn, unsigned *endLine, unsigned *endColumn);
4866 CINDEX_LINKAGE void clang_executeOnThread(void (*fn)(void *), void *user_data,
4867  unsigned stack_size);
4868 
4869 /**
4870  * @}
4871  */
4872 
4873 /**
4874  * \defgroup CINDEX_CODE_COMPLET Code completion
4875  *
4876  * Code completion involves taking an (incomplete) source file, along with
4877  * knowledge of where the user is actively editing that file, and suggesting
4878  * syntactically- and semantically-valid constructs that the user might want to
4879  * use at that particular point in the source code. These data structures and
4880  * routines provide support for code completion.
4881  *
4882  * @{
4883  */
4884 
4885 /**
4886  * A semantic string that describes a code-completion result.
4887  *
4888  * A semantic string that describes the formatting of a code-completion
4889  * result as a single "template" of text that should be inserted into the
4890  * source buffer when a particular code-completion result is selected.
4891  * Each semantic string is made up of some number of "chunks", each of which
4892  * contains some text along with a description of what that text means, e.g.,
4893  * the name of the entity being referenced, whether the text chunk is part of
4894  * the template, or whether it is a "placeholder" that the user should replace
4895  * with actual code,of a specific kind. See \c CXCompletionChunkKind for a
4896  * description of the different kinds of chunks.
4897  */
4898 typedef void *CXCompletionString;
4899 
4900 /**
4901  * A single result of code completion.
4902  */
4903 typedef struct {
4904  /**
4905  * The kind of entity that this completion refers to.
4906  *
4907  * The cursor kind will be a macro, keyword, or a declaration (one of the
4908  * *Decl cursor kinds), describing the entity that the completion is
4909  * referring to.
4910  *
4911  * \todo In the future, we would like to provide a full cursor, to allow
4912  * the client to extract additional information from declaration.
4913  */
4914  enum CXCursorKind CursorKind;
4915 
4916  /**
4917  * The code-completion string that describes how to insert this
4918  * code-completion result into the editing buffer.
4919  */
4922 
4923 /**
4924  * Describes a single piece of text within a code-completion string.
4925  *
4926  * Each "chunk" within a code-completion string (\c CXCompletionString) is
4927  * either a piece of text with a specific "kind" that describes how that text
4928  * should be interpreted by the client or is another completion string.
4929  */
4931  /**
4932  * A code-completion string that describes "optional" text that
4933  * could be a part of the template (but is not required).
4934  *
4935  * The Optional chunk is the only kind of chunk that has a code-completion
4936  * string for its representation, which is accessible via
4937  * \c clang_getCompletionChunkCompletionString(). The code-completion string
4938  * describes an additional part of the template that is completely optional.
4939  * For example, optional chunks can be used to describe the placeholders for
4940  * arguments that match up with defaulted function parameters, e.g. given:
4941  *
4942  * \code
4943  * void f(int x, float y = 3.14, double z = 2.71828);
4944  * \endcode
4945  *
4946  * The code-completion string for this function would contain:
4947  * - a TypedText chunk for "f".
4948  * - a LeftParen chunk for "(".
4949  * - a Placeholder chunk for "int x"
4950  * - an Optional chunk containing the remaining defaulted arguments, e.g.,
4951  * - a Comma chunk for ","
4952  * - a Placeholder chunk for "float y"
4953  * - an Optional chunk containing the last defaulted argument:
4954  * - a Comma chunk for ","
4955  * - a Placeholder chunk for "double z"
4956  * - a RightParen chunk for ")"
4957  *
4958  * There are many ways to handle Optional chunks. Two simple approaches are:
4959  * - Completely ignore optional chunks, in which case the template for the
4960  * function "f" would only include the first parameter ("int x").
4961  * - Fully expand all optional chunks, in which case the template for the
4962  * function "f" would have all of the parameters.
4963  */
4965  /**
4966  * Text that a user would be expected to type to get this
4967  * code-completion result.
4968  *
4969  * There will be exactly one "typed text" chunk in a semantic string, which
4970  * will typically provide the spelling of a keyword or the name of a
4971  * declaration that could be used at the current code point. Clients are
4972  * expected to filter the code-completion results based on the text in this
4973  * chunk.
4974  */
4976  /**
4977  * Text that should be inserted as part of a code-completion result.
4978  *
4979  * A "text" chunk represents text that is part of the template to be
4980  * inserted into user code should this particular code-completion result
4981  * be selected.
4982  */
4984  /**
4985  * Placeholder text that should be replaced by the user.
4986  *
4987  * A "placeholder" chunk marks a place where the user should insert text
4988  * into the code-completion template. For example, placeholders might mark
4989  * the function parameters for a function declaration, to indicate that the
4990  * user should provide arguments for each of those parameters. The actual
4991  * text in a placeholder is a suggestion for the text to display before
4992  * the user replaces the placeholder with real code.
4993  */
4995  /**
4996  * Informative text that should be displayed but never inserted as
4997  * part of the template.
4998  *
4999  * An "informative" chunk contains annotations that can be displayed to
5000  * help the user decide whether a particular code-completion result is the
5001  * right option, but which is not part of the actual template to be inserted
5002  * by code completion.
5003  */
5005  /**
5006  * Text that describes the current parameter when code-completion is
5007  * referring to function call, message send, or template specialization.
5008  *
5009  * A "current parameter" chunk occurs when code-completion is providing
5010  * information about a parameter corresponding to the argument at the
5011  * code-completion point. For example, given a function
5012  *
5013  * \code
5014  * int add(int x, int y);
5015  * \endcode
5016  *
5017  * and the source code \c add(, where the code-completion point is after the
5018  * "(", the code-completion string will contain a "current parameter" chunk
5019  * for "int x", indicating that the current argument will initialize that
5020  * parameter. After typing further, to \c add(17, (where the code-completion
5021  * point is after the ","), the code-completion string will contain a
5022  * "current parameter" chunk to "int y".
5023  */
5025  /**
5026  * A left parenthesis ('('), used to initiate a function call or
5027  * signal the beginning of a function parameter list.
5028  */
5030  /**
5031  * A right parenthesis (')'), used to finish a function call or
5032  * signal the end of a function parameter list.
5033  */
5035  /**
5036  * A left bracket ('[').
5037  */
5039  /**
5040  * A right bracket (']').
5041  */
5043  /**
5044  * A left brace ('{').
5045  */
5047  /**
5048  * A right brace ('}').
5049  */
5051  /**
5052  * A left angle bracket ('<').
5053  */
5055  /**
5056  * A right angle bracket ('>').
5057  */
5059  /**
5060  * A comma separator (',').
5061  */
5063  /**
5064  * Text that specifies the result type of a given result.
5065  *
5066  * This special kind of informative chunk is not meant to be inserted into
5067  * the text buffer. Rather, it is meant to illustrate the type that an
5068  * expression using the given completion string would have.
5069  */
5071  /**
5072  * A colon (':').
5073  */
5075  /**
5076  * A semicolon (';').
5077  */
5079  /**
5080  * An '=' sign.
5081  */
5083  /**
5084  * Horizontal space (' ').
5085  */
5087  /**
5088  * Vertical space ('\\n'), after which it is generally a good idea to
5089  * perform indentation.
5090  */
5092 };
5093 
5094 /**
5095  * Determine the kind of a particular chunk within a completion string.
5096  *
5097  * \param completion_string the completion string to query.
5098  *
5099  * \param chunk_number the 0-based index of the chunk in the completion string.
5100  *
5101  * \returns the kind of the chunk at the index \c chunk_number.
5102  */
5105  unsigned chunk_number);
5106 
5107 /**
5108  * Retrieve the text associated with a particular chunk within a
5109  * completion string.
5110  *
5111  * \param completion_string the completion string to query.
5112  *
5113  * \param chunk_number the 0-based index of the chunk in the completion string.
5114  *
5115  * \returns the text associated with the chunk at index \c chunk_number.
5116  */
5118  CXCompletionString completion_string, unsigned chunk_number);
5119 
5120 /**
5121  * Retrieve the completion string associated with a particular chunk
5122  * within a completion string.
5123  *
5124  * \param completion_string the completion string to query.
5125  *
5126  * \param chunk_number the 0-based index of the chunk in the completion string.
5127  *
5128  * \returns the completion string associated with the chunk at index
5129  * \c chunk_number.
5130  */
5132  CXCompletionString completion_string, unsigned chunk_number);
5133 
5134 /**
5135  * Retrieve the number of chunks in the given code-completion string.
5136  */
5137 CINDEX_LINKAGE unsigned
5139 
5140 /**
5141  * Determine the priority of this code completion.
5142  *
5143  * The priority of a code completion indicates how likely it is that this
5144  * particular completion is the completion that the user will select. The
5145  * priority is selected by various internal heuristics.
5146  *
5147  * \param completion_string The completion string to query.
5148  *
5149  * \returns The priority of this completion string. Smaller values indicate
5150  * higher-priority (more likely) completions.
5151  */
5152 CINDEX_LINKAGE unsigned
5154 
5155 /**
5156  * Determine the availability of the entity that this code-completion
5157  * string refers to.
5158  *
5159  * \param completion_string The completion string to query.
5160  *
5161  * \returns The availability of the completion string.
5162  */
5165 
5166 /**
5167  * Retrieve the number of annotations associated with the given
5168  * completion string.
5169  *
5170  * \param completion_string the completion string to query.
5171  *
5172  * \returns the number of annotations associated with the given completion
5173  * string.
5174  */
5175 CINDEX_LINKAGE unsigned
5177 
5178 /**
5179  * Retrieve the annotation associated with the given completion string.
5180  *
5181  * \param completion_string the completion string to query.
5182  *
5183  * \param annotation_number the 0-based index of the annotation of the
5184  * completion string.
5185  *
5186  * \returns annotation string associated with the completion at index
5187  * \c annotation_number, or a NULL string if that annotation is not available.
5188  */
5190  CXCompletionString completion_string, unsigned annotation_number);
5191 
5192 /**
5193  * Retrieve the parent context of the given completion string.
5194  *
5195  * The parent context of a completion string is the semantic parent of
5196  * the declaration (if any) that the code completion represents. For example,
5197  * a code completion for an Objective-C method would have the method's class
5198  * or protocol as its context.
5199  *
5200  * \param completion_string The code completion string whose parent is
5201  * being queried.
5202  *
5203  * \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL.
5204  *
5205  * \returns The name of the completion parent, e.g., "NSObject" if
5206  * the completion string represents a method in the NSObject class.
5207  */
5209  CXCompletionString completion_string, enum CXCursorKind *kind);
5210 
5211 /**
5212  * Retrieve the brief documentation comment attached to the declaration
5213  * that corresponds to the given completion string.
5214  */
5217 
5218 /**
5219  * Retrieve a completion string for an arbitrary declaration or macro
5220  * definition cursor.
5221  *
5222  * \param cursor The cursor to query.
5223  *
5224  * \returns A non-context-sensitive completion string for declaration and macro
5225  * definition cursors, or NULL for other kinds of cursors.
5226  */
5229 
5230 /**
5231  * Contains the results of code-completion.
5232  *
5233  * This data structure contains the results of code completion, as
5234  * produced by \c clang_codeCompleteAt(). Its contents must be freed by
5235  * \c clang_disposeCodeCompleteResults.
5236  */
5237 typedef struct {
5238  /**
5239  * The code-completion results.
5240  */
5242 
5243  /**
5244  * The number of code-completion results stored in the
5245  * \c Results array.
5246  */
5247  unsigned NumResults;
5249 
5250 /**
5251  * Retrieve the number of fix-its for the given completion index.
5252  *
5253  * Calling this makes sense only if CXCodeComplete_IncludeCompletionsWithFixIts
5254  * option was set.
5255  *
5256  * \param results The structure keeping all completion results
5257  *
5258  * \param completion_index The index of the completion
5259  *
5260  * \return The number of fix-its which must be applied before the completion at
5261  * completion_index can be applied
5262  */
5263 CINDEX_LINKAGE unsigned
5265  unsigned completion_index);
5266 
5267 /**
5268  * Fix-its that *must* be applied before inserting the text for the
5269  * corresponding completion.
5270  *
5271  * By default, clang_codeCompleteAt() only returns completions with empty
5272  * fix-its. Extra completions with non-empty fix-its should be explicitly
5273  * requested by setting CXCodeComplete_IncludeCompletionsWithFixIts.
5274  *
5275  * For the clients to be able to compute position of the cursor after applying
5276  * fix-its, the following conditions are guaranteed to hold for
5277  * replacement_range of the stored fix-its:
5278  * - Ranges in the fix-its are guaranteed to never contain the completion
5279  * point (or identifier under completion point, if any) inside them, except
5280  * at the start or at the end of the range.
5281  * - If a fix-it range starts or ends with completion point (or starts or
5282  * ends after the identifier under completion point), it will contain at
5283  * least one character. It allows to unambiguously recompute completion
5284  * point after applying the fix-it.
5285  *
5286  * The intuition is that provided fix-its change code around the identifier we
5287  * complete, but are not allowed to touch the identifier itself or the
5288  * completion point. One example of completions with corrections are the ones
5289  * replacing '.' with '->' and vice versa:
5290  *
5291  * std::unique_ptr<std::vector<int>> vec_ptr;
5292  * In 'vec_ptr.^', one of the completions is 'push_back', it requires
5293  * replacing '.' with '->'.
5294  * In 'vec_ptr->^', one of the completions is 'release', it requires
5295  * replacing '->' with '.'.
5296  *
5297  * \param results The structure keeping all completion results
5298  *
5299  * \param completion_index The index of the completion
5300  *
5301  * \param fixit_index The index of the fix-it for the completion at
5302  * completion_index
5303  *
5304  * \param replacement_range The fix-it range that must be replaced before the
5305  * completion at completion_index can be applied
5306  *
5307  * \returns The fix-it string that must replace the code at replacement_range
5308  * before the completion at completion_index can be applied
5309  */
5311  CXCodeCompleteResults *results, unsigned completion_index,
5312  unsigned fixit_index, CXSourceRange *replacement_range);
5313 
5314 /**
5315  * Flags that can be passed to \c clang_codeCompleteAt() to
5316  * modify its behavior.
5317  *
5318  * The enumerators in this enumeration can be bitwise-OR'd together to
5319  * provide multiple options to \c clang_codeCompleteAt().
5320  */
5322  /**
5323  * Whether to include macros within the set of code
5324  * completions returned.
5325  */
5327 
5328  /**
5329  * Whether to include code patterns for language constructs
5330  * within the set of code completions, e.g., for loops.
5331  */
5333 
5334  /**
5335  * Whether to include brief documentation within the set of code
5336  * completions returned.
5337  */
5339 
5340  /**
5341  * Whether to speed up completion by omitting top- or namespace-level entities
5342  * defined in the preamble. There's no guarantee any particular entity is
5343  * omitted. This may be useful if the headers are indexed externally.
5344  */
5346 
5347  /**
5348  * Whether to include completions with small
5349  * fix-its, e.g. change '.' to '->' on member access, etc.
5350  */
5352 };
5353 
5354 /**
5355  * Bits that represent the context under which completion is occurring.
5356  *
5357  * The enumerators in this enumeration may be bitwise-OR'd together if multiple
5358  * contexts are occurring simultaneously.
5359  */
5361  /**
5362  * The context for completions is unexposed, as only Clang results
5363  * should be included. (This is equivalent to having no context bits set.)
5364  */
5366 
5367  /**
5368  * Completions for any possible type should be included in the results.
5369  */
5371 
5372  /**
5373  * Completions for any possible value (variables, function calls, etc.)
5374  * should be included in the results.
5375  */
5377  /**
5378  * Completions for values that resolve to an Objective-C object should
5379  * be included in the results.
5380  */
5382  /**
5383  * Completions for values that resolve to an Objective-C selector
5384  * should be included in the results.
5385  */
5387  /**
5388  * Completions for values that resolve to a C++ class type should be
5389  * included in the results.
5390  */
5392 
5393  /**
5394  * Completions for fields of the member being accessed using the dot
5395  * operator should be included in the results.
5396  */
5398  /**
5399  * Completions for fields of the member being accessed using the arrow
5400  * operator should be included in the results.
5401  */
5403  /**
5404  * Completions for properties of the Objective-C object being accessed
5405  * using the dot operator should be included in the results.
5406  */
5408 
5409  /**
5410  * Completions for enum tags should be included in the results.
5411  */
5413  /**
5414  * Completions for union tags should be included in the results.
5415  */
5417  /**
5418  * Completions for struct tags should be included in the results.
5419  */
5421 
5422  /**
5423  * Completions for C++ class names should be included in the results.
5424  */
5426  /**
5427  * Completions for C++ namespaces and namespace aliases should be
5428  * included in the results.
5429  */
5431  /**
5432  * Completions for C++ nested name specifiers should be included in
5433  * the results.
5434  */
5436 
5437  /**
5438  * Completions for Objective-C interfaces (classes) should be included
5439  * in the results.
5440  */
5442  /**
5443  * Completions for Objective-C protocols should be included in
5444  * the results.
5445  */
5447  /**
5448  * Completions for Objective-C categories should be included in
5449  * the results.
5450  */
5452  /**
5453  * Completions for Objective-C instance messages should be included
5454  * in the results.
5455  */
5457  /**
5458  * Completions for Objective-C class messages should be included in
5459  * the results.
5460  */
5462  /**
5463  * Completions for Objective-C selector names should be included in
5464  * the results.
5465  */
5467 
5468  /**
5469  * Completions for preprocessor macro names should be included in
5470  * the results.
5471  */
5473 
5474  /**
5475  * Natural language completions should be included in the results.
5476  */
5478 
5479  /**
5480  * #include file completions should be included in the results.
5481  */
5483 
5484  /**
5485  * The current context is unknown, so set all contexts.
5486  */
5487  CXCompletionContext_Unknown = ((1 << 23) - 1)
5488 };
5489 
5490 /**
5491  * Returns a default set of code-completion options that can be
5492  * passed to\c clang_codeCompleteAt().
5493  */
5495 
5496 /**
5497  * Perform code completion at a given location in a translation unit.
5498  *
5499  * This function performs code completion at a particular file, line, and
5500  * column within source code, providing results that suggest potential
5501  * code snippets based on the context of the completion. The basic model
5502  * for code completion is that Clang will parse a complete source file,
5503  * performing syntax checking up to the location where code-completion has
5504  * been requested. At that point, a special code-completion token is passed
5505  * to the parser, which recognizes this token and determines, based on the
5506  * current location in the C/Objective-C/C++ grammar and the state of
5507  * semantic analysis, what completions to provide. These completions are
5508  * returned via a new \c CXCodeCompleteResults structure.
5509  *
5510  * Code completion itself is meant to be triggered by the client when the
5511  * user types punctuation characters or whitespace, at which point the
5512  * code-completion location will coincide with the cursor. For example, if \c p
5513  * is a pointer, code-completion might be triggered after the "-" and then
5514  * after the ">" in \c p->. When the code-completion location is after the ">",
5515  * the completion results will provide, e.g., the members of the struct that
5516  * "p" points to. The client is responsible for placing the cursor at the
5517  * beginning of the token currently being typed, then filtering the results
5518  * based on the contents of the token. For example, when code-completing for
5519  * the expression \c p->get, the client should provide the location just after
5520  * the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the
5521  * client can filter the results based on the current token text ("get"), only
5522  * showing those results that start with "get". The intent of this interface
5523  * is to separate the relatively high-latency acquisition of code-completion
5524  * results from the filtering of results on a per-character basis, which must
5525  * have a lower latency.
5526  *
5527  * \param TU The translation unit in which code-completion should
5528  * occur. The source files for this translation unit need not be
5529  * completely up-to-date (and the contents of those source files may
5530  * be overridden via \p unsaved_files). Cursors referring into the
5531  * translation unit may be invalidated by this invocation.
5532  *
5533  * \param complete_filename The name of the source file where code
5534  * completion should be performed. This filename may be any file
5535  * included in the translation unit.
5536  *
5537  * \param complete_line The line at which code-completion should occur.
5538  *
5539  * \param complete_column The column at which code-completion should occur.
5540  * Note that the column should point just after the syntactic construct that
5541  * initiated code completion, and not in the middle of a lexical token.
5542  *
5543  * \param unsaved_files the Files that have not yet been saved to disk
5544  * but may be required for parsing or code completion, including the
5545  * contents of those files. The contents and name of these files (as
5546  * specified by CXUnsavedFile) are copied when necessary, so the
5547  * client only needs to guarantee their validity until the call to
5548  * this function returns.
5549  *
5550  * \param num_unsaved_files The number of unsaved file entries in \p
5551  * unsaved_files.
5552  *
5553  * \param options Extra options that control the behavior of code
5554  * completion, expressed as a bitwise OR of the enumerators of the
5555  * CXCodeComplete_Flags enumeration. The
5556  * \c clang_defaultCodeCompleteOptions() function returns a default set
5557  * of code-completion options.
5558  *
5559  * \returns If successful, a new \c CXCodeCompleteResults structure
5560  * containing code-completion results, which should eventually be
5561  * freed with \c clang_disposeCodeCompleteResults(). If code
5562  * completion fails, returns NULL.
5563  */
5566 clang_codeCompleteAt(CXTranslationUnit TU, const char *complete_filename,
5567  unsigned complete_line, unsigned complete_column,
5568  struct CXUnsavedFile *unsaved_files,
5569  unsigned num_unsaved_files, unsigned options);
5570 
5571 /**
5572  * Sort the code-completion results in case-insensitive alphabetical
5573  * order.
5574  *
5575  * \param Results The set of results to sort.
5576  * \param NumResults The number of results in \p Results.
5577  */
5580  unsigned NumResults);
5581 
5582 /**
5583  * Free the given set of code-completion results.
5584  */
5587 
5588 /**
5589  * Determine the number of diagnostics produced prior to the
5590  * location where code completion was performed.
5591  */
5594 
5595 /**
5596  * Retrieve a diagnostic associated with the given code completion.
5597  *
5598  * \param Results the code completion results to query.
5599  * \param Index the zero-based diagnostic number to retrieve.
5600  *
5601  * \returns the requested diagnostic. This diagnostic must be freed
5602  * via a call to \c clang_disposeDiagnostic().
5603  */
5606  unsigned Index);
5607 
5608 /**
5609  * Determines what completions are appropriate for the context
5610  * the given code completion.
5611  *
5612  * \param Results the code completion results to query
5613  *
5614  * \returns the kinds of completions that are appropriate for use
5615  * along with the given code completion results.
5616  */
5618 unsigned long long
5620 
5621 /**
5622  * Returns the cursor kind for the container for the current code
5623  * completion context. The container is only guaranteed to be set for
5624  * contexts where a container exists (i.e. member accesses or Objective-C
5625  * message sends); if there is not a container, this function will return
5626  * CXCursor_InvalidCode.
5627  *
5628  * \param Results the code completion results to query
5629  *
5630  * \param IsIncomplete on return, this value will be false if Clang has complete
5631  * information about the container. If Clang does not have complete
5632  * information, this value will be true.
5633  *
5634  * \returns the container kind, or CXCursor_InvalidCode if there is not a
5635  * container
5636  */
5638 enum CXCursorKind
5640  unsigned *IsIncomplete);
5641 
5642 /**
5643  * Returns the USR for the container for the current code completion
5644  * context. If there is not a container for the current context, this
5645  * function will return the empty string.
5646  *
5647  * \param Results the code completion results to query
5648  *
5649  * \returns the USR for the container
5650  */
5653 
5654 /**
5655  * Returns the currently-entered selector for an Objective-C message
5656  * send, formatted like "initWithFoo:bar:". Only guaranteed to return a
5657  * non-empty string for CXCompletionContext_ObjCInstanceMessage and
5658  * CXCompletionContext_ObjCClassMessage.
5659  *
5660  * \param Results the code completion results to query
5661  *
5662  * \returns the selector (or partial selector) that has been entered thus far
5663  * for an Objective-C message send.
5664  */
5667 
5668 /**
5669  * @}
5670  */
5671 
5672 /**
5673  * \defgroup CINDEX_MISC Miscellaneous utility functions
5674  *
5675  * @{
5676  */
5677 
5678 /**
5679  * Return a version string, suitable for showing to a user, but not
5680  * intended to be parsed (the format is not guaranteed to be stable).
5681  */
5683 
5684 /**
5685  * Enable/disable crash recovery.
5686  *
5687  * \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero
5688  * value enables crash recovery, while 0 disables it.
5689  */
5691 
5692 /**
5693  * Visitor invoked for each file in a translation unit
5694  * (used with clang_getInclusions()).
5695  *
5696  * This visitor function will be invoked by clang_getInclusions() for each
5697  * file included (either at the top-level or by \#include directives) within
5698  * a translation unit. The first argument is the file being included, and
5699  * the second and third arguments provide the inclusion stack. The
5700  * array is sorted in order of immediate inclusion. For example,
5701  * the first element refers to the location that included 'included_file'.
5702  */
5703 typedef void (*CXInclusionVisitor)(CXFile included_file,
5704  CXSourceLocation *inclusion_stack,
5705  unsigned include_len,
5706  CXClientData client_data);
5707 
5708 /**
5709  * Visit the set of preprocessor inclusions in a translation unit.
5710  * The visitor function is called with the provided data for every included
5711  * file. This does not include headers included by the PCH file (unless one
5712  * is inspecting the inclusions in the PCH file itself).
5713  */
5715  CXInclusionVisitor visitor,
5716  CXClientData client_data);
5717 
5718 typedef enum {
5725 
5726  CXEval_UnExposed = 0
5727 
5729 
5730 /**
5731  * Evaluation result of a cursor
5732  */
5733 typedef void *CXEvalResult;
5734 
5735 /**
5736  * If cursor is a statement declaration tries to evaluate the
5737  * statement and if its variable, tries to evaluate its initializer,
5738  * into its corresponding type.
5739  * If it's an expression, tries to evaluate the expression.
5740  */
5742 
5743 /**
5744  * Returns the kind of the evaluated result.
5745  */
5747 
5748 /**
5749  * Returns the evaluation result as integer if the
5750  * kind is Int.
5751  */
5753 
5754 /**
5755  * Returns the evaluation result as a long long integer if the
5756  * kind is Int. This prevents overflows that may happen if the result is
5757  * returned with clang_EvalResult_getAsInt.
5758  */
5760 
5761 /**
5762  * Returns a non-zero value if the kind is Int and the evaluation
5763  * result resulted in an unsigned integer.
5764  */
5766 
5767 /**
5768  * Returns the evaluation result as an unsigned integer if
5769  * the kind is Int and clang_EvalResult_isUnsignedInt is non-zero.
5770  */
5771 CINDEX_LINKAGE unsigned long long
5773 
5774 /**
5775  * Returns the evaluation result as double if the
5776  * kind is double.
5777  */
5779 
5780 /**
5781  * Returns the evaluation result as a constant string if the
5782  * kind is other than Int or float. User must not free this pointer,
5783  * instead call clang_EvalResult_dispose on the CXEvalResult returned
5784  * by clang_Cursor_Evaluate.
5785  */
5787 
5788 /**
5789  * Disposes the created Eval memory.
5790  */
5792 /**
5793  * @}
5794  */
5795 
5796 /** \defgroup CINDEX_REMAPPING Remapping functions
5797  *
5798  * @{
5799  */
5800 
5801 /**
5802  * A remapping of original source files and their translated files.
5803  */
5804 typedef void *CXRemapping;
5805 
5806 /**
5807  * Retrieve a remapping.
5808  *
5809  * \param path the path that contains metadata about remappings.
5810  *
5811  * \returns the requested remapping. This remapping must be freed
5812  * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred.
5813  */
5815 
5816 /**
5817  * Retrieve a remapping.
5818  *
5819  * \param filePaths pointer to an array of file paths containing remapping info.
5820  *
5821  * \param numFiles number of file paths.
5822  *
5823  * \returns the requested remapping. This remapping must be freed
5824  * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred.
5825  */
5828  unsigned numFiles);
5829 
5830 /**
5831  * Determine the number of remappings.
5832  */
5834 
5835 /**
5836  * Get the original and the associated filename from the remapping.
5837  *
5838  * \param original If non-NULL, will be set to the original filename.
5839  *
5840  * \param transformed If non-NULL, will be set to the filename that the original
5841  * is associated with.
5842  */
5844  CXString *original,
5845  CXString *transformed);
5846 
5847 /**
5848  * Dispose the remapping.
5849  */
5851 
5852 /**
5853  * @}
5854  */
5855 
5856 /** \defgroup CINDEX_HIGH Higher level API functions
5857  *
5858  * @{
5859  */
5860 
5862 
5863 typedef struct CXCursorAndRangeVisitor {
5864  void *context;
5867 
5868 typedef enum {
5869  /**
5870  * Function returned successfully.
5871  */
5873  /**
5874  * One of the parameters was invalid for the function.
5875  */
5877  /**
5878  * The function was terminated by a callback (e.g. it returned
5879  * CXVisit_Break)
5880  */
5882 
5884 
5885 /**
5886  * Find references of a declaration in a specific file.
5887  *
5888  * \param cursor pointing to a declaration or a reference of one.
5889  *
5890  * \param file to search for references.
5891  *
5892  * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for
5893  * each reference found.
5894  * The CXSourceRange will point inside the file; if the reference is inside
5895  * a macro (and not a macro argument) the CXSourceRange will be invalid.
5896  *
5897  * \returns one of the CXResult enumerators.
5898  */
5900  CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor);
5901 
5902 /**
5903  * Find #import/#include directives in a specific file.
5904  *
5905  * \param TU translation unit containing the file to query.
5906  *
5907  * \param file to search for #import/#include directives.
5908  *
5909  * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for
5910  * each directive found.
5911  *
5912  * \returns one of the CXResult enumerators.
5913  */
5916 
5917 #if __has_feature(blocks)
5919  CXSourceRange);
5920 #else
5921 typedef struct _CXCursorAndRangeVisitorBlock *CXCursorAndRangeVisitorBlock;
5922 #endif
5923 
5927 
5931 
5932 /**
5933  * The client's data object that is associated with a CXFile.
5934  */
5935 typedef void *CXIdxClientFile;
5936 
5937 /**
5938  * The client's data object that is associated with a semantic entity.
5939  */
5940 typedef void *CXIdxClientEntity;
5941 
5942 /**
5943  * The client's data object that is associated with a semantic container
5944  * of entities.
5945  */
5946 typedef void *CXIdxClientContainer;
5947 
5948 /**
5949  * The client's data object that is associated with an AST file (PCH
5950  * or module).
5951  */
5952 typedef void *CXIdxClientASTFile;
5953 
5954 /**
5955  * Source location passed to index callbacks.
5956  */
5957 typedef struct {
5958  void *ptr_data[2];
5959  unsigned int_data;
5960 } CXIdxLoc;
5961 
5962 /**
5963  * Data for ppIncludedFile callback.
5964  */
5965 typedef struct {
5966  /**
5967  * Location of '#' in the \#include/\#import directive.
5968  */
5970  /**
5971  * Filename as written in the \#include/\#import directive.
5972  */
5973  const char *filename;
5974  /**
5975  * The actual file that the \#include/\#import directive resolved to.
5976  */
5980  /**
5981  * Non-zero if the directive was automatically turned into a module
5982  * import.
5983  */
5986 
5987 /**
5988  * Data for IndexerCallbacks#importedASTFile.
5989  */
5990 typedef struct {
5991  /**
5992  * Top level AST file containing the imported PCH, module or submodule.
5993  */
5995  /**
5996  * The imported module or NULL if the AST file is a PCH.
5997  */
5999  /**
6000  * Location where the file is imported. Applicable only for modules.
6001  */
6003  /**
6004  * Non-zero if an inclusion directive was automatically turned into
6005  * a module import. Applicable only for modules.
6006  */
6008 
6010 
6011 typedef enum {
6018 
6022 
6027 
6031 
6044 
6046 
6047 typedef enum {
6054 
6055 /**
6056  * Extra C++ template information for an entity. This can apply to:
6057  * CXIdxEntity_Function
6058  * CXIdxEntity_CXXClass
6059  * CXIdxEntity_CXXStaticMethod
6060  * CXIdxEntity_CXXInstanceMethod
6061  * CXIdxEntity_CXXConstructor
6062  * CXIdxEntity_CXXConversionFunction
6063  * CXIdxEntity_CXXTypeAlias
6064  */
6065 typedef enum {
6071 
6072 typedef enum {
6078 
6079 typedef struct {
6083 } CXIdxAttrInfo;
6084 
6085 typedef struct {
6089  const char *name;
6090  const char *USR;
6092  const CXIdxAttrInfo *const *attributes;
6093  unsigned numAttributes;
6094 } CXIdxEntityInfo;
6095 
6096 typedef struct {
6099 
6100 typedef struct {
6106 
6108 
6109 typedef struct {
6114  /**
6115  * Generally same as #semanticContainer but can be different in
6116  * cases like out-of-line C++ member functions.
6117  */
6123  /**
6124  * Whether the declaration exists in code or was created implicitly
6125  * by the compiler, e.g. implicit Objective-C methods for properties.
6126  */
6128  const CXIdxAttrInfo *const *attributes;
6129  unsigned numAttributes;
6130 
6131  unsigned flags;
6132 
6133 } CXIdxDeclInfo;
6134 
6135 typedef enum {
6140 
6141 typedef struct {
6145 
6146 typedef struct {
6151 
6152 typedef struct {
6157 
6158 typedef struct {
6160  unsigned numProtocols;
6162 
6163 typedef struct {
6168 
6169 typedef struct {
6176 
6177 typedef struct {
6182 
6183 typedef struct {
6185  const CXIdxBaseClassInfo *const *bases;
6186  unsigned numBases;
6188 
6189 /**
6190  * Data for IndexerCallbacks#indexEntityReference.
6191  *
6192  * This may be deprecated in a future version as this duplicates
6193  * the \c CXSymbolRole_Implicit bit in \c CXSymbolRole.
6194  */
6195 typedef enum {
6196  /**
6197  * The entity is referenced directly in user's code.
6198  */
6200  /**
6201  * An implicit reference, e.g. a reference of an Objective-C method
6202  * via the dot syntax.
6203  */
6206 
6207 /**
6208  * Roles that are attributed to symbol occurrences.
6209  *
6210  * Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with
6211  * higher bits zeroed. These high bits may be exposed in the future.
6212  */
6213 typedef enum {
6223  CXSymbolRole_Implicit = 1 << 8
6225 
6226 /**
6227  * Data for IndexerCallbacks#indexEntityReference.
6228  */
6229 typedef struct {
6231  /**
6232  * Reference cursor.
6233  */
6236  /**
6237  * The entity that gets referenced.
6238  */
6240  /**
6241  * Immediate "parent" of the reference. For example:
6242  *
6243  * \code
6244  * Foo *var;
6245  * \endcode
6246  *
6247  * The parent of reference of type 'Foo' is the variable 'var'.
6248  * For references inside statement bodies of functions/methods,
6249  * the parentEntity will be the function/method.
6250  */
6252  /**
6253  * Lexical container context of the reference.
6254  */
6256  /**
6257  * Sets of symbol roles of the reference.
6258  */
6261 
6262 /**
6263  * A group of callbacks used by #clang_indexSourceFile and
6264  * #clang_indexTranslationUnit.
6265  */
6266 typedef struct {
6267  /**
6268  * Called periodically to check whether indexing should be aborted.
6269  * Should return 0 to continue, and non-zero to abort.
6270  */
6271  int (*abortQuery)(CXClientData client_data, void *reserved);
6272 
6273  /**
6274  * Called at the end of indexing; passes the complete diagnostic set.
6275  */
6276  void (*diagnostic)(CXClientData client_data, CXDiagnosticSet, void *reserved);
6277 
6278  CXIdxClientFile (*enteredMainFile)(CXClientData client_data, CXFile mainFile,
6279  void *reserved);
6280 
6281  /**
6282  * Called when a file gets \#included/\#imported.
6283  */
6284  CXIdxClientFile (*ppIncludedFile)(CXClientData client_data,
6285  const CXIdxIncludedFileInfo *);
6286 
6287  /**
6288  * Called when a AST file (PCH or module) gets imported.
6289  *
6290  * AST files will not get indexed (there will not be callbacks to index all
6291  * the entities in an AST file). The recommended action is that, if the AST
6292  * file is not already indexed, to initiate a new indexing job specific to
6293  * the AST file.
6294  */
6295  CXIdxClientASTFile (*importedASTFile)(CXClientData client_data,
6296  const CXIdxImportedASTFileInfo *);
6297 
6298  /**
6299  * Called at the beginning of indexing a translation unit.
6300  */
6301  CXIdxClientContainer (*startedTranslationUnit)(CXClientData client_data,
6302  void *reserved);
6303 
6304  void (*indexDeclaration)(CXClientData client_data, const CXIdxDeclInfo *);
6305 
6306  /**
6307  * Called to index a reference of an entity.
6308  */
6309  void (*indexEntityReference)(CXClientData client_data,
6310  const CXIdxEntityRefInfo *);
6311 
6313 
6317 
6320 
6324 
6327 
6330 
6333 
6336 
6337 /**
6338  * For retrieving a custom CXIdxClientContainer attached to a
6339  * container.
6340  */
6343 
6344 /**
6345  * For setting a custom CXIdxClientContainer attached to a
6346  * container.
6347  */
6350 
6351 /**
6352  * For retrieving a custom CXIdxClientEntity attached to an entity.
6353  */
6356 
6357 /**
6358  * For setting a custom CXIdxClientEntity attached to an entity.
6359  */
6362 
6363 /**
6364  * An indexing action/session, to be applied to one or multiple
6365  * translation units.
6366  */
6367 typedef void *CXIndexAction;
6368 
6369 /**
6370  * An indexing action/session, to be applied to one or multiple
6371  * translation units.
6372  *
6373  * \param CIdx The index object with which the index action will be associated.
6374  */
6376 
6377 /**
6378  * Destroy the given index action.
6379  *
6380  * The index action must not be destroyed until all of the translation units
6381  * created within that index action have been destroyed.
6382  */
6384 
6385 typedef enum {
6386  /**
6387  * Used to indicate that no special indexing options are needed.
6388  */
6390 
6391  /**
6392  * Used to indicate that IndexerCallbacks#indexEntityReference should
6393  * be invoked for only one reference of an entity per source file that does
6394  * not also include a declaration/definition of the entity.
6395  */
6397 
6398  /**
6399  * Function-local symbols should be indexed. If this is not set
6400  * function-local symbols will be ignored.
6401  */
6403 
6404  /**
6405  * Implicit function/class template instantiations should be indexed.
6406  * If this is not set, implicit instantiations will be ignored.
6407  */
6409 
6410  /**
6411  * Suppress all compiler warnings when parsing for indexing.
6412  */
6414 
6415  /**
6416  * Skip a function/method body that was already parsed during an
6417  * indexing session associated with a \c CXIndexAction object.
6418  * Bodies in system headers are always skipped.
6419  */
6421 
6423 
6424 /**
6425  * Index the given source file and the translation unit corresponding
6426  * to that file via callbacks implemented through #IndexerCallbacks.
6427  *
6428  * \param client_data pointer data supplied by the client, which will
6429  * be passed to the invoked callbacks.
6430  *
6431  * \param index_callbacks Pointer to indexing callbacks that the client
6432  * implements.
6433  *
6434  * \param index_callbacks_size Size of #IndexerCallbacks structure that gets
6435  * passed in index_callbacks.
6436  *
6437  * \param index_options A bitmask of options that affects how indexing is
6438  * performed. This should be a bitwise OR of the CXIndexOpt_XXX flags.
6439  *
6440  * \param[out] out_TU pointer to store a \c CXTranslationUnit that can be
6441  * reused after indexing is finished. Set to \c NULL if you do not require it.
6442  *
6443  * \returns 0 on success or if there were errors from which the compiler could
6444  * recover. If there is a failure from which there is no recovery, returns
6445  * a non-zero \c CXErrorCode.
6446  *
6447  * The rest of the parameters are the same as #clang_parseTranslationUnit.
6448  */
6450  CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks,
6451  unsigned index_callbacks_size, unsigned index_options,
6452  const char *source_filename, const char *const *command_line_args,
6453  int num_command_line_args, struct CXUnsavedFile *unsaved_files,
6454  unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options);
6455 
6456 /**
6457  * Same as clang_indexSourceFile but requires a full command line
6458  * for \c command_line_args including argv[0]. This is useful if the standard
6459  * library paths are relative to the binary.
6460  */
6462  CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks,
6463  unsigned index_callbacks_size, unsigned index_options,
6464  const char *source_filename, const char *const *command_line_args,
6465  int num_command_line_args, struct CXUnsavedFile *unsaved_files,
6466  unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options);
6467 
6468 /**
6469  * Index the given translation unit via callbacks implemented through
6470  * #IndexerCallbacks.
6471  *
6472  * The order of callback invocations is not guaranteed to be the same as
6473  * when indexing a source file. The high level order will be:
6474  *
6475  * -Preprocessor callbacks invocations
6476  * -Declaration/reference callbacks invocations
6477  * -Diagnostic callback invocations
6478  *
6479  * The parameters are the same as #clang_indexSourceFile.
6480  *
6481  * \returns If there is a failure from which there is no recovery, returns
6482  * non-zero, otherwise returns 0.
6483  */
6485  CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks,
6486  unsigned index_callbacks_size, unsigned index_options, CXTranslationUnit);
6487 
6488 /**
6489  * Retrieve the CXIdxFile, file, line, column, and offset represented by
6490  * the given CXIdxLoc.
6491  *
6492  * If the location refers into a macro expansion, retrieves the
6493  * location of the macro expansion and if it refers into a macro argument
6494  * retrieves the location of the argument.
6495  */
6497  CXIdxClientFile *indexFile,
6498  CXFile *file, unsigned *line,
6499  unsigned *column,
6500  unsigned *offset);
6501 
6502 /**
6503  * Retrieve the CXSourceLocation represented by the given CXIdxLoc.
6504  */
6507 
6508 /**
6509  * Visitor invoked for each field found by a traversal.
6510  *
6511  * This visitor function will be invoked for each field found by
6512  * \c clang_Type_visitFields. Its first argument is the cursor being
6513  * visited, its second argument is the client data provided to
6514  * \c clang_Type_visitFields.
6515  *
6516  * The visitor should return one of the \c CXVisitorResult values
6517  * to direct \c clang_Type_visitFields.
6518  */
6519 typedef enum CXVisitorResult (*CXFieldVisitor)(CXCursor C,
6520  CXClientData client_data);
6521 
6522 /**
6523  * Visit the fields of a particular type.
6524  *
6525  * This function visits all the direct fields of the given cursor,
6526  * invoking the given \p visitor function with the cursors of each
6527  * visited field. The traversal may be ended prematurely, if
6528  * the visitor returns \c CXFieldVisit_Break.
6529  *
6530  * \param T the record type whose field may be visited.
6531  *
6532  * \param visitor the visitor function that will be invoked for each
6533  * field of \p T.
6534  *
6535  * \param client_data pointer data supplied by the client, which will
6536  * be passed to the visitor each time it is invoked.
6537  *
6538  * \returns a non-zero value if the traversal was terminated
6539  * prematurely by the visitor returning \c CXFieldVisit_Break.
6540  */
6542  CXClientData client_data);
6543 
6544 /**
6545  * Describes the kind of binary operators.
6546  */
6548  /** This value describes cursors which are not binary operators. */
6550  /** C++ Pointer - to - member operator. */
6552  /** C++ Pointer - to - member operator. */
6554  /** Multiplication operator. */
6556  /** Division operator. */
6558  /** Remainder operator. */
6560  /** Addition operator. */
6562  /** Subtraction operator. */
6564  /** Bitwise shift left operator. */
6566  /** Bitwise shift right operator. */
6568  /** C++ three-way comparison (spaceship) operator. */
6570  /** Less than operator. */
6572  /** Greater than operator. */
6574  /** Less or equal operator. */
6576  /** Greater or equal operator. */
6578  /** Equal operator. */
6580  /** Not equal operator. */
6582  /** Bitwise AND operator. */
6584  /** Bitwise XOR operator. */
6586  /** Bitwise OR operator. */
6588  /** Logical AND operator. */
6590  /** Logical OR operator. */
6592  /** Assignment operator. */
6594  /** Multiplication assignment operator. */
6596  /** Division assignment operator. */
6598  /** Remainder assignment operator. */
6600  /** Addition assignment operator. */
6602  /** Subtraction assignment operator. */
6604  /** Bitwise shift left assignment operator. */
6606  /** Bitwise shift right assignment operator. */
6608  /** Bitwise AND assignment operator. */
6610  /** Bitwise XOR assignment operator. */
6612  /** Bitwise OR assignment operator. */
6614  /** Comma operator. */
6616 };
6617 
6618 /**
6619  * Retrieve the spelling of a given CXBinaryOperatorKind.
6620  */
6623 
6624 /**
6625  * Retrieve the binary operator kind of this cursor.
6626  *
6627  * If this cursor is not a binary operator then returns Invalid.
6628  */
6631 
6632 /**
6633  * Describes the kind of unary operators.
6634  */
6636  /** This value describes cursors which are not unary operators. */
6638  /** Postfix increment operator. */
6640  /** Postfix decrement operator. */
6642  /** Prefix increment operator. */
6644  /** Prefix decrement operator. */
6646  /** Address of operator. */
6648  /** Dereference operator. */
6650  /** Plus operator. */
6652  /** Minus operator. */
6654  /** Not operator. */
6656  /** LNot operator. */
6658  /** "__real expr" operator. */
6660  /** "__imag expr" operator. */
6662  /** __extension__ marker operator. */
6664  /** C++ co_await operator. */
6666 };
6667 
6668 /**
6669  * Retrieve the spelling of a given CXUnaryOperatorKind.
6670  */
6673 
6674 /**
6675  * Retrieve the unary operator kind of this cursor.
6676  *
6677  * If this cursor is not a unary operator then returns Invalid.
6678  */
6681 
6682 /**
6683  * @}
6684  */
6685 
6686 /**
6687  * @}
6688  */
6689 
6691 
6692 #endif
static unsigned isEnabled(DiagnosticsEngine &D, unsigned diag)
CXErrorCode
Error codes returned by libclang routines.
Definition: CXErrorCode.h:28
#define LLVM_CLANG_C_EXTERN_C_END
Definition: ExternC.h:36
#define LLVM_CLANG_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
#define CINDEX_LINKAGE
Definition: Platform.h:38
static bool isInstanceMethod(const Decl *D)
SourceRange Range
Definition: SemaObjC.cpp:754
__device__ int
CINDEX_LINKAGE CXType clang_getIBOutletCollectionType(CXCursor)
For cursors representing an iboutletcollection attribute, this function returns the collection elemen...
CINDEX_LINKAGE unsigned clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *Results)
Determine the number of diagnostics produced prior to the location where code completion was performe...
CINDEX_LINKAGE unsigned clang_getCompletionNumFixIts(CXCodeCompleteResults *results, unsigned completion_index)
Retrieve the number of fix-its for the given completion index.
CINDEX_LINKAGE void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results)
Free the given set of code-completion results.
CINDEX_LINKAGE CXString clang_getCompletionFixIt(CXCodeCompleteResults *results, unsigned completion_index, unsigned fixit_index, CXSourceRange *replacement_range)
Fix-its that must be applied before inserting the text for the corresponding completion.
CINDEX_LINKAGE CXCompletionString clang_getCompletionChunkCompletionString(CXCompletionString completion_string, unsigned chunk_number)
Retrieve the completion string associated with a particular chunk within a completion string.
CINDEX_LINKAGE CXString clang_getCompletionBriefComment(CXCompletionString completion_string)
Retrieve the brief documentation comment attached to the declaration that corresponds to the given co...
CINDEX_LINKAGE CXCompletionString clang_getCursorCompletionString(CXCursor cursor)
Retrieve a completion string for an arbitrary declaration or macro definition cursor.
CINDEX_LINKAGE unsigned clang_getCompletionPriority(CXCompletionString completion_string)
Determine the priority of this code completion.
CINDEX_LINKAGE CXCodeCompleteResults * clang_codeCompleteAt(CXTranslationUnit TU, const char *complete_filename, unsigned complete_line, unsigned complete_column, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options)
Perform code completion at a given location in a translation unit.
CXCompletionContext
Bits that represent the context under which completion is occurring.
Definition: Index.h:5360
CINDEX_LINKAGE CXString clang_getCompletionAnnotation(CXCompletionString completion_string, unsigned annotation_number)
Retrieve the annotation associated with the given completion string.
CINDEX_LINKAGE unsigned clang_getNumCompletionChunks(CXCompletionString completion_string)
Retrieve the number of chunks in the given code-completion string.
CINDEX_LINKAGE unsigned long long clang_codeCompleteGetContexts(CXCodeCompleteResults *Results)
Determines what completions are appropriate for the context the given code completion.
CINDEX_LINKAGE enum CXCursorKind clang_codeCompleteGetContainerKind(CXCodeCompleteResults *Results, unsigned *IsIncomplete)
Returns the cursor kind for the container for the current code completion context.
CXCompletionChunkKind
Describes a single piece of text within a code-completion string.
Definition: Index.h:4930
CINDEX_LINKAGE CXString clang_getCompletionParent(CXCompletionString completion_string, enum CXCursorKind *kind)
Retrieve the parent context of the given completion string.
CINDEX_LINKAGE CXString clang_getCompletionChunkText(CXCompletionString completion_string, unsigned chunk_number)
Retrieve the text associated with a particular chunk within a completion string.
CXCodeComplete_Flags
Flags that can be passed to clang_codeCompleteAt() to modify its behavior.
Definition: Index.h:5321
CINDEX_LINKAGE CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results, unsigned Index)
Retrieve a diagnostic associated with the given code completion.
CINDEX_LINKAGE enum CXCompletionChunkKind clang_getCompletionChunkKind(CXCompletionString completion_string, unsigned chunk_number)
Determine the kind of a particular chunk within a completion string.
CINDEX_LINKAGE enum CXAvailabilityKind clang_getCompletionAvailability(CXCompletionString completion_string)
Determine the availability of the entity that this code-completion string refers to.
CINDEX_LINKAGE CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results)
Returns the currently-entered selector for an Objective-C message send, formatted like "initWithFoo:b...
CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void)
Returns a default set of code-completion options that can be passed toclang_codeCompleteAt().
CINDEX_LINKAGE unsigned clang_getCompletionNumAnnotations(CXCompletionString completion_string)
Retrieve the number of annotations associated with the given completion string.
CINDEX_LINKAGE void clang_sortCodeCompletionResults(CXCompletionResult *Results, unsigned NumResults)
Sort the code-completion results in case-insensitive alphabetical order.
CINDEX_LINKAGE CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results)
Returns the USR for the container for the current code completion context.
void * CXCompletionString
A semantic string that describes a code-completion result.
Definition: Index.h:4898
@ CXCompletionContext_AnyValue
Completions for any possible value (variables, function calls, etc.) should be included in the result...
Definition: Index.h:5376
@ CXCompletionContext_ObjCSelectorName
Completions for Objective-C selector names should be included in the results.
Definition: Index.h:5466
@ CXCompletionContext_ObjCProtocol
Completions for Objective-C protocols should be included in the results.
Definition: Index.h:5446
@ CXCompletionContext_MacroName
Completions for preprocessor macro names should be included in the results.
Definition: Index.h:5472
@ CXCompletionContext_NaturalLanguage
Natural language completions should be included in the results.
Definition: Index.h:5477
@ CXCompletionContext_AnyType
Completions for any possible type should be included in the results.
Definition: Index.h:5370
@ CXCompletionContext_StructTag
Completions for struct tags should be included in the results.
Definition: Index.h:5420
@ CXCompletionContext_CXXClassTypeValue
Completions for values that resolve to a C++ class type should be included in the results.
Definition: Index.h:5391
@ CXCompletionContext_ObjCClassMessage
Completions for Objective-C class messages should be included in the results.
Definition: Index.h:5461
@ CXCompletionContext_Unexposed
The context for completions is unexposed, as only Clang results should be included.
Definition: Index.h:5365
@ CXCompletionContext_Unknown
The current context is unknown, so set all contexts.
Definition: Index.h:5487
@ CXCompletionContext_ArrowMemberAccess
Completions for fields of the member being accessed using the arrow operator should be included in th...
Definition: Index.h:5402
@ CXCompletionContext_ObjCObjectValue
Completions for values that resolve to an Objective-C object should be included in the results.
Definition: Index.h:5381
@ CXCompletionContext_UnionTag
Completions for union tags should be included in the results.
Definition: Index.h:5416
@ CXCompletionContext_DotMemberAccess
Completions for fields of the member being accessed using the dot operator should be included in the ...
Definition: Index.h:5397
@ CXCompletionContext_NestedNameSpecifier
Completions for C++ nested name specifiers should be included in the results.
Definition: Index.h:5435
@ CXCompletionContext_ObjCPropertyAccess
Completions for properties of the Objective-C object being accessed using the dot operator should be ...
Definition: Index.h:5407
@ CXCompletionContext_ObjCInstanceMessage
Completions for Objective-C instance messages should be included in the results.
Definition: Index.h:5456
@ CXCompletionContext_ObjCInterface
Completions for Objective-C interfaces (classes) should be included in the results.
Definition: Index.h:5441
@ CXCompletionContext_EnumTag
Completions for enum tags should be included in the results.
Definition: Index.h:5412
@ CXCompletionContext_ClassTag
Completions for C++ class names should be included in the results.
Definition: Index.h:5425
@ CXCompletionContext_ObjCSelectorValue
Completions for values that resolve to an Objective-C selector should be included in the results.
Definition: Index.h:5386
@ CXCompletionContext_Namespace
Completions for C++ namespaces and namespace aliases should be included in the results.
Definition: Index.h:5430
@ CXCompletionContext_ObjCCategory
Completions for Objective-C categories should be included in the results.
Definition: Index.h:5451
@ CXCompletionContext_IncludedFile
#include file completions should be included in the results.
Definition: Index.h:5482
@ CXCompletionChunk_RightBracket
A right bracket (']').
Definition: Index.h:5042
@ CXCompletionChunk_RightBrace
A right brace ('}').
Definition: Index.h:5050
@ CXCompletionChunk_LeftBracket
A left bracket ('[').
Definition: Index.h:5038
@ CXCompletionChunk_CurrentParameter
Text that describes the current parameter when code-completion is referring to function call,...
Definition: Index.h:5024
@ CXCompletionChunk_Placeholder
Placeholder text that should be replaced by the user.
Definition: Index.h:4994
@ CXCompletionChunk_LeftAngle
A left angle bracket ('<').
Definition: Index.h:5054
@ CXCompletionChunk_Colon
A colon (':').
Definition: Index.h:5074
@ CXCompletionChunk_HorizontalSpace
Horizontal space (' ').
Definition: Index.h:5086
@ CXCompletionChunk_LeftParen
A left parenthesis ('('), used to initiate a function call or signal the beginning of a function para...
Definition: Index.h:5029
@ CXCompletionChunk_Informative
Informative text that should be displayed but never inserted as part of the template.
Definition: Index.h:5004
@ CXCompletionChunk_RightParen
A right parenthesis (')'), used to finish a function call or signal the end of a function parameter l...
Definition: Index.h:5034
@ CXCompletionChunk_SemiColon
A semicolon (';').
Definition: Index.h:5078
@ CXCompletionChunk_TypedText
Text that a user would be expected to type to get this code-completion result.
Definition: Index.h:4975
@ CXCompletionChunk_LeftBrace
A left brace ('{').
Definition: Index.h:5046
@ CXCompletionChunk_ResultType
Text that specifies the result type of a given result.
Definition: Index.h:5070
@ CXCompletionChunk_Text
Text that should be inserted as part of a code-completion result.
Definition: Index.h:4983
@ CXCompletionChunk_Comma
A comma separator (',').
Definition: Index.h:5062
@ CXCompletionChunk_Equal
An '=' sign.
Definition: Index.h:5082
@ CXCompletionChunk_Optional
A code-completion string that describes "optional" text that could be a part of the template (but is ...
Definition: Index.h:4964
@ CXCompletionChunk_VerticalSpace
Vertical space ('\n'), after which it is generally a good idea to perform indentation.
Definition: Index.h:5091
@ CXCompletionChunk_RightAngle
A right angle bracket ('>').
Definition: Index.h:5058
@ CXCodeComplete_IncludeCodePatterns
Whether to include code patterns for language constructs within the set of code completions,...
Definition: Index.h:5332
@ CXCodeComplete_IncludeBriefComments
Whether to include brief documentation within the set of code completions returned.
Definition: Index.h:5338
@ CXCodeComplete_SkipPreamble
Whether to speed up completion by omitting top- or namespace-level entities defined in the preamble.
Definition: Index.h:5345
@ CXCodeComplete_IncludeMacros
Whether to include macros within the set of code completions returned.
Definition: Index.h:5326
@ CXCodeComplete_IncludeCompletionsWithFixIts
Whether to include completions with small fix-its, e.g.
Definition: Index.h:5351
CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C)
Determine if a C++ member function or member function template is declared 'static'.
CINDEX_LINKAGE unsigned clang_CXXConstructor_isCopyConstructor(CXCursor C)
Determine if a C++ constructor is a copy constructor.
CINDEX_LINKAGE unsigned clang_CXXField_isMutable(CXCursor C)
Determine if a C++ field is declared 'mutable'.
CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C)
Determine if a C++ member function or member function template is pure virtual.
CINDEX_LINKAGE unsigned clang_CXXMethod_isMoveAssignmentOperator(CXCursor C)
Determine if a C++ member function is a move-assignment operator, returning 1 if such is the case and...
CINDEX_LINKAGE unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C)
Determine if a C++ constructor is the default constructor.
CINDEX_LINKAGE unsigned clang_CXXConstructor_isConvertingConstructor(CXCursor C)
Determine if a C++ constructor is a converting constructor.
CINDEX_LINKAGE unsigned clang_CXXMethod_isConst(CXCursor C)
Determine if a C++ member function or member function template is declared 'const'.
CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, unsigned NameFlags, unsigned PieceIndex)
Given a cursor that references something else, return the source range covering that reference.
CINDEX_LINKAGE unsigned clang_EnumDecl_isScoped(CXCursor C)
Determine if an enum declaration refers to a scoped enum.
CINDEX_LINKAGE unsigned clang_CXXConstructor_isMoveConstructor(CXCursor C)
Determine if a C++ constructor is a move constructor.
CINDEX_LINKAGE unsigned clang_CXXMethod_isExplicit(CXCursor C)
Determines if a C++ constructor or conversion function was declared explicit, returning 1 if such is ...
CINDEX_LINKAGE unsigned clang_CXXMethod_isDefaulted(CXCursor C)
Determine if a C++ method is declared '= default'.
CXNameRefFlags
Definition: Index.h:4672
CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C)
Determine if a C++ member function or member function template is explicitly declared 'virtual' or if...
CINDEX_LINKAGE unsigned clang_CXXMethod_isDeleted(CXCursor C)
Determine if a C++ method is declared '= delete'.
CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C)
Given a cursor that may represent a specialization or instantiation of a template,...
CINDEX_LINKAGE unsigned clang_CXXRecord_isAbstract(CXCursor C)
Determine if a C++ record is abstract, i.e.
CINDEX_LINKAGE unsigned clang_CXXMethod_isCopyAssignmentOperator(CXCursor C)
Determine if a C++ member function is a copy-assignment operator, returning 1 if such is the case and...
CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C)
Given a cursor that represents a template, determine the cursor kind of the specializations would be ...
@ CXNameRange_WantTemplateArgs
Include the explicit template arguments, e.g.
Definition: Index.h:4683
@ CXNameRange_WantSinglePiece
If the name is non-contiguous, return the full spanning range.
Definition: Index.h:4695
@ CXNameRange_WantQualifier
Include the nested-name-specifier, e.g.
Definition: Index.h:4677
CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor)
Retrieve the kind of the given cursor.
struct CXPlatformAvailability CXPlatformAvailability
Describes the availability of a given entity on a particular platform, e.g., a particular class might...
CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset, CXCursor cursor)
Inserts a CXCursor into a CXCursorSet.
CINDEX_LINKAGE void clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability)
Free the memory associated with a CXPlatformAvailability structure.
CINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind)
Determine whether the given cursor kind represents an attribute.
CINDEX_LINKAGE unsigned clang_Cursor_hasAttrs(CXCursor C)
Determine whether the given cursor has any attributes.
CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind)
Determine whether the given cursor kind represents a statement.
CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor)
Determine the linkage of the entity referred to by a given cursor.
CINDEX_LINKAGE enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor)
Determine the "language" of the entity referred to by a given cursor.
CXLanguageKind
Describe the "language" of the entity referred to by a cursor.
Definition: Index.h:2553
CINDEX_LINKAGE int clang_Cursor_hasVarDeclGlobalStorage(CXCursor cursor)
If cursor refers to a variable declaration that has global storage returns 1.
CXTLSKind
Describe the "thread-local storage (TLS) kind" of the declaration referred to by a cursor.
Definition: Index.h:2569
CINDEX_LINKAGE unsigned clang_CXCursorSet_contains(CXCursorSet cset, CXCursor cursor)
Queries a CXCursorSet to see if it contains a specific CXCursor.
CINDEX_LINKAGE enum CXTLSKind clang_getCursorTLSKind(CXCursor cursor)
Determine the "thread-local storage (TLS) kind" of the declaration referred to by a cursor.
CINDEX_LINKAGE CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor)
Returns the translation unit that a cursor originated from.
CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind)
Determine whether the given cursor kind represents a declaration.
CINDEX_LINKAGE CXCursor clang_Cursor_getVarDeclInitializer(CXCursor cursor)
If cursor refers to a variable declaration and it has initializer returns cursor referring to the ini...
CINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind)
CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind)
Determine whether the given cursor kind represents an invalid cursor.
CINDEX_LINKAGE unsigned clang_isExpression(enum CXCursorKind)
Determine whether the given cursor kind represents an expression.
CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor)
Returns non-zero if cursor is null.
CINDEX_LINKAGE enum CXVisibilityKind clang_getCursorVisibility(CXCursor cursor)
Describe the visibility of the entity referred to by a cursor.
CINDEX_LINKAGE CXCursor clang_getNullCursor(void)
Retrieve the NULL cursor, which represents no entity.
CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor)
Determine whether two cursors are equivalent.
CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind)
Determine whether the given cursor kind represents a translation unit.
CINDEX_LINKAGE int clang_getCursorPlatformAvailability(CXCursor cursor, int *always_deprecated, CXString *deprecated_message, int *always_unavailable, CXString *unavailable_message, CXPlatformAvailability *availability, int availability_size)
Determine the availability of the entity that this cursor refers to on any platforms for which availa...
CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind)
CINDEX_LINKAGE enum CXAvailabilityKind clang_getCursorAvailability(CXCursor cursor)
Determine the availability of the entity that this cursor refers to, taking the current target platfo...
CINDEX_LINKAGE int clang_Cursor_hasVarDeclExternalStorage(CXCursor cursor)
If cursor refers to a variable declaration that has external storage returns 1.
CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor)
Determine the semantic parent of the given cursor.
CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor)
Compute a hash value for the given cursor.
CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor, CXCursor **overridden, unsigned *num_overridden)
Determine the set of methods that are overridden by the given method.
CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden)
Free the set of overridden cursors returned by clang_getOverriddenCursors().
struct CXCursorSetImpl * CXCursorSet
A fast container representing a set of CXCursors.
Definition: Index.h:2585
CXLinkageKind
Describe the linkage of the entity referred to by a cursor.
Definition: Index.h:2386
CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor)
Determine the lexical parent of the given cursor.
CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit)
Retrieve the cursor that represents the given translation unit.
CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind)
Determine whether the given cursor kind represents a simple reference.
CINDEX_LINKAGE void clang_disposeCXCursorSet(CXCursorSet cset)
Disposes a CXCursorSet and releases its associated memory.
CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor)
Retrieve the file that is included by the given inclusion directive cursor.
CINDEX_LINKAGE CXCursorSet clang_createCXCursorSet(void)
Creates an empty CXCursorSet.
CXVisibilityKind
Definition: Index.h:2409
CINDEX_LINKAGE unsigned clang_isInvalidDeclaration(CXCursor)
Determine whether the given declaration is invalid.
@ CXLanguage_CPlusPlus
Definition: Index.h:2557
@ CXLanguage_C
Definition: Index.h:2555
@ CXLanguage_Invalid
Definition: Index.h:2554
@ CXLanguage_ObjC
Definition: Index.h:2556
@ CXTLS_None
Definition: Index.h:2569
@ CXTLS_Static
Definition: Index.h:2569
@ CXTLS_Dynamic
Definition: Index.h:2569
@ CXLinkage_NoLinkage
This is the linkage for variables, parameters, and so on that have automatic storage.
Definition: Index.h:2394
@ CXLinkage_Invalid
This value indicates that no linkage information is available for a provided CXCursor.
Definition: Index.h:2389
@ CXLinkage_Internal
This is the linkage for static variables and static functions.
Definition: Index.h:2396
@ CXLinkage_External
This is the linkage for entities with true, external linkage.
Definition: Index.h:2401
@ CXLinkage_UniqueExternal
This is the linkage for entities with external linkage that live in C++ anonymous namespaces.
Definition: Index.h:2399
@ CXVisibility_Protected
Symbol seen by the linker but resolves to a symbol inside this object.
Definition: Index.h:2417
@ CXVisibility_Hidden
Symbol not seen by the linker.
Definition: Index.h:2415
@ CXVisibility_Default
Symbol seen by the linker and acts like a normal symbol.
Definition: Index.h:2419
@ CXVisibility_Invalid
This value indicates that no visibility information is available for a provided CXCursor.
Definition: Index.h:2412
CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, CXSourceLocation)
Map a source location to the cursor that describes the entity at that location in the source code.
CINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor)
Retrieve the physical extent of the source construct referenced by the given cursor.
CINDEX_LINKAGE CXSourceLocation clang_getCursorLocation(CXCursor)
Retrieve the physical location of the source constructor referenced by the given cursor.
CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data)
Visit the children of a particular cursor.
struct _CXChildVisitResult * CXCursorVisitorBlock
Visitor invoked for each cursor found by a traversal.
Definition: Index.h:3908
CXChildVisitResult
Describes how the traversal of the children of a particular cursor should proceed after visiting a pa...
Definition: Index.h:3836
enum CXChildVisitResult(* CXCursorVisitor)(CXCursor cursor, CXCursor parent, CXClientData client_data)
Visitor invoked for each cursor found by a traversal.
Definition: Index.h:3865
CINDEX_LINKAGE unsigned clang_visitChildrenWithBlock(CXCursor parent, CXCursorVisitorBlock block)
Visits the children of a cursor using the specified block.
@ CXChildVisit_Break
Terminates the cursor traversal.
Definition: Index.h:3840
@ CXChildVisit_Recurse
Recursively traverse the children of this cursor, using the same visitor and client data.
Definition: Index.h:3850
@ CXChildVisit_Continue
Continues the cursor traversal with the next sibling of the cursor just visited, without visiting its...
Definition: Index.h:3845
CXObjCDeclQualifierKind
'Qualifiers' written next to the return and parameter types in Objective-C method declarations.
Definition: Index.h:4247
CINDEX_LINKAGE CXString clang_Cursor_getObjCPropertySetterName(CXCursor C)
Given a cursor that represents a property declaration, return the name of the method that implements ...
CINDEX_LINKAGE CXString clang_constructUSR_ObjCClass(const char *class_name)
Construct a USR for a specified Objective-C class.
CINDEX_LINKAGE unsigned clang_Cursor_isObjCOptional(CXCursor C)
Given a cursor that represents an Objective-C method or property declaration, return non-zero if the ...
CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor, unsigned pieceIndex, unsigned options)
Retrieve a range for a piece that forms the cursors spelling name.
CINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C)
Given a cursor pointing to an Objective-C message or property reference, or C++ method call,...
CINDEX_LINKAGE CXString clang_Cursor_getRawCommentText(CXCursor C)
Given a cursor that represents a declaration, return the associated comment text, including comment m...
CINDEX_LINKAGE unsigned clang_Cursor_getObjCPropertyAttributes(CXCursor C, unsigned reserved)
Given a cursor that represents a property declaration, return the associated property attributes.
CINDEX_LINKAGE unsigned clang_Cursor_isVariadic(CXCursor C)
Returns non-zero if the given cursor is a variadic function or method.
CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor)
If the cursor points to a selector identifier in an Objective-C method or message expression,...
CINDEX_LINKAGE CXString clang_getCursorUSR(CXCursor)
Retrieve a Unified Symbol Resolution (USR) for the entity referenced by the given cursor.
CINDEX_LINKAGE unsigned clang_Cursor_getObjCDeclQualifiers(CXCursor C)
Given a cursor that represents an Objective-C method or parameter declaration, return the associated ...
CINDEX_LINKAGE CXString clang_constructUSR_ObjCProtocol(const char *protocol_name)
Construct a USR for a specified Objective-C protocol.
CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor)
Determine whether the declaration pointed to by this cursor is also a definition of that entity.
CINDEX_LINKAGE CXString clang_Cursor_getBriefCommentText(CXCursor C)
Given a cursor that represents a documentable entity (e.g., declaration), return the associated.
CINDEX_LINKAGE unsigned clang_PrintingPolicy_getProperty(CXPrintingPolicy Policy, enum CXPrintingPolicyProperty Property)
Get a property value for the given printing policy.
void * CXPrintingPolicy
Opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted.
Definition: Index.h:4006
CXObjCPropertyAttrKind
Property attributes for a CXCursor_ObjCPropertyDecl.
Definition: Index.h:4204
CINDEX_LINKAGE CXString clang_Cursor_getObjCPropertyGetterName(CXCursor C)
Given a cursor that represents a property declaration, return the name of the method that implements ...
CINDEX_LINKAGE void clang_PrintingPolicy_dispose(CXPrintingPolicy Policy)
Release a printing policy.
CINDEX_LINKAGE CXString clang_constructUSR_ObjCMethod(const char *name, unsigned isInstanceMethod, CXString classUSR)
Construct a USR for a specified Objective-C method and the USR for its containing class.
CINDEX_LINKAGE CXString clang_constructUSR_ObjCIvar(const char *name, CXString classUSR)
Construct a USR for a specified Objective-C instance variable and the USR for its containing class.
CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor)
Retrieve a name for the entity referenced by this cursor.
CINDEX_LINKAGE void clang_PrintingPolicy_setProperty(CXPrintingPolicy Policy, enum CXPrintingPolicyProperty Property, unsigned Value)
Set a property value for the given printing policy.
CINDEX_LINKAGE CXPrintingPolicy clang_getCursorPrintingPolicy(CXCursor)
Retrieve the default policy for the cursor.
CINDEX_LINKAGE unsigned clang_Cursor_isExternalSymbol(CXCursor C, CXString *language, CXString *definedIn, unsigned *isGenerated)
Returns non-zero if the given cursor points to a symbol marked with external_source_symbol attribute.
CINDEX_LINKAGE CXSourceRange clang_Cursor_getCommentRange(CXCursor C)
Given a cursor that represents a declaration, return the associated comment's source range.
CINDEX_LINKAGE CXString clang_getCursorPrettyPrinted(CXCursor Cursor, CXPrintingPolicy Policy)
Pretty print declarations.
CINDEX_LINKAGE CXString clang_constructUSR_ObjCCategory(const char *class_name, const char *category_name)
Construct a USR for a specified Objective-C category.
CINDEX_LINKAGE CXCursor clang_getCursorReferenced(CXCursor)
For a cursor that is a reference, retrieve a cursor representing the entity that it references.
CINDEX_LINKAGE CXString clang_constructUSR_ObjCProperty(const char *property, CXString classUSR)
Construct a USR for a specified Objective-C property and the USR for its containing class.
CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor)
Retrieve the display name for the entity referenced by this cursor.
CINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor)
Retrieve the canonical cursor corresponding to the given cursor.
CINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C)
Given a cursor pointing to a C++ method call or an Objective-C message, returns non-zero if the metho...
CXPrintingPolicyProperty
Properties for the printing policy.
Definition: Index.h:4013
CINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor)
For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that de...
@ CXObjCDeclQualifier_Byref
Definition: Index.h:4253
@ CXObjCDeclQualifier_Inout
Definition: Index.h:4250
@ CXObjCDeclQualifier_Bycopy
Definition: Index.h:4252
@ CXObjCDeclQualifier_In
Definition: Index.h:4249
@ CXObjCDeclQualifier_None
Definition: Index.h:4248
@ CXObjCDeclQualifier_Out
Definition: Index.h:4251
@ CXObjCDeclQualifier_Oneway
Definition: Index.h:4254
@ CXObjCPropertyAttr_assign
Definition: Index.h:4208
@ CXObjCPropertyAttr_retain
Definition: Index.h:4210
@ CXObjCPropertyAttr_strong
Definition: Index.h:4216
@ CXObjCPropertyAttr_atomic
Definition: Index.h:4214
@ CXObjCPropertyAttr_noattr
Definition: Index.h:4205
@ CXObjCPropertyAttr_weak
Definition: Index.h:4215
@ CXObjCPropertyAttr_copy
Definition: Index.h:4211
@ CXObjCPropertyAttr_readwrite
Definition: Index.h:4209
@ CXObjCPropertyAttr_setter
Definition: Index.h:4213
@ CXObjCPropertyAttr_nonatomic
Definition: Index.h:4212
@ CXObjCPropertyAttr_getter
Definition: Index.h:4207
@ CXObjCPropertyAttr_readonly
Definition: Index.h:4206
@ CXObjCPropertyAttr_class
Definition: Index.h:4218
@ CXObjCPropertyAttr_unsafe_unretained
Definition: Index.h:4217
@ CXPrintingPolicy_SuppressScope
Definition: Index.h:4018
@ CXPrintingPolicy_Bool
Definition: Index.h:4026
@ CXPrintingPolicy_Alignof
Definition: Index.h:4028
@ CXPrintingPolicy_ConstantArraySizeAsWritten
Definition: Index.h:4021
@ CXPrintingPolicy_Indentation
Definition: Index.h:4014
@ CXPrintingPolicy_SuppressImplicitBase
Definition: Index.h:4038
@ CXPrintingPolicy_IncludeTagDefinition
Definition: Index.h:4017
@ CXPrintingPolicy_MSWChar
Definition: Index.h:4034
@ CXPrintingPolicy_SuppressSpecifiers
Definition: Index.h:4015
@ CXPrintingPolicy_SuppressUnwrittenScope
Definition: Index.h:4019
@ CXPrintingPolicy_LastProperty
Definition: Index.h:4041
@ CXPrintingPolicy_FullyQualifiedName
Definition: Index.h:4039
@ CXPrintingPolicy_SuppressStrongLifetime
Definition: Index.h:4023
@ CXPrintingPolicy_ConstantsAsWritten
Definition: Index.h:4037
@ CXPrintingPolicy_MSVCFormatting
Definition: Index.h:4036
@ CXPrintingPolicy_SuppressInitializers
Definition: Index.h:4020
@ CXPrintingPolicy_SuppressTagKeyword
Definition: Index.h:4016
@ CXPrintingPolicy_TerseOutput
Definition: Index.h:4031
@ CXPrintingPolicy_AnonymousTagLocations
Definition: Index.h:4022
@ CXPrintingPolicy_Half
Definition: Index.h:4033
@ CXPrintingPolicy_Restrict
Definition: Index.h:4027
@ CXPrintingPolicy_PolishForDeclaration
Definition: Index.h:4032
@ CXPrintingPolicy_UnderscoreAlignof
Definition: Index.h:4029
@ CXPrintingPolicy_SuppressLifetimeQualifiers
Definition: Index.h:4024
@ CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors
Definition: Index.h:4025
@ CXPrintingPolicy_IncludeNewlines
Definition: Index.h:4035
@ CXPrintingPolicy_UseVoidForZeroParams
Definition: Index.h:4030
CINDEX_LINKAGE void clang_enableStackTraces(void)
CINDEX_LINKAGE void clang_getDefinitionSpellingAndExtent(CXCursor, const char **startBuf, const char **endBuf, unsigned *startLine, unsigned *startColumn, unsigned *endLine, unsigned *endColumn)
CINDEX_LINKAGE CXString clang_getCursorKindSpelling(enum CXCursorKind Kind)
CINDEX_LINKAGE void clang_executeOnThread(void(*fn)(void *), void *user_data, unsigned stack_size)
void * CXDiagnosticSet
A group of CXDiagnostics.
Definition: CXDiagnostic.h:74
void * CXDiagnostic
A single diagnostic, containing the diagnostic's severity, location, text, source ranges,...
Definition: CXDiagnostic.h:69
void * CXFile
A particular source file that is part of a translation unit.
Definition: CXFile.h:34
struct _CXCursorAndRangeVisitorBlock * CXCursorAndRangeVisitorBlock
Definition: Index.h:5921
CINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfo * clang_index_getObjCInterfaceDeclInfo(const CXIdxDeclInfo *)
CINDEX_LINKAGE CXResult clang_findReferencesInFileWithBlock(CXCursor, CXFile, CXCursorAndRangeVisitorBlock)
void * CXIdxClientContainer
The client's data object that is associated with a semantic container of entities.
Definition: Index.h:5946
CINDEX_LINKAGE enum CXUnaryOperatorKind clang_getCursorUnaryOperatorKind(CXCursor cursor)
Retrieve the unary operator kind of this cursor.
CINDEX_LINKAGE CXIdxClientEntity clang_index_getClientEntity(const CXIdxEntityInfo *)
For retrieving a custom CXIdxClientEntity attached to an entity.
CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, CXFieldVisitor visitor, CXClientData client_data)
Visit the fields of a particular type.
CINDEX_LINKAGE CXResult clang_findIncludesInFile(CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor)
Find #import/#include directives in a specific file.
CINDEX_LINKAGE void clang_indexLoc_getFileLocation(CXIdxLoc loc, CXIdxClientFile *indexFile, CXFile *file, unsigned *line, unsigned *column, unsigned *offset)
Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.
CXUnaryOperatorKind
Describes the kind of unary operators.
Definition: Index.h:6635
CXIdxObjCContainerKind
Definition: Index.h:6135
CINDEX_LINKAGE int clang_indexSourceFileFullArgv(CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options)
Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0...
CINDEX_LINKAGE void clang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity)
For setting a custom CXIdxClientEntity attached to an entity.
CXIdxEntityRefKind
Data for IndexerCallbacks::indexEntityReference.
Definition: Index.h:6195
struct CXCursorAndRangeVisitor CXCursorAndRangeVisitor
CXVisitorResult
Definition: Index.h:5861
enum CXVisitorResult(* CXFieldVisitor)(CXCursor C, CXClientData client_data)
Visitor invoked for each field found by a traversal.
Definition: Index.h:6519
CINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfo * clang_index_getIBOutletCollectionAttrInfo(const CXIdxAttrInfo *)
CXIdxEntityLanguage
Definition: Index.h:6047
CXResult
Definition: Index.h:5868
CINDEX_LINKAGE const CXIdxObjCProtocolRefListInfo * clang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *)
CXBinaryOperatorKind
Describes the kind of binary operators.
Definition: Index.h:6547
CINDEX_LINKAGE const CXIdxObjCPropertyDeclInfo * clang_index_getObjCPropertyDeclInfo(const CXIdxDeclInfo *)
void * CXIdxClientFile
The client's data object that is associated with a CXFile.
Definition: Index.h:5935
CINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * clang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *)
void * CXIdxClientASTFile
The client's data object that is associated with an AST file (PCH or module).
Definition: Index.h:5952
CINDEX_LINKAGE void clang_index_setClientContainer(const CXIdxContainerInfo *, CXIdxClientContainer)
For setting a custom CXIdxClientContainer attached to a container.
CINDEX_LINKAGE CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc)
Retrieve the CXSourceLocation represented by the given CXIdxLoc.
CXIndexOptFlags
Definition: Index.h:6385
CXSymbolRole
Roles that are attributed to symbol occurrences.
Definition: Index.h:6213
CINDEX_LINKAGE CXString clang_getBinaryOperatorKindSpelling(enum CXBinaryOperatorKind kind)
Retrieve the spelling of a given CXBinaryOperatorKind.
CINDEX_LINKAGE void clang_IndexAction_dispose(CXIndexAction)
Destroy the given index action.
CINDEX_LINKAGE CXString clang_getUnaryOperatorKindSpelling(enum CXUnaryOperatorKind kind)
Retrieve the spelling of a given CXUnaryOperatorKind.
CINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options)
Index the given source file and the translation unit corresponding to that file via callbacks impleme...
CINDEX_LINKAGE CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor)
Find references of a declaration in a specific file.
void * CXIdxClientEntity
The client's data object that is associated with a semantic entity.
Definition: Index.h:5940
CINDEX_LINKAGE int clang_indexTranslationUnit(CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, CXTranslationUnit)
Index the given translation unit via callbacks implemented through IndexerCallbacks.
CINDEX_LINKAGE enum CXBinaryOperatorKind clang_getCursorBinaryOperatorKind(CXCursor cursor)
Retrieve the binary operator kind of this cursor.
CINDEX_LINKAGE CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit, CXFile, CXCursorAndRangeVisitorBlock)
CXIdxDeclInfoFlags
Definition: Index.h:6107
CINDEX_LINKAGE const CXIdxObjCCategoryDeclInfo * clang_index_getObjCCategoryDeclInfo(const CXIdxDeclInfo *)
void * CXIndexAction
An indexing action/session, to be applied to one or multiple translation units.
Definition: Index.h:6367
CINDEX_LINKAGE CXIdxClientContainer clang_index_getClientContainer(const CXIdxContainerInfo *)
For retrieving a custom CXIdxClientContainer attached to a container.
CXIdxAttrKind
Definition: Index.h:6072
CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind(CXIdxEntityKind)
CXIdxEntityKind
Definition: Index.h:6011
CINDEX_LINKAGE const CXIdxCXXClassDeclInfo * clang_index_getCXXClassDeclInfo(const CXIdxDeclInfo *)
CINDEX_LINKAGE CXIndexAction clang_IndexAction_create(CXIndex CIdx)
An indexing action/session, to be applied to one or multiple translation units.
CXIdxEntityCXXTemplateKind
Extra C++ template information for an entity.
Definition: Index.h:6065
@ CXUnaryOperator_Minus
Minus operator.
Definition: Index.h:6653
@ CXUnaryOperator_Coawait
C++ co_await operator.
Definition: Index.h:6665
@ CXUnaryOperator_PreInc
Prefix increment operator.
Definition: Index.h:6643
@ CXUnaryOperator_PostDec
Postfix decrement operator.
Definition: Index.h:6641
@ CXUnaryOperator_Plus
Plus operator.
Definition: Index.h:6651
@ CXUnaryOperator_PreDec
Prefix decrement operator.
Definition: Index.h:6645
@ CXUnaryOperator_AddrOf
Address of operator.
Definition: Index.h:6647
@ CXUnaryOperator_Deref
Dereference operator.
Definition: Index.h:6649
@ CXUnaryOperator_PostInc
Postfix increment operator.
Definition: Index.h:6639
@ CXUnaryOperator_Invalid
This value describes cursors which are not unary operators.
Definition: Index.h:6637
@ CXUnaryOperator_Extension
extension marker operator.
Definition: Index.h:6663
@ CXUnaryOperator_Not
Not operator.
Definition: Index.h:6655
@ CXUnaryOperator_LNot
LNot operator.
Definition: Index.h:6657
@ CXUnaryOperator_Real
"__real expr" operator.
Definition: Index.h:6659
@ CXUnaryOperator_Imag
"__imag expr" operator.
Definition: Index.h:6661
@ CXIdxObjCContainer_Interface
Definition: Index.h:6137
@ CXIdxObjCContainer_Implementation
Definition: Index.h:6138
@ CXIdxObjCContainer_ForwardRef
Definition: Index.h:6136
@ CXIdxEntityRef_Implicit
An implicit reference, e.g.
Definition: Index.h:6204
@ CXIdxEntityRef_Direct
The entity is referenced directly in user's code.
Definition: Index.h:6199
@ CXVisit_Break
Definition: Index.h:5861
@ CXVisit_Continue
Definition: Index.h:5861
@ CXIdxEntityLang_None
Definition: Index.h:6048
@ CXIdxEntityLang_CXX
Definition: Index.h:6051
@ CXIdxEntityLang_C
Definition: Index.h:6049
@ CXIdxEntityLang_ObjC
Definition: Index.h:6050
@ CXIdxEntityLang_Swift
Definition: Index.h:6052
@ CXResult_VisitBreak
The function was terminated by a callback (e.g.
Definition: Index.h:5881
@ CXResult_Success
Function returned successfully.
Definition: Index.h:5872
@ CXResult_Invalid
One of the parameters was invalid for the function.
Definition: Index.h:5876
@ CXBinaryOperator_XorAssign
Bitwise XOR assignment operator.
Definition: Index.h:6611
@ CXBinaryOperator_EQ
Equal operator.
Definition: Index.h:6579
@ CXBinaryOperator_Add
Addition operator.
Definition: Index.h:6561
@ CXBinaryOperator_Cmp
C++ three-way comparison (spaceship) operator.
Definition: Index.h:6569
@ CXBinaryOperator_AndAssign
Bitwise AND assignment operator.
Definition: Index.h:6609
@ CXBinaryOperator_Shr
Bitwise shift right operator.
Definition: Index.h:6567
@ CXBinaryOperator_Comma
Comma operator.
Definition: Index.h:6615
@ CXBinaryOperator_ShlAssign
Bitwise shift left assignment operator.
Definition: Index.h:6605
@ CXBinaryOperator_Sub
Subtraction operator.
Definition: Index.h:6563
@ CXBinaryOperator_LE
Less or equal operator.
Definition: Index.h:6575
@ CXBinaryOperator_PtrMemI
C++ Pointer - to - member operator.
Definition: Index.h:6553
@ CXBinaryOperator_LT
Less than operator.
Definition: Index.h:6571
@ CXBinaryOperator_NE
Not equal operator.
Definition: Index.h:6581
@ CXBinaryOperator_LOr
Logical OR operator.
Definition: Index.h:6591
@ CXBinaryOperator_And
Bitwise AND operator.
Definition: Index.h:6583
@ CXBinaryOperator_ShrAssign
Bitwise shift right assignment operator.
Definition: Index.h:6607
@ CXBinaryOperator_RemAssign
Remainder assignment operator.
Definition: Index.h:6599
@ CXBinaryOperator_Or
Bitwise OR operator.
Definition: Index.h:6587
@ CXBinaryOperator_Assign
Assignment operator.
Definition: Index.h:6593
@ CXBinaryOperator_Xor
Bitwise XOR operator.
Definition: Index.h:6585
@ CXBinaryOperator_LAnd
Logical AND operator.
Definition: Index.h:6589
@ CXBinaryOperator_Mul
Multiplication operator.
Definition: Index.h:6555
@ CXBinaryOperator_GE
Greater or equal operator.
Definition: Index.h:6577
@ CXBinaryOperator_MulAssign
Multiplication assignment operator.
Definition: Index.h:6595
@ CXBinaryOperator_Rem
Remainder operator.
Definition: Index.h:6559
@ CXBinaryOperator_PtrMemD
C++ Pointer - to - member operator.
Definition: Index.h:6551
@ CXBinaryOperator_SubAssign
Subtraction assignment operator.
Definition: Index.h:6603
@ CXBinaryOperator_AddAssign
Addition assignment operator.
Definition: Index.h:6601
@ CXBinaryOperator_Div
Division operator.
Definition: Index.h:6557
@ CXBinaryOperator_Shl
Bitwise shift left operator.
Definition: Index.h:6565
@ CXBinaryOperator_GT
Greater than operator.
Definition: Index.h:6573
@ CXBinaryOperator_Invalid
This value describes cursors which are not binary operators.
Definition: Index.h:6549
@ CXBinaryOperator_OrAssign
Bitwise OR assignment operator.
Definition: Index.h:6613
@ CXBinaryOperator_DivAssign
Division assignment operator.
Definition: Index.h:6597
@ CXIndexOpt_None
Used to indicate that no special indexing options are needed.
Definition: Index.h:6389
@ CXIndexOpt_SkipParsedBodiesInSession
Skip a function/method body that was already parsed during an indexing session associated with a CXIn...
Definition: Index.h:6420
@ CXIndexOpt_SuppressRedundantRefs
Used to indicate that IndexerCallbacks::indexEntityReference should be invoked for only one reference...
Definition: Index.h:6396
@ CXIndexOpt_SuppressWarnings
Suppress all compiler warnings when parsing for indexing.
Definition: Index.h:6413
@ CXIndexOpt_IndexImplicitTemplateInstantiations
Implicit function/class template instantiations should be indexed.
Definition: Index.h:6408
@ CXIndexOpt_IndexFunctionLocalSymbols
Function-local symbols should be indexed.
Definition: Index.h:6402
@ CXSymbolRole_Read
Definition: Index.h:6218
@ CXSymbolRole_Reference
Definition: Index.h:6217
@ CXSymbolRole_Write
Definition: Index.h:6219
@ CXSymbolRole_Definition
Definition: Index.h:6216
@ CXSymbolRole_Dynamic
Definition: Index.h:6221
@ CXSymbolRole_AddressOf
Definition: Index.h:6222
@ CXSymbolRole_Implicit
Definition: Index.h:6223
@ CXSymbolRole_None
Definition: Index.h:6214
@ CXSymbolRole_Call
Definition: Index.h:6220
@ CXSymbolRole_Declaration
Definition: Index.h:6215
@ CXIdxDeclFlag_Skipped
Definition: Index.h:6107
@ CXIdxAttr_IBOutlet
Definition: Index.h:6075
@ CXIdxAttr_Unexposed
Definition: Index.h:6073
@ CXIdxAttr_IBAction
Definition: Index.h:6074
@ CXIdxAttr_IBOutletCollection
Definition: Index.h:6076
@ CXIdxEntity_Field
Definition: Index.h:6016
@ CXIdxEntity_ObjCCategory
Definition: Index.h:6021
@ CXIdxEntity_CXXConversionFunction
Definition: Index.h:6040
@ CXIdxEntity_CXXNamespaceAlias
Definition: Index.h:6034
@ CXIdxEntity_CXXConcept
Definition: Index.h:6043
@ CXIdxEntity_CXXStaticVariable
Definition: Index.h:6035
@ CXIdxEntity_Function
Definition: Index.h:6014
@ CXIdxEntity_Enum
Definition: Index.h:6028
@ CXIdxEntity_CXXInstanceMethod
Definition: Index.h:6037
@ CXIdxEntity_CXXStaticMethod
Definition: Index.h:6036
@ CXIdxEntity_CXXTypeAlias
Definition: Index.h:6041
@ CXIdxEntity_Struct
Definition: Index.h:6029
@ CXIdxEntity_ObjCInstanceMethod
Definition: Index.h:6023
@ CXIdxEntity_EnumConstant
Definition: Index.h:6017
@ CXIdxEntity_Variable
Definition: Index.h:6015
@ CXIdxEntity_CXXClass
Definition: Index.h:6032
@ CXIdxEntity_ObjCIvar
Definition: Index.h:6026
@ CXIdxEntity_CXXInterface
Definition: Index.h:6042
@ CXIdxEntity_CXXConstructor
Definition: Index.h:6038
@ CXIdxEntity_ObjCClassMethod
Definition: Index.h:6024
@ CXIdxEntity_CXXNamespace
Definition: Index.h:6033
@ CXIdxEntity_ObjCClass
Definition: Index.h:6019
@ CXIdxEntity_ObjCProperty
Definition: Index.h:6025
@ CXIdxEntity_Typedef
Definition: Index.h:6013
@ CXIdxEntity_Union
Definition: Index.h:6030
@ CXIdxEntity_ObjCProtocol
Definition: Index.h:6020
@ CXIdxEntity_Unexposed
Definition: Index.h:6012
@ CXIdxEntity_CXXDestructor
Definition: Index.h:6039
@ CXIdxEntity_NonTemplate
Definition: Index.h:6066
@ CXIdxEntity_Template
Definition: Index.h:6067
@ CXIdxEntity_TemplatePartialSpecialization
Definition: Index.h:6068
@ CXIdxEntity_TemplateSpecialization
Definition: Index.h:6069
CINDEX_LINKAGE CXString clang_getTokenSpelling(CXTranslationUnit, CXToken)
Determine the spelling of the given token.
CINDEX_LINKAGE CXToken * clang_getToken(CXTranslationUnit TU, CXSourceLocation Location)
Get the raw lexical token starting with the given location.
CINDEX_LINKAGE CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken)
Retrieve a source range that covers the given token.
CINDEX_LINKAGE void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, CXToken **Tokens, unsigned *NumTokens)
Tokenize the source code described by the given range into raw lexical tokens.
CINDEX_LINKAGE CXSourceLocation clang_getTokenLocation(CXTranslationUnit, CXToken)
Retrieve the source location of the given token.
CINDEX_LINKAGE CXTokenKind clang_getTokenKind(CXToken)
Determine the kind of the given token.
CINDEX_LINKAGE void clang_disposeTokens(CXTranslationUnit TU, CXToken *Tokens, unsigned NumTokens)
Free the given set of tokens.
CINDEX_LINKAGE void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, unsigned NumTokens, CXCursor *Cursors)
Annotate the given set of tokens by providing cursors for each token that can be mapped to a specific...
CXTokenKind
Describes a kind of token.
Definition: Index.h:4715
@ CXToken_Identifier
An identifier (that is not a keyword).
Definition: Index.h:4729
@ CXToken_Punctuation
A token that contains some kind of punctuation.
Definition: Index.h:4719
@ CXToken_Comment
A comment.
Definition: Index.h:4739
@ CXToken_Keyword
A language keyword.
Definition: Index.h:4724
@ CXToken_Literal
A numeric, string, or character literal.
Definition: Index.h:4734
CINDEX_LINKAGE CXStringSet * clang_Cursor_getObjCManglings(CXCursor)
Retrieve the CXStrings representing the mangled symbols of the ObjC class interface or implementation...
CINDEX_LINKAGE CXStringSet * clang_Cursor_getCXXManglings(CXCursor)
Retrieve the CXStrings representing the mangled symbols of the C++ constructor or destructor at the c...
CINDEX_LINKAGE CXString clang_Cursor_getMangling(CXCursor)
Retrieve the CXString representing the mangled name of the cursor.
void(* CXInclusionVisitor)(CXFile included_file, CXSourceLocation *inclusion_stack, unsigned include_len, CXClientData client_data)
Visitor invoked for each file in a translation unit (used with clang_getInclusions()).
Definition: Index.h:5703
CINDEX_LINKAGE CXString clang_getClangVersion(void)
Return a version string, suitable for showing to a user, but not intended to be parsed (the format is...
CINDEX_LINKAGE void clang_getInclusions(CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data)
Visit the set of preprocessor inclusions in a translation unit.
CINDEX_LINKAGE unsigned long long clang_EvalResult_getAsUnsigned(CXEvalResult E)
Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsign...
CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled)
Enable/disable crash recovery.
CINDEX_LINKAGE long long clang_EvalResult_getAsLongLong(CXEvalResult E)
Returns the evaluation result as a long long integer if the kind is Int.
CINDEX_LINKAGE const char * clang_EvalResult_getAsStr(CXEvalResult E)
Returns the evaluation result as a constant string if the kind is other than Int or float.
CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate(CXCursor C)
If cursor is a statement declaration tries to evaluate the statement and if its variable,...
CINDEX_LINKAGE double clang_EvalResult_getAsDouble(CXEvalResult E)
Returns the evaluation result as double if the kind is double.
CXEvalResultKind
Definition: Index.h:5718
CINDEX_LINKAGE int clang_EvalResult_getAsInt(CXEvalResult E)
Returns the evaluation result as integer if the kind is Int.
void * CXEvalResult
Evaluation result of a cursor.
Definition: Index.h:5733
CINDEX_LINKAGE unsigned clang_EvalResult_isUnsignedInt(CXEvalResult E)
Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer...
CINDEX_LINKAGE CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E)
Returns the kind of the evaluated result.
CINDEX_LINKAGE void clang_EvalResult_dispose(CXEvalResult E)
Disposes the created Eval memory.
@ CXEval_UnExposed
Definition: Index.h:5726
@ CXEval_Other
Definition: Index.h:5724
@ CXEval_Float
Definition: Index.h:5720
@ CXEval_Int
Definition: Index.h:5719
@ CXEval_CFStr
Definition: Index.h:5723
@ CXEval_StrLiteral
Definition: Index.h:5722
@ CXEval_ObjCStrLiteral
Definition: Index.h:5721
CINDEX_LINKAGE CXFile clang_Module_getTopLevelHeader(CXTranslationUnit, CXModule Module, unsigned Index)
CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module)
CINDEX_LINKAGE int clang_Module_isSystem(CXModule Module)
CINDEX_LINKAGE CXModule clang_getModuleForFile(CXTranslationUnit, CXFile)
Given a CXFile header file, return the module that contains it, if one exists.
CINDEX_LINKAGE CXString clang_Module_getName(CXModule Module)
CINDEX_LINKAGE CXModule clang_Module_getParent(CXModule Module)
void * CXModule
Definition: Index.h:4353
CINDEX_LINKAGE CXFile clang_Module_getASTFile(CXModule Module)
CINDEX_LINKAGE CXModule clang_Cursor_getModule(CXCursor C)
Given a CXCursor_ModuleImportDecl cursor, return the associated module.
CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit, CXModule Module)
void * CXRemapping
A remapping of original source files and their translated files.
Definition: Index.h:5804
CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping)
Determine the number of remappings.
CINDEX_LINKAGE void clang_remap_getFilenames(CXRemapping, unsigned index, CXString *original, CXString *transformed)
Get the original and the associated filename from the remapping.
CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *path)
Retrieve a remapping.
CINDEX_LINKAGE CXRemapping clang_getRemappingsFromFileList(const char **filePaths, unsigned numFiles)
Retrieve a remapping.
CINDEX_LINKAGE void clang_remap_dispose(CXRemapping)
Dispose the remapping.
CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx, const char *ast_filename)
Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code.
CINDEX_LINKAGE enum CXErrorCode clang_parseTranslationUnit2FullArgv(CXIndex CIdx, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options, CXTranslationUnit *out_TU)
Same as clang_parseTranslationUnit2 but requires a full command line for command_line_args including ...
CXTUResourceUsageKind
Categorizes how memory is being used by a translation unit.
Definition: Index.h:1089
CINDEX_LINKAGE CXTargetInfo clang_getTranslationUnitTargetInfo(CXTranslationUnit CTUnit)
Get target information for this translation unit.
CINDEX_LINKAGE CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options)
Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code.
CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void)
Returns the set of flags that is suitable for parsing a translation unit that is being edited.
CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName, unsigned options)
Saves a translation unit into a serialized representation of that translation unit on disk.
struct CXTUResourceUsage CXTUResourceUsage
The memory usage of a CXTranslationUnit, broken into categories.
CINDEX_LINKAGE enum CXErrorCode clang_parseTranslationUnit2(CXIndex CIdx, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options, CXTranslationUnit *out_TU)
Parse the given source file and the translation unit corresponding to that file.
CXSaveTranslationUnit_Flags
Flags that control how translation units are saved.
Definition: Index.h:922
CINDEX_LINKAGE unsigned clang_defaultSaveOptions(CXTranslationUnit TU)
Returns the set of flags that is suitable for saving a translation unit.
CINDEX_LINKAGE int clang_reparseTranslationUnit(CXTranslationUnit TU, unsigned num_unsaved_files, struct CXUnsavedFile *unsaved_files, unsigned options)
Reparse the source files that produced this translation unit.
CINDEX_LINKAGE int clang_TargetInfo_getPointerWidth(CXTargetInfo Info)
Get the pointer width of the target in bits.
CXSaveError
Describes the kind of error that occurred (if any) in a call to clang_saveTranslationUnit().
Definition: Index.h:944
CINDEX_LINKAGE enum CXErrorCode clang_createTranslationUnit2(CXIndex CIdx, const char *ast_filename, CXTranslationUnit *out_TU)
Create a translation unit from an AST file (-emit-ast).
CINDEX_LINKAGE CXString clang_TargetInfo_getTriple(CXTargetInfo Info)
Get the normalized target triple as a string.
CINDEX_LINKAGE CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit)
Get the original translation unit source file name.
struct CXTUResourceUsageEntry CXTUResourceUsageEntry
CINDEX_LINKAGE CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU)
Return the memory usage of a translation unit.
CXTranslationUnit_Flags
Flags that control the creation of translation units.
Definition: Index.h:679
CXReparse_Flags
Flags that control the reparsing of translation units.
Definition: Index.h:1023
CINDEX_LINKAGE const char * clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind)
Returns the human-readable null-terminated C string that represents the name of the memory category.
CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU)
Returns the set of flags that is suitable for reparsing a translation unit.
CINDEX_LINKAGE void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage)
CINDEX_LINKAGE unsigned clang_suspendTranslationUnit(CXTranslationUnit)
Suspend a translation unit in order to free memory associated with it.
CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit)
Destroy the specified CXTranslationUnit object.
CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile(CXIndex CIdx, const char *source_filename, int num_clang_command_line_args, const char *const *clang_command_line_args, unsigned num_unsaved_files, struct CXUnsavedFile *unsaved_files)
Return the CXTranslationUnit for a given source file and the provided command line arguments one woul...
CINDEX_LINKAGE void clang_TargetInfo_dispose(CXTargetInfo Info)
Destroy the CXTargetInfo object.
@ CXTUResourceUsage_PreprocessingRecord
Definition: Index.h:1101
@ CXTUResourceUsage_AST
Definition: Index.h:1090
@ CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN
Definition: Index.h:1104
@ CXTUResourceUsage_Last
Definition: Index.h:1109
@ CXTUResourceUsage_ExternalASTSource_Membuffer_MMap
Definition: Index.h:1099
@ CXTUResourceUsage_SourceManager_DataStructures
Definition: Index.h:1102
@ CXTUResourceUsage_Selectors
Definition: Index.h:1092
@ CXTUResourceUsage_First
Definition: Index.h:1108
@ CXTUResourceUsage_Preprocessor_HeaderSearch
Definition: Index.h:1103
@ CXTUResourceUsage_MEMORY_IN_BYTES_END
Definition: Index.h:1105
@ CXTUResourceUsage_AST_SideTables
Definition: Index.h:1095
@ CXTUResourceUsage_Preprocessor
Definition: Index.h:1100
@ CXTUResourceUsage_SourceManager_Membuffer_Malloc
Definition: Index.h:1096
@ CXTUResourceUsage_SourceManagerContentCache
Definition: Index.h:1094
@ CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc
Definition: Index.h:1098
@ CXTUResourceUsage_Identifiers
Definition: Index.h:1091
@ CXTUResourceUsage_GlobalCompletionResults
Definition: Index.h:1093
@ CXTUResourceUsage_SourceManager_Membuffer_MMap
Definition: Index.h:1097
@ CXSaveTranslationUnit_None
Used to indicate that no special saving options are needed.
Definition: Index.h:926
@ CXSaveError_Unknown
Indicates that an unknown error occurred while attempting to save the file.
Definition: Index.h:957
@ CXSaveError_InvalidTU
Indicates that the translation unit to be saved was somehow invalid (e.g., NULL).
Definition: Index.h:972
@ CXSaveError_TranslationErrors
Indicates that errors during translation prevented this attempt to save the translation unit.
Definition: Index.h:966
@ CXSaveError_None
Indicates that no error occurred while saving a translation unit.
Definition: Index.h:948
@ CXTranslationUnit_CacheCompletionResults
Used to indicate that the translation unit should cache some code-completion results with each repars...
Definition: Index.h:735
@ CXTranslationUnit_CXXChainedPCH
DEPRECATED: Enabled chained precompiled preambles in C++.
Definition: Index.h:752
@ CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles
Used to indicate that non-errors from included files should be ignored.
Definition: Index.h:820
@ CXTranslationUnit_PrecompiledPreamble
Used to indicate that the translation unit should be built with an implicit precompiled header for th...
Definition: Index.h:725
@ CXTranslationUnit_VisitImplicitAttributes
Used to indicate that implicit attributes should be visited.
Definition: Index.h:810
@ CXTranslationUnit_SingleFileParse
Sets the preprocessor in a mode for parsing a single file only.
Definition: Index.h:792
@ CXTranslationUnit_ForSerialization
Used to indicate that the translation unit will be serialized with clang_saveTranslationUnit.
Definition: Index.h:744
@ CXTranslationUnit_DetailedPreprocessingRecord
Used to indicate that the parser should construct a "detailed" preprocessing record,...
Definition: Index.h:696
@ CXTranslationUnit_CreatePreambleOnFirstParse
Used to indicate that the precompiled preamble should be created on the first parse.
Definition: Index.h:776
@ CXTranslationUnit_IncludeAttributedTypes
Used to indicate that attributed types should be included in CXType.
Definition: Index.h:805
@ CXTranslationUnit_RetainExcludedConditionalBlocks
Tells the preprocessor not to skip excluded conditional blocks.
Definition: Index.h:825
@ CXTranslationUnit_SkipFunctionBodies
Used to indicate that function/method bodies should be skipped while parsing.
Definition: Index.h:761
@ CXTranslationUnit_Incomplete
Used to indicate that the translation unit is incomplete.
Definition: Index.h:709
@ CXTranslationUnit_IncludeBriefCommentsInCodeCompletion
Used to indicate that brief documentation comments should be included into the set of code completion...
Definition: Index.h:768
@ CXTranslationUnit_KeepGoing
Do not stop processing when fatal errors are encountered.
Definition: Index.h:787
@ CXTranslationUnit_None
Used to indicate that no special translation-unit options are needed.
Definition: Index.h:684
@ CXTranslationUnit_LimitSkipFunctionBodiesToPreamble
Used in combination with CXTranslationUnit_SkipFunctionBodies to constrain the skipping of function b...
Definition: Index.h:800
@ CXReparse_None
Used to indicate that no special reparsing options are needed.
Definition: Index.h:1027
CINDEX_LINKAGE long long clang_Type_getSizeOf(CXType T)
Return the size of a type in bytes as per C++[expr.sizeof] standard.
CX_StorageClass
Represents the storage classes as declared in the source.
Definition: Index.h:3752
CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type)
Returns the Objective-C type encoding for the specified CXType.
CINDEX_LINKAGE unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue(CXCursor C, unsigned I)
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specia...
CINDEX_LINKAGE CXCursor clang_getTypeDeclaration(CXType T)
Return the cursor for the declaration of the given type.
CINDEX_LINKAGE CXType clang_getEnumDeclIntegerType(CXCursor C)
Retrieve the integer type of an enum declaration.
CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike(CXCursor C)
Determine whether a CXCursor that is a macro, is function like.
CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T)
Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that ma...
CINDEX_LINKAGE int clang_Type_getNumTemplateArguments(CXType T)
Returns the number of template arguments for given template specialization, or -1 if type T is not a ...
CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor)
Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.
CXTypeNullabilityKind
Definition: Index.h:3525
CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor)
Returns the storage class for a function or variable declaration.
CINDEX_LINKAGE unsigned clang_Type_getNumObjCProtocolRefs(CXType T)
Retrieve the number of protocol references associated with an ObjC object/id.
CX_CXXAccessSpecifier
Represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier.
Definition: Index.h:3732
CXRefQualifierKind
Definition: Index.h:3689
CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic(CXType T)
Return 1 if the CXType is a variadic function type, and 0 otherwise.
CINDEX_LINKAGE CXType clang_getResultType(CXType T)
Retrieve the return type associated with a function type.
CINDEX_LINKAGE CXType clang_getNonReferenceType(CXType CT)
For reference types (e.g., "const int&"), returns the type that the reference refers to (e....
CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C)
Returns the Objective-C type encoding for the specified declaration.
CINDEX_LINKAGE unsigned clang_isPODType(CXType T)
Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.
CINDEX_LINKAGE CXType clang_Type_getClassType(CXType T)
Return the class type of an member pointer type.
CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C, unsigned I)
Retrieve the value of an Integral TemplateArgument (of a function decl representing a template specia...
CXCallingConv
Describes the calling convention of a function type.
Definition: Index.h:2985
CINDEX_LINKAGE CXType clang_Type_getObjCObjectBaseType(CXType T)
Retrieves the base type of the ObjCObjectType.
CINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C)
Retrieve the number of non-variadic arguments associated with a given cursor.
CINDEX_LINKAGE unsigned clang_Cursor_isAnonymousRecordDecl(CXCursor C)
Determine whether the given cursor represents an anonymous record declaration.
CINDEX_LINKAGE CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i)
Retrieve the argument cursor of a function or method.
CINDEX_LINKAGE CXType clang_getArgType(CXType T, unsigned i)
Retrieve the type of a parameter of a function type.
CINDEX_LINKAGE CXType clang_Type_getObjCTypeArg(CXType T, unsigned i)
Retrieve a type argument associated with an ObjC object.
CINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C)
Retrieve the return type associated with a given cursor.
CINDEX_LINKAGE long long clang_getEnumConstantDeclValue(CXCursor C)
Retrieve the integer value of an enum constant declaration as a signed long long.
CINDEX_LINKAGE CXString clang_getTypeKindSpelling(enum CXTypeKind K)
Retrieve the spelling of a given CXTypeKind.
CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C)
Determine whether the given cursor represents an anonymous tag or namespace.
CINDEX_LINKAGE CXType clang_Type_getModifiedType(CXType T)
Return the type that was modified by this attributed type.
CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor)
Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.
CINDEX_LINKAGE int clang_getNumArgTypes(CXType T)
Retrieve the number of non-variadic parameters associated with a function type.
CINDEX_LINKAGE CXType clang_getArrayElementType(CXType T)
Return the element type of an array type.
CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C)
Returns non-zero if the cursor specifies a Record member that is a bit-field.
CINDEX_LINKAGE CXString clang_getTypedefName(CXType CT)
Returns the typedef name of the given type.
CINDEX_LINKAGE enum CXTypeNullabilityKind clang_Type_getNullability(CXType T)
Retrieve the nullability kind of a pointer type.
CINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C)
Retrieve the bit width of a bit-field declaration as an integer.
CINDEX_LINKAGE CXType clang_getUnqualifiedType(CXType CT)
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
CINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T)
Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may h...
CINDEX_LINKAGE CXType clang_getTypedefDeclUnderlyingType(CXCursor C)
Retrieve the underlying type of a typedef declaration.
CINDEX_LINKAGE unsigned clang_getAddressSpace(CXType T)
Returns the address space of the given type.
CINDEX_LINKAGE unsigned clang_Type_getNumObjCTypeArgs(CXType T)
Retrieve the number of type arguments associated with an ObjC object.
CINDEX_LINKAGE long long clang_getArraySize(CXType T)
Return the array size of a constant array.
CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C)
Determine whether a CXCursor that is a function declaration, is an inline declaration.
CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i)
Returns the type template argument of a template class specialization at given index.
CINDEX_LINKAGE int clang_getExceptionSpecificationType(CXType T)
Retrieve the exception specification type associated with a function type.
CINDEX_LINKAGE unsigned clang_Type_isTransparentTagTypedef(CXType T)
Determine if a typedef is 'transparent' tag.
CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T)
Retrieve the ref-qualifier kind of a function or method.
CINDEX_LINKAGE int clang_Cursor_getNumTemplateArguments(CXCursor C)
Returns the number of template args of a function, struct, or class decl representing a template spec...
CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C)
Return the offset of the field represented by the Cursor.
CINDEX_LINKAGE CXType clang_getCanonicalType(CXType T)
Return the canonical type for a CXType.
CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(CXType T)
Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that ma...
CXTypeKind
Describes the kind of type.
Definition: Index.h:2813
CINDEX_LINKAGE CXType clang_getCursorType(CXCursor C)
Retrieve the type of a CXCursor (if any).
CXTypeLayoutError
List the possible error codes for clang_Type_getSizeOf, clang_Type_getAlignOf, clang_Type_getOffsetOf...
Definition: Index.h:3568
CINDEX_LINKAGE CXType clang_getPointeeType(CXType T)
For pointer types, returns the type of the pointee.
CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor, unsigned index)
Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef c...
CINDEX_LINKAGE CXType clang_getElementType(CXType T)
Return the element type of an array, complex, or vector type.
CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S)
Return the offset of a field named S in a record of type T in bits as it would be returned by offseto...
CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor)
Returns the access control level for the referenced object.
CINDEX_LINKAGE CXCursor clang_Type_getObjCProtocolDecl(CXType T, unsigned i)
Retrieve the decl for a protocol reference for an ObjC object/id.
CINDEX_LINKAGE unsigned clang_equalTypes(CXType A, CXType B)
Determine whether two CXTypes represent the same type.
CINDEX_LINKAGE long long clang_getNumElements(CXType T)
Return the number of elements of an array or vector type.
CINDEX_LINKAGE CXType clang_Type_getNamedType(CXType T)
Retrieve the type named by the qualified-id.
CINDEX_LINKAGE CXString clang_getTypeSpelling(CXType CT)
Pretty-print the underlying type using the rules of the language of the translation unit from which i...
CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C)
Determine whether a CXCursor that is a macro, is a builtin one.
CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind(CXCursor C, unsigned I)
Retrieve the kind of the I'th template argument of the CXCursor C.
CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T)
Retrieve the calling convention associated with a function type.
CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType(CXCursor C, unsigned I)
Retrieve a CXType representing the type of a TemplateArgument of a function decl representing a templ...
CINDEX_LINKAGE CXType clang_Type_getValueType(CXType CT)
Gets the type contained by this atomic type.
CINDEX_LINKAGE int clang_getCursorExceptionSpecificationType(CXCursor C)
Retrieve the exception specification type associated with a given cursor.
CINDEX_LINKAGE long long clang_Type_getAlignOf(CXType T)
Return the alignment of a type in bytes as per C++[expr.alignof] standard.
CXTemplateArgumentKind
Describes the kind of a template argument.
Definition: Index.h:3121
CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C)
Retrieve the integer value of an enum constant declaration as an unsigned long long.
CINDEX_LINKAGE unsigned clang_Cursor_isInlineNamespace(CXCursor C)
Determine whether the given cursor represents an inline namespace declaration.
@ CX_SC_Register
Definition: Index.h:3760
@ CX_SC_Static
Definition: Index.h:3756
@ CX_SC_Auto
Definition: Index.h:3759
@ CX_SC_PrivateExtern
Definition: Index.h:3757
@ CX_SC_OpenCLWorkGroupLocal
Definition: Index.h:3758
@ CX_SC_None
Definition: Index.h:3754
@ CX_SC_Extern
Definition: Index.h:3755
@ CX_SC_Invalid
Definition: Index.h:3753
@ CXTypeNullability_Nullable
Values of this type can be null.
Definition: Index.h:3533
@ CXTypeNullability_Invalid
Nullability is not applicable to this type.
Definition: Index.h:3544
@ CXTypeNullability_Unspecified
Whether values of this type can be null is (explicitly) unspecified.
Definition: Index.h:3540
@ CXTypeNullability_NonNull
Values of this type can never be null.
Definition: Index.h:3529
@ CXTypeNullability_NullableResult
Generally behaves like Nullable, except when used in a block parameter that was imported into a swift...
Definition: Index.h:3552
@ CX_CXXPrivate
Definition: Index.h:3736
@ CX_CXXInvalidAccessSpecifier
Definition: Index.h:3733
@ CX_CXXProtected
Definition: Index.h:3735
@ CX_CXXPublic
Definition: Index.h:3734
@ CXRefQualifier_LValue
An lvalue ref-qualifier was provided (&).
Definition: Index.h:3693
@ CXRefQualifier_None
No ref-qualifier was provided.
Definition: Index.h:3691
@ CXRefQualifier_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Index.h:3695
@ CXCallingConv_RISCVVectorCall
Definition: Index.h:3009
@ CXCallingConv_Swift
Definition: Index.h:3001
@ CXCallingConv_X86_64SysV
Definition: Index.h:2999
@ CXCallingConv_X86StdCall
Definition: Index.h:2988
@ CXCallingConv_PreserveNone
Definition: Index.h:3008
@ CXCallingConv_X86Pascal
Definition: Index.h:2991
@ CXCallingConv_Invalid
Definition: Index.h:3011
@ CXCallingConv_AAPCS
Definition: Index.h:2992
@ CXCallingConv_AAPCS_VFP
Definition: Index.h:2993
@ CXCallingConv_AArch64VectorCall
Definition: Index.h:3004
@ CXCallingConv_SwiftAsync
Definition: Index.h:3005
@ CXCallingConv_M68kRTD
Definition: Index.h:3007
@ CXCallingConv_IntelOclBicc
Definition: Index.h:2995
@ CXCallingConv_Default
Definition: Index.h:2986
@ CXCallingConv_X86ThisCall
Definition: Index.h:2990
@ CXCallingConv_X86VectorCall
Definition: Index.h:3000
@ CXCallingConv_X86_64Win64
Definition: Index.h:2998
@ CXCallingConv_Win64
Definition: Index.h:2996
@ CXCallingConv_PreserveAll
Definition: Index.h:3003
@ CXCallingConv_C
Definition: Index.h:2987
@ CXCallingConv_X86RegCall
Definition: Index.h:2994
@ CXCallingConv_X86FastCall
Definition: Index.h:2989
@ CXCallingConv_AArch64SVEPCS
Definition: Index.h:3006
@ CXCallingConv_Unexposed
Definition: Index.h:3012
@ CXCallingConv_PreserveMost
Definition: Index.h:3002
@ CXType_SampledOCLImage3dRO
Definition: Index.h:2979
@ CXType_LongDouble
Definition: Index.h:2847
@ CXType_OCLImage2dMSAAWO
Definition: Index.h:2918
@ CXType_OCLImage2dArrayMSAARW
Definition: Index.h:2931
@ CXType_OCLImage2dArrayMSAADepthRO
Definition: Index.h:2909
@ CXType_VariableArray
Definition: Index.h:2883
@ CXType_OCLImage1dArrayRW
Definition: Index.h:2924
@ CXType_OCLImage2dMSAADepthWO
Definition: Index.h:2920
@ CXType_OCLImage2dMSAARW
Definition: Index.h:2930
@ CXType_OCLImage1dBufferWO
Definition: Index.h:2913
@ CXType_LValueReference
Definition: Index.h:2871
@ CXType_ShortAccum
Definition: Index.h:2857
@ CXType_Double
Definition: Index.h:2846
@ CXType_OCLImage2dArrayMSAAWO
Definition: Index.h:2919
@ CXType_OCLIntelSubgroupAVCImeResult
Definition: Index.h:2949
@ CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout
Definition: Index.h:2959
@ CXType_ObjCSel
Definition: Index.h:2853
@ CXType_UShort
Definition: Index.h:2832
@ CXType_OCLImage2dArrayRW
Definition: Index.h:2927
@ CXType_Unexposed
A type whose specific kind is not exposed via this interface.
Definition: Index.h:2823
@ CXType_SampledOCLImage1dBufferRO
Definition: Index.h:2970
@ CXType_Pipe
Definition: Index.h:2896
@ CXType_OCLIntelSubgroupAVCImeSingleReferenceStreamin
Definition: Index.h:2954
@ CXType_ObjCId
Definition: Index.h:2851
@ CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout
Definition: Index.h:2958
@ CXType_Invalid
Represents an invalid type (e.g., where no type is available).
Definition: Index.h:2817
@ CXType_UAccum
Definition: Index.h:2861
@ CXType_UInt128
Definition: Index.h:2836
@ CXType_OCLImage2dWO
Definition: Index.h:2914
@ CXType_Float16
Definition: Index.h:2856
@ CXType_OCLIntelSubgroupAVCImeDualRefStreamin
Definition: Index.h:2961
@ CXType_Short
Definition: Index.h:2840
@ CXType_OCLImage2dRW
Definition: Index.h:2926
@ CXType_SampledOCLImage2dArrayMSAARO
Definition: Index.h:2976
@ CXType_LongAccum
Definition: Index.h:2859
@ CXType_Float
Definition: Index.h:2845
@ CXType_SampledOCLImage2dMSAADepthRO
Definition: Index.h:2977
@ CXType_WChar
Definition: Index.h:2839
@ CXType_LongLong
Definition: Index.h:2843
@ CXType_OCLIntelSubgroupAVCImeSingleRefStreamin
Definition: Index.h:2960
@ CXType_OCLImage2dArrayDepthRO
Definition: Index.h:2905
@ CXType_SampledOCLImage2dArrayMSAADepthRO
Definition: Index.h:2978
@ CXType_OCLImage2dArrayDepthWO
Definition: Index.h:2917
@ CXType_ConstantArray
Definition: Index.h:2880
@ CXType_Ibm128
Definition: Index.h:2864
@ CXType_OCLImage2dDepthRO
Definition: Index.h:2904
@ CXType_SampledOCLImage2dMSAARO
Definition: Index.h:2975
@ CXType_BFloat16
Definition: Index.h:2863
@ CXType_OCLImage1dArrayRO
Definition: Index.h:2900
@ CXType_OCLIntelSubgroupAVCSicResult
Definition: Index.h:2951
@ CXType_Enum
Definition: Index.h:2874
@ CXType_FunctionProto
Definition: Index.h:2879
@ CXType_OCLImage2dArrayMSAADepthRW
Definition: Index.h:2933
@ CXType_MemberPointer
Definition: Index.h:2885
@ CXType_OCLImage2dDepthRW
Definition: Index.h:2928
@ CXType_SampledOCLImage2dArrayRO
Definition: Index.h:2972
@ CXType_ULong
Definition: Index.h:2834
@ CXType_ULongLong
Definition: Index.h:2835
@ CXType_OCLImage2dArrayMSAARO
Definition: Index.h:2907
@ CXType_OCLImage2dMSAADepthRW
Definition: Index.h:2932
@ CXType_Typedef
Definition: Index.h:2875
@ CXType_Int
Definition: Index.h:2841
@ CXType_OCLImage2dArrayMSAADepthWO
Definition: Index.h:2921
@ CXType_OCLImage2dMSAADepthRO
Definition: Index.h:2908
@ CXType_Half
Definition: Index.h:2855
@ CXType_BlockPointer
Definition: Index.h:2870
@ CXType_OCLImage1dArrayWO
Definition: Index.h:2912
@ CXType_BTFTagAttributed
Definition: Index.h:2965
@ CXType_OCLImage2dArrayWO
Definition: Index.h:2915
@ CXType_OCLImage1dRO
Definition: Index.h:2899
@ CXType_Atomic
Definition: Index.h:2964
@ CXType_IncompleteArray
Definition: Index.h:2882
@ CXType_Overload
Definition: Index.h:2849
@ CXType_OCLIntelSubgroupAVCSicPayload
Definition: Index.h:2947
@ CXType_ExtVector
Definition: Index.h:2963
@ CXType_Float128
Definition: Index.h:2854
@ CXType_OCLIntelSubgroupAVCImeDualReferenceStreamin
Definition: Index.h:2955
@ CXType_OCLImage2dArrayDepthRW
Definition: Index.h:2929
@ CXType_Complex
Definition: Index.h:2868
@ CXType_OCLImage1dBufferRW
Definition: Index.h:2925
@ CXType_OCLImage1dRW
Definition: Index.h:2923
@ CXType_Long
Definition: Index.h:2842
@ CXType_Int128
Definition: Index.h:2844
@ CXType_UInt
Definition: Index.h:2833
@ CXType_SampledOCLImage2dDepthRO
Definition: Index.h:2973
@ CXType_OCLQueue
Definition: Index.h:2937
@ CXType_RValueReference
Definition: Index.h:2872
@ CXType_OCLImage3dRO
Definition: Index.h:2910
@ CXType_DependentSizedArray
Definition: Index.h:2884
@ CXType_NullPtr
Definition: Index.h:2848
@ CXType_ObjCInterface
Definition: Index.h:2876
@ CXType_ObjCClass
Definition: Index.h:2852
@ CXType_OCLImage1dBufferRO
Definition: Index.h:2901
@ CXType_OCLImage1dWO
Definition: Index.h:2911
@ CXType_OCLIntelSubgroupAVCRefPayload
Definition: Index.h:2946
@ CXType_Bool
Definition: Index.h:2827
@ CXType_ObjCObject
Definition: Index.h:2940
@ CXType_OCLImage2dDepthWO
Definition: Index.h:2916
@ CXType_Void
Definition: Index.h:2826
@ CXType_UShortAccum
Definition: Index.h:2860
@ CXType_Vector
Definition: Index.h:2881
@ CXType_LastBuiltin
Definition: Index.h:2866
@ CXType_OCLEvent
Definition: Index.h:2936
@ CXType_OCLImage2dMSAARO
Definition: Index.h:2906
@ CXType_Record
Definition: Index.h:2873
@ CXType_OCLIntelSubgroupAVCMceResult
Definition: Index.h:2948
@ CXType_SChar
Definition: Index.h:2838
@ CXType_SampledOCLImage1dArrayRO
Definition: Index.h:2969
@ CXType_ObjCObjectPointer
Definition: Index.h:2877
@ CXType_SampledOCLImage2dArrayDepthRO
Definition: Index.h:2974
@ CXType_OCLIntelSubgroupAVCImeResultSingleReferenceStreamout
Definition: Index.h:2952
@ CXType_Char16
Definition: Index.h:2830
@ CXType_ObjCTypeParam
Definition: Index.h:2941
@ CXType_SampledOCLImage1dRO
Definition: Index.h:2968
@ CXType_UChar
Definition: Index.h:2829
@ CXType_Pointer
Definition: Index.h:2869
@ CXType_FunctionNoProto
Definition: Index.h:2878
@ CXType_Char_S
Definition: Index.h:2837
@ CXType_Char_U
Definition: Index.h:2828
@ CXType_Accum
Definition: Index.h:2858
@ CXType_Auto
Definition: Index.h:2886
@ CXType_OCLIntelSubgroupAVCImePayload
Definition: Index.h:2945
@ CXType_OCLIntelSubgroupAVCImeResultDualReferenceStreamout
Definition: Index.h:2953
@ CXType_FirstBuiltin
Definition: Index.h:2865
@ CXType_OCLImage2dRO
Definition: Index.h:2902
@ CXType_OCLSampler
Definition: Index.h:2935
@ CXType_OCLIntelSubgroupAVCMcePayload
Definition: Index.h:2944
@ CXType_Char32
Definition: Index.h:2831
@ CXType_Attributed
Definition: Index.h:2942
@ CXType_OCLIntelSubgroupAVCRefResult
Definition: Index.h:2950
@ CXType_Elaborated
Represents a type that was referred to using an elaborated type keyword.
Definition: Index.h:2893
@ CXType_OCLReserveID
Definition: Index.h:2938
@ CXType_OCLImage3dRW
Definition: Index.h:2934
@ CXType_ULongAccum
Definition: Index.h:2862
@ CXType_SampledOCLImage2dRO
Definition: Index.h:2971
@ CXType_OCLImage3dWO
Definition: Index.h:2922
@ CXType_Dependent
Definition: Index.h:2850
@ CXType_OCLImage2dArrayRO
Definition: Index.h:2903
@ CXTypeLayoutError_Incomplete
The type is an incomplete Type.
Definition: Index.h:3576
@ CXTypeLayoutError_Dependent
The type is a dependent Type.
Definition: Index.h:3580
@ CXTypeLayoutError_Undeduced
The type is undeduced.
Definition: Index.h:3592
@ CXTypeLayoutError_NotConstantSize
The type is not a constant size type.
Definition: Index.h:3584
@ CXTypeLayoutError_Invalid
Type is of kind CXType_Invalid.
Definition: Index.h:3572
@ CXTypeLayoutError_InvalidFieldName
The Field name is not valid for this record.
Definition: Index.h:3588
@ CXTemplateArgumentKind_NullPtr
Definition: Index.h:3125
@ CXTemplateArgumentKind_Expression
Definition: Index.h:3129
@ CXTemplateArgumentKind_Pack
Definition: Index.h:3130
@ CXTemplateArgumentKind_Declaration
Definition: Index.h:3124
@ CXTemplateArgumentKind_Type
Definition: Index.h:3123
@ CXTemplateArgumentKind_Null
Definition: Index.h:3122
@ CXTemplateArgumentKind_Integral
Definition: Index.h:3126
@ CXTemplateArgumentKind_Template
Definition: Index.h:3127
@ CXTemplateArgumentKind_TemplateExpansion
Definition: Index.h:3128
@ CXTemplateArgumentKind_Invalid
Definition: Index.h:3132
CINDEX_LINKAGE CXSourceRangeList * clang_getAllSkippedRanges(CXTranslationUnit tu)
Retrieve all ranges from all files that were skipped by the preprocessor.
CINDEX_LINKAGE void clang_disposeIndex(CXIndex index)
Destroy the given index.
CINDEX_LINKAGE unsigned clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file)
Determine whether the given header is guarded against multiple inclusions, either with the convention...
CXGlobalOptFlags
Definition: Index.h:298
CINDEX_LINKAGE unsigned clang_CXIndex_getGlobalOptions(CXIndex)
Gets the general options associated with a CXIndex.
CXChoice
Definition: Index.h:282
CINDEX_LINKAGE const char * clang_getFileContents(CXTranslationUnit tu, CXFile file, size_t *size)
Retrieve the buffer associated with the given file.
CINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index)
Retrieve a diagnostic associated with the given translation unit.
struct CXIndexOptions CXIndexOptions
Index initialization options.
CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics)
Provides a shared context for creating translation units.
struct CXTargetInfoImpl * CXTargetInfo
An opaque type representing target information for a given translation unit.
Definition: Index.h:86
CINDEX_LINKAGE void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options)
Sets general options associated with a CXIndex.
CINDEX_LINKAGE CXIndex clang_createIndexWithOptions(const CXIndexOptions *options)
Provides a shared context for creating translation units.
CINDEX_LINKAGE CXSourceLocation clang_getLocation(CXTranslationUnit tu, CXFile file, unsigned line, unsigned column)
Retrieves the source location associated with a given file/line/column in a particular translation un...
CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, const char *file_name)
Retrieve a file handle within the given translation unit.
CXCursorKind
Describes the kind of entity that a cursor refers to.
Definition: Index.h:1186
CINDEX_LINKAGE CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu, CXFile file, unsigned offset)
Retrieves the source location associated with a given character offset in a particular translation un...
struct CXTranslationUnitImpl * CXTranslationUnit
A single translation unit, which resides in an index.
Definition: Index.h:91
void * CXClientData
Opaque pointer representing client data that will be passed through to various callbacks and visitors...
Definition: Index.h:97
CXCursor_ExceptionSpecificationKind
Describes the exception specification of a cursor.
Definition: Index.h:179
CXAvailabilityKind
Describes the availability of a particular entity, which indicates whether the use of this entity wil...
Definition: Index.h:130
CINDEX_LINKAGE void clang_CXIndex_setInvocationEmissionPathOption(CXIndex, const char *Path)
Sets the invocation emission path option in a CXIndex.
void * CXIndex
An "index" that consists of a set of translation units that would typically be linked together into a...
Definition: Index.h:80
struct CXVersion CXVersion
Describes a version number of the form major.minor.subminor.
CINDEX_LINKAGE CXSourceRangeList * clang_getSkippedRanges(CXTranslationUnit tu, CXFile file)
Retrieve all ranges that were skipped by the preprocessor.
CINDEX_LINKAGE unsigned clang_getNumDiagnostics(CXTranslationUnit Unit)
Determine the number of diagnostics produced for the given translation unit.
CINDEX_LINKAGE CXDiagnosticSet clang_getDiagnosticSetFromTU(CXTranslationUnit Unit)
Retrieve the complete set of diagnostics associated with a translation unit.
@ CXGlobalOpt_ThreadBackgroundPriorityForEditing
Used to indicate that threads that libclang creates for editing purposes should use background priori...
Definition: Index.h:320
@ CXGlobalOpt_None
Used to indicate that no special CXIndex options are needed.
Definition: Index.h:302
@ CXGlobalOpt_ThreadBackgroundPriorityForIndexing
Used to indicate that threads that libclang creates for indexing purposes should use background prior...
Definition: Index.h:311
@ CXGlobalOpt_ThreadBackgroundPriorityForAll
Used to indicate that all threads that libclang creates should use background priority.
Definition: Index.h:326
@ CXChoice_Disabled
Disable the option.
Definition: Index.h:295
@ CXChoice_Enabled
Enable the option.
Definition: Index.h:291
@ CXChoice_Default
Use the default value of an option that may depend on the process environment.
Definition: Index.h:287
@ CXCursor_OMPCriticalDirective
OpenMP critical directive.
Definition: Index.h:1891
@ CXCursor_NSReturnsAutoreleased
Definition: Index.h:2192
@ CXCursor_OMPCanonicalLoop
OpenMP canonical loop.
Definition: Index.h:2079
@ CXCursor_ObjCInterfaceDecl
An Objective-C @interface.
Definition: Index.h:1220
@ CXCursor_LastExpr
Definition: Index.h:1694
@ CXCursor_CXXAddrspaceCastExpr
OpenCL's addrspace_cast<> expression.
Definition: Index.h:1671
@ CXCursor_ObjCSuperClassRef
Definition: Index.h:1283
@ CXCursor_NoDeclFound
Definition: Index.h:1383
@ CXCursor_CXXReinterpretCastExpr
C++'s reinterpret_cast<> expression.
Definition: Index.h:1519
@ CXCursor_OMPParallelMaskedTaskLoopSimdDirective
OpenMP parallel masked taskloop simd directive.
Definition: Index.h:2139
@ CXCursor_ObjCEncodeExpr
An Objective-C @encode expression.
Definition: Index.h:1578
@ CXCursor_Namespace
A C++ namespace.
Definition: Index.h:1242
@ CXCursor_NSReturnsRetained
Definition: Index.h:2190
@ CXCursor_OMPMasterDirective
OpenMP master directive.
Definition: Index.h:1887
@ CXCursor_FirstExpr
Definition: Index.h:1389
@ CXCursor_OMPSectionsDirective
OpenMP sections directive.
Definition: Index.h:1863
@ CXCursor_OMPFlushDirective
OpenMP flush directive.
Definition: Index.h:1907
@ CXCursor_CXXTypeidExpr
A C++ typeid expression (C++ [expr.typeid]).
Definition: Index.h:1537
@ CXCursor_OMPTargetEnterDataDirective
OpenMP target enter data directive.
Definition: Index.h:1967
@ CXCursor_OMPParallelDirective
OpenMP parallel directive.
Definition: Index.h:1851
@ CXCursor_OMPMasterTaskLoopDirective
OpenMP master taskloop directive.
Definition: Index.h:2047
@ CXCursor_TypedefDecl
A typedef.
Definition: Index.h:1238
@ CXCursor_IfStmt
An if statement.
Definition: Index.h:1739
@ CXCursor_OMPMasterTaskLoopSimdDirective
OpenMP master taskloop simd directive.
Definition: Index.h:2055
@ CXCursor_CXXThrowExpr
[C++ 15] C++ Throw Expression.
Definition: Index.h:1556
@ CXCursor_OMPTileDirective
OpenMP tile directive.
Definition: Index.h:2075
@ CXCursor_OMPTargetTeamsDistributeSimdDirective
OpenMP target teams distribute simd directive.
Definition: Index.h:2039
@ CXCursor_PackedAttr
Definition: Index.h:2178
@ CXCursor_SEHFinallyStmt
Windows Structured Exception Handling's finally statement.
Definition: Index.h:1832
@ CXCursor_UnaryExpr
A unary expression.
Definition: Index.h:1570
@ CXCursor_GotoStmt
A goto statement.
Definition: Index.h:1759
@ CXCursor_ObjCSelectorExpr
An Objective-C @selector expression.
Definition: Index.h:1582
@ CXCursor_CXXAccessSpecifier
An access specifier.
Definition: Index.h:1276
@ CXCursor_ObjCBridgedCastExpr
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
Definition: Index.h:1595
@ CXCursor_OMPSimdDirective
OpenMP SIMD directive.
Definition: Index.h:1855
@ CXCursor_OMPTeamsDistributeDirective
OpenMP teams distribute directive.
Definition: Index.h:2007
@ CXCursor_EnumConstantDecl
An enumerator constant.
Definition: Index.h:1212
@ CXCursor_InvalidCode
Definition: Index.h:1385
@ CXCursor_OMPArrayShapingExpr
OpenMP 5.0 [2.1.4, Array Shaping].
Definition: Index.h:1662
@ CXCursor_LabelRef
A reference to a labeled statement.
Definition: Index.h:1332
@ CXCursor_OMPTargetParallelForSimdDirective
OpenMP target parallel for simd directive.
Definition: Index.h:1999
@ CXCursor_FirstStmt
Definition: Index.h:1697
@ CXCursor_OMPTargetSimdDirective
OpenMP target simd directive.
Definition: Index.h:2003
@ CXCursor_ObjCAtFinallyStmt
Objective-C's @finally statement.
Definition: Index.h:1792
@ CXCursor_PackExpansionExpr
Represents a C++0x pack expansion that produces a sequence of expressions.
Definition: Index.h:1610
@ CXCursor_OMPTeamsGenericLoopDirective
OpenMP teams loop directive.
Definition: Index.h:2107
@ CXCursor_ConversionFunction
A C++ conversion function.
Definition: Index.h:1250
@ CXCursor_ObjCClassRef
Definition: Index.h:1285
@ CXCursor_BuiltinBitCastExpr
C++2a std::bit_cast expression.
Definition: Index.h:2043
@ CXCursor_OMPParallelMasterDirective
OpenMP parallel master directive.
Definition: Index.h:2063
@ CXCursor_NSConsumesSelf
Definition: Index.h:2193
@ CXCursor_ObjCRootClass
Definition: Index.h:2201
@ CXCursor_OMPDistributeDirective
OpenMP distribute directive.
Definition: Index.h:1963
@ CXCursor_OMPTeamsDistributeParallelForSimdDirective
OpenMP teams distribute parallel for simd directive.
Definition: Index.h:2015
@ CXCursor_GNUNullExpr
Implements the GNU __null extension, which is a name for a null pointer constant that has integral ty...
Definition: Index.h:1507
@ CXCursor_ConceptDecl
a concept declaration.
Definition: Index.h:2240
@ CXCursor_OMPOrderedDirective
OpenMP ordered directive.
Definition: Index.h:1915
@ CXCursor_ClassTemplate
A C++ class template.
Definition: Index.h:1260
@ CXCursor_UnionDecl
A C or C++ union.
Definition: Index.h:1201
@ CXCursor_OMPMaskedDirective
OpenMP masked directive.
Definition: Index.h:2091
@ CXCursor_OMPCancelDirective
OpenMP cancel directive.
Definition: Index.h:1947
@ CXCursor_UnexposedStmt
A statement whose specific kind is not exposed via this interface.
Definition: Index.h:1707
@ CXCursor_LabelStmt
A labelled statement in a function.
Definition: Index.h:1720
@ CXCursor_OMPDistributeParallelForSimdDirective
OpenMP distribute parallel for simd directive.
Definition: Index.h:1991
@ CXCursor_ObjCSynthesizeDecl
An Objective-C @synthesize definition.
Definition: Index.h:1272
@ CXCursor_LastDecl
Definition: Index.h:1279
@ CXCursor_FirstPreprocessing
Definition: Index.h:2220
@ CXCursor_ObjCBoolLiteralExpr
Objective-c Boolean Literal.
Definition: Index.h:1640
@ CXCursor_MacroInstantiation
Definition: Index.h:2218
@ CXCursor_OMPCancellationPointDirective
OpenMP cancellation point directive.
Definition: Index.h:1943
@ CXCursor_StringLiteral
A string literal.
Definition: Index.h:1438
@ CXCursor_OMPTargetTeamsDistributeDirective
OpenMP target teams distribute directive.
Definition: Index.h:2027
@ CXCursor_WarnUnusedResultAttr
Definition: Index.h:2210
@ CXCursor_OMPTeamsDistributeSimdDirective
OpenMP teams distribute simd directive.
Definition: Index.h:2011
@ CXCursor_GCCAsmStmt
A GCC inline assembly statement extension.
Definition: Index.h:1779
@ CXCursor_ObjCIndependentClass
Definition: Index.h:2197
@ CXCursor_AsmStmt
Definition: Index.h:1780
@ CXCursor_ObjCAvailabilityCheckExpr
Represents an @available(...) check.
Definition: Index.h:1653
@ CXCursor_VariableRef
A reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list...
Definition: Index.h:1376
@ CXCursor_OMPParallelForDirective
OpenMP parallel for directive.
Definition: Index.h:1875
@ CXCursor_DLLImport
Definition: Index.h:2189
@ CXCursor_SizeOfPackExpr
Represents an expression that computes the length of a parameter pack.
Definition: Index.h:1622
@ CXCursor_LastPreprocessing
Definition: Index.h:2221
@ CXCursor_GenericSelectionExpr
Represents a C11 generic selection.
Definition: Index.h:1497
@ CXCursor_OMPTaskLoopDirective
OpenMP taskloop directive.
Definition: Index.h:1955
@ CXCursor_FirstDecl
Definition: Index.h:1278
@ CXCursor_OMPSectionDirective
OpenMP section directive.
Definition: Index.h:1867
@ CXCursor_CXXStaticCastExpr
C++'s static_cast<> expression.
Definition: Index.h:1511
@ CXCursor_SwitchStmt
A switch statement.
Definition: Index.h:1743
@ CXCursor_LambdaExpr
Definition: Index.h:1636
@ CXCursor_AlignedAttr
Definition: Index.h:2211
@ CXCursor_ParmDecl
A function or method parameter.
Definition: Index.h:1218
@ CXCursor_ObjCProtocolRef
Definition: Index.h:1284
@ CXCursor_AnnotateAttr
Definition: Index.h:2176
@ CXCursor_FieldDecl
A field (in C) or non-static data member (in C++) in a struct, union, or C++ class.
Definition: Index.h:1210
@ CXCursor_UnexposedAttr
An attribute whose specific kind is not exposed via this interface.
Definition: Index.h:2169
@ CXCursor_ObjCAtSynchronizedStmt
Objective-C's @synchronized statement.
Definition: Index.h:1800
@ CXCursor_LastInvalid
Definition: Index.h:1386
@ CXCursor_OpenACCComputeConstruct
OpenACC Compute Construct.
Definition: Index.h:2151
@ CXCursor_NSReturnsNotRetained
Definition: Index.h:2191
@ CXCursor_OMPMaskedTaskLoopDirective
OpenMP masked taskloop directive.
Definition: Index.h:2127
@ CXCursor_OMPDistributeParallelForDirective
OpenMP distribute parallel for directive.
Definition: Index.h:1987
@ CXCursor_OMPTeamsDistributeParallelForDirective
OpenMP teams distribute parallel for directive.
Definition: Index.h:2019
@ CXCursor_ObjCSelfExpr
Represents the "self" expression in an Objective-C method.
Definition: Index.h:1644
@ CXCursor_CXXMethod
A C++ class method.
Definition: Index.h:1240
@ CXCursor_OMPMetaDirective
OpenMP metadirective directive.
Definition: Index.h:2099
@ CXCursor_AsmLabelAttr
Definition: Index.h:2177
@ CXCursor_WarnUnusedAttr
Definition: Index.h:2209
@ CXCursor_ObjCSubclassingRestricted
Definition: Index.h:2202
@ CXCursor_BlockExpr
An expression that represents a block literal.
Definition: Index.h:1422
@ CXCursor_OMPTaskLoopSimdDirective
OpenMP taskloop simd directive.
Definition: Index.h:1959
@ CXCursor_OMPTargetExitDataDirective
OpenMP target exit data directive.
Definition: Index.h:1971
@ CXCursor_ObjCMessageExpr
An expression that sends a message to an Objective-C object or class.
Definition: Index.h:1419
@ CXCursor_DeclStmt
Adaptor class for mixing declarations with statements and expressions.
Definition: Index.h:1847
@ CXCursor_CXXForRangeStmt
C++'s for (* : *) statement.
Definition: Index.h:1820
@ CXCursor_EnumDecl
An enumeration.
Definition: Index.h:1205
@ CXCursor_OMPTaskwaitDirective
OpenMP taskwait directive.
Definition: Index.h:1903
@ CXCursor_ObjCAutoreleasePoolStmt
Objective-C's autorelease pool statement.
Definition: Index.h:1804
@ CXCursor_CompoundAssignOperator
Compound assignment such as "+=".
Definition: Index.h:1466
@ CXCursor_MacroExpansion
Definition: Index.h:2217
@ CXCursor_ConstAttr
Definition: Index.h:2180
@ CXCursor_OMPInteropDirective
OpenMP interop directive.
Definition: Index.h:2083
@ CXCursor_OMPDispatchDirective
OpenMP dispatch directive.
Definition: Index.h:2087
@ CXCursor_CXXConstCastExpr
C++'s const_cast<> expression.
Definition: Index.h:1523
@ CXCursor_OMPGenericLoopDirective
OpenMP loop directive.
Definition: Index.h:2103
@ CXCursor_ObjCClassMethodDecl
An Objective-C class method.
Definition: Index.h:1232
@ CXCursor_OMPTaskyieldDirective
OpenMP taskyield directive.
Definition: Index.h:1895
@ CXCursor_OMPAtomicDirective
OpenMP atomic directive.
Definition: Index.h:1919
@ CXCursor_OMPTargetTeamsDirective
OpenMP target teams directive.
Definition: Index.h:2023
@ CXCursor_ForStmt
A for statement.
Definition: Index.h:1755
@ CXCursor_ConditionalOperator
The ?: ternary operator.
Definition: Index.h:1470
@ CXCursor_IndirectGotoStmt
An indirect goto statement.
Definition: Index.h:1763
@ CXCursor_TranslationUnit
Cursor that represents the translation unit itself.
Definition: Index.h:2161
@ CXCursor_PreprocessingDirective
Definition: Index.h:2215
@ CXCursor_ConceptSpecializationExpr
Expression that references a C++20 concept.
Definition: Index.h:1676
@ CXCursor_DLLExport
Definition: Index.h:2188
@ CXCursor_ClassTemplatePartialSpecialization
A C++ class template partial specialization.
Definition: Index.h:1262
@ CXCursor_LastStmt
Definition: Index.h:2153
@ CXCursor_OMPTargetTeamsGenericLoopDirective
OpenMP target teams loop directive.
Definition: Index.h:2111
@ CXCursor_OMPParallelMaskedTaskLoopDirective
OpenMP parallel masked taskloop directive.
Definition: Index.h:2135
@ CXCursor_CXXOverrideAttr
Definition: Index.h:2175
@ CXCursor_ObjCProtocolDecl
An Objective-C @protocol declaration.
Definition: Index.h:1224
@ CXCursor_ArraySubscriptExpr
[C99 6.5.2.1] Array Subscripting.
Definition: Index.h:1457
@ CXCursor_NullStmt
The null statement ";": C99 6.8.3p3.
Definition: Index.h:1842
@ CXCursor_FunctionTemplate
A C++ function template.
Definition: Index.h:1258
@ CXCursor_IBActionAttr
Definition: Index.h:2171
@ CXCursor_NoDuplicateAttr
Definition: Index.h:2181
@ CXCursor_ObjCImplementationDecl
An Objective-C @implementation.
Definition: Index.h:1234
@ CXCursor_OMPScanDirective
OpenMP scan directive.
Definition: Index.h:2071
@ CXCursor_IBOutletCollectionAttr
Definition: Index.h:2173
@ CXCursor_TypeRef
A reference to a type declaration.
Definition: Index.h:1301
@ CXCursor_CUDAGlobalAttr
Definition: Index.h:2184
@ CXCursor_IBOutletAttr
Definition: Index.h:2172
@ CXCursor_NamespaceRef
A reference to a namespace or namespace alias.
Definition: Index.h:1311
@ CXCursor_DoStmt
A do statement.
Definition: Index.h:1751
@ CXCursor_NonTypeTemplateParameter
A C++ non-type template parameter.
Definition: Index.h:1254
@ CXCursor_ObjCAtThrowStmt
Objective-C's @throw statement.
Definition: Index.h:1796
@ CXCursor_OMPErrorDirective
OpenMP error directive.
Definition: Index.h:2143
@ CXCursor_CUDASharedAttr
Definition: Index.h:2186
@ CXCursor_IntegerLiteral
An integer literal.
Definition: Index.h:1426
@ CXCursor_OMPDepobjDirective
OpenMP depobj directive.
Definition: Index.h:2067
@ CXCursor_MSAsmStmt
A MS inline assembly statement extension.
Definition: Index.h:1836
@ CXCursor_CUDADeviceAttr
Definition: Index.h:2183
@ CXCursor_OMPBarrierDirective
OpenMP barrier directive.
Definition: Index.h:1899
@ CXCursor_ObjCNSObject
Definition: Index.h:2196
@ CXCursor_ContinueStmt
A continue statement.
Definition: Index.h:1767
@ CXCursor_OMPSingleDirective
OpenMP single directive.
Definition: Index.h:1871
@ CXCursor_FunctionDecl
A function.
Definition: Index.h:1214
@ CXCursor_FloatingLiteral
A floating point number literal.
Definition: Index.h:1430
@ CXCursor_CompoundStmt
A group of statements like { stmt stmt }.
Definition: Index.h:1727
@ CXCursor_ObjCPropertyDecl
An Objective-C @property declaration.
Definition: Index.h:1226
@ CXCursor_MemberRefExpr
An expression that refers to a member of a struct, union, class, Objective-C class,...
Definition: Index.h:1412
@ CXCursor_Destructor
A C++ destructor.
Definition: Index.h:1248
@ CXCursor_ObjCIvarDecl
An Objective-C instance variable.
Definition: Index.h:1228
@ CXCursor_OMPForSimdDirective
OpenMP for SIMD directive.
Definition: Index.h:1923
@ CXCursor_OMPParallelSectionsDirective
OpenMP parallel sections directive.
Definition: Index.h:1879
@ CXCursor_CStyleCastExpr
An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (...
Definition: Index.h:1477
@ CXCursor_TypeAliasTemplateDecl
Definition: Index.h:2228
@ CXCursor_FixedPointLiteral
Fixed point literal.
Definition: Index.h:1658
@ CXCursor_FirstInvalid
Definition: Index.h:1381
@ CXCursor_InvalidFile
Definition: Index.h:1382
@ CXCursor_CXXNullPtrLiteralExpr
[C++0x 2.14.7] C++ Pointer Literal.
Definition: Index.h:1545
@ CXCursor_CXXParenListInitExpr
Expression that references a C++20 parenthesized list aggregate initializer.
Definition: Index.h:1687
@ CXCursor_TemplateRef
A reference to a class template, function template, template template parameter, or class template pa...
Definition: Index.h:1307
@ CXCursor_ObjCCategoryImplDecl
An Objective-C @implementation for a category.
Definition: Index.h:1236
@ CXCursor_OMPMaskedTaskLoopSimdDirective
OpenMP masked taskloop simd directive.
Definition: Index.h:2131
@ CXCursor_ObjCExplicitProtocolImpl
Definition: Index.h:2203
@ CXCursor_NSConsumed
Definition: Index.h:2194
@ CXCursor_OMPTaskDirective
OpenMP task directive.
Definition: Index.h:1883
@ CXCursor_BinaryOperator
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Index.h:1462
@ CXCursor_UnexposedExpr
An expression whose specific kind is not exposed via this interface.
Definition: Index.h:1400
@ CXCursor_ObjCDynamicDecl
An Objective-C @dynamic definition.
Definition: Index.h:1274
@ CXCursor_ImaginaryLiteral
An imaginary number literal.
Definition: Index.h:1434
@ CXCursor_PureAttr
Definition: Index.h:2179
@ CXCursor_OMPParallelMasterTaskLoopSimdDirective
OpenMP parallel master taskloop simd directive.
Definition: Index.h:2059
@ CXCursor_LastExtraDecl
Definition: Index.h:2243
@ CXCursor_CaseStmt
A case statement.
Definition: Index.h:1731
@ CXCursor_OMPTargetParallelForDirective
OpenMP target parallel for directive.
Definition: Index.h:1979
@ CXCursor_OMPTargetDirective
OpenMP target directive.
Definition: Index.h:1931
@ CXCursor_CharacterLiteral
A character literal.
Definition: Index.h:1442
@ CXCursor_OMPParallelGenericLoopDirective
OpenMP parallel loop directive.
Definition: Index.h:2115
@ CXCursor_MacroDefinition
Definition: Index.h:2216
@ CXCursor_CUDAConstantAttr
Definition: Index.h:2182
@ CXCursor_CallExpr
An expression that calls a function.
Definition: Index.h:1415
@ CXCursor_DeclRefExpr
An expression that refers to some value declaration, such as a function, variable,...
Definition: Index.h:1406
@ CXCursor_UnaryOperator
This represents the unary-expression's (except sizeof and alignof).
Definition: Index.h:1453
@ CXCursor_VarDecl
A variable.
Definition: Index.h:1216
@ CXCursor_TemplateTypeParameter
A C++ template type parameter.
Definition: Index.h:1252
@ CXCursor_TemplateTemplateParameter
A C++ template template parameter.
Definition: Index.h:1256
@ CXCursor_UnexposedDecl
A declaration whose specific kind is not exposed via this interface.
Definition: Index.h:1197
@ CXCursor_OMPParallelForSimdDirective
OpenMP parallel for SIMD directive.
Definition: Index.h:1927
@ CXCursor_OMPTargetDataDirective
OpenMP target data directive.
Definition: Index.h:1951
@ CXCursor_OMPForDirective
OpenMP for directive.
Definition: Index.h:1859
@ CXCursor_ObjCInstanceMethodDecl
An Objective-C instance method.
Definition: Index.h:1230
@ CXCursor_FirstAttr
Definition: Index.h:2164
@ CXCursor_StructDecl
A C or C++ struct.
Definition: Index.h:1199
@ CXCursor_SEHExceptStmt
Windows Structured Exception Handling's except statement.
Definition: Index.h:1828
@ CXCursor_StmtExpr
This is the GNU Statement Expression extension: ({int X=4; X;})
Definition: Index.h:1493
@ CXCursor_FirstExtraDecl
Definition: Index.h:2242
@ CXCursor_CXXTryStmt
C++'s try statement.
Definition: Index.h:1816
@ CXCursor_UsingDeclaration
A C++ using declaration.
Definition: Index.h:1268
@ CXCursor_AddrLabelExpr
The GNU address of label extension, representing &&label.
Definition: Index.h:1489
@ CXCursor_LinkageSpec
A linkage specification, e.g.
Definition: Index.h:1244
@ CXCursor_ClassDecl
A C++ class.
Definition: Index.h:1203
@ CXCursor_SEHTryStmt
Windows Structured Exception Handling's try statement.
Definition: Index.h:1824
@ CXCursor_CXXFunctionalCastExpr
Represents an explicit C++ type conversion that uses "functional" notion (C++ [expr....
Definition: Index.h:1533
@ CXCursor_CXXDynamicCastExpr
C++'s dynamic_cast<> expression.
Definition: Index.h:1515
@ CXCursor_ObjCCategoryDecl
An Objective-C @interface for a category.
Definition: Index.h:1222
@ CXCursor_ConvergentAttr
Definition: Index.h:2208
@ CXCursor_OMPTargetTeamsDistributeParallelForDirective
OpenMP target teams distribute parallel for directive.
Definition: Index.h:2031
@ CXCursor_StaticAssert
A static_assert or _Static_assert node.
Definition: Index.h:2232
@ CXCursor_ModuleImportDecl
A module import declaration.
Definition: Index.h:2227
@ CXCursor_NotImplemented
Definition: Index.h:1384
@ CXCursor_CXXBoolLiteralExpr
[C++ 2.13.5] C++ Boolean Literal.
Definition: Index.h:1541
@ CXCursor_DefaultStmt
A default statement.
Definition: Index.h:1735
@ CXCursor_ReturnStmt
A return statement.
Definition: Index.h:1775
@ CXCursor_MemberRef
A reference to a member of a struct, union, or class that occurs in some non-expression context,...
Definition: Index.h:1316
@ CXCursor_FirstRef
Definition: Index.h:1282
@ CXCursor_CXXCatchStmt
C++'s catch statement.
Definition: Index.h:1812
@ CXCursor_OMPUnrollDirective
OpenMP unroll directive.
Definition: Index.h:2095
@ CXCursor_OMPScopeDirective
OpenMP scope directive.
Definition: Index.h:2147
@ CXCursor_PackIndexingExpr
Represents a C++26 pack indexing expression.
Definition: Index.h:1692
@ CXCursor_ObjCException
Definition: Index.h:2195
@ CXCursor_NamespaceAlias
A C++ namespace alias declaration.
Definition: Index.h:1264
@ CXCursor_OMPTeamsDirective
OpenMP teams directive.
Definition: Index.h:1935
@ CXCursor_ArraySectionExpr
OpenMP 5.0 [2.1.5, Array Section].
Definition: Index.h:1649
@ CXCursor_OverloadedDeclRef
A reference to a set of overloaded functions or function templates that has not yet been resolved to ...
Definition: Index.h:1370
@ CXCursor_SEHLeaveStmt
Windows Structured Exception Handling's leave statement.
Definition: Index.h:1911
@ CXCursor_InitListExpr
Describes an C or C++ initializer list.
Definition: Index.h:1485
@ CXCursor_CXXThisExpr
Represents the "this" expression in C++.
Definition: Index.h:1549
@ CXCursor_ObjCDesignatedInitializer
Definition: Index.h:2204
@ CXCursor_Constructor
A C++ constructor.
Definition: Index.h:1246
@ CXCursor_WhileStmt
A while statement.
Definition: Index.h:1747
@ CXCursor_ObjCRuntimeVisible
Definition: Index.h:2205
@ CXCursor_OverloadCandidate
A code completion overload candidate.
Definition: Index.h:2248
@ CXCursor_LastRef
Definition: Index.h:1378
@ CXCursor_ObjCStringLiteral
An Objective-C string literal i.e.
Definition: Index.h:1574
@ CXCursor_FriendDecl
a friend declaration.
Definition: Index.h:2236
@ CXCursor_ObjCRequiresSuper
Definition: Index.h:2200
@ CXCursor_BreakStmt
A break statement.
Definition: Index.h:1771
@ CXCursor_CXXFinalAttr
Definition: Index.h:2174
@ CXCursor_OMPDistributeSimdDirective
OpenMP distribute simd directive.
Definition: Index.h:1995
@ CXCursor_CUDAHostAttr
Definition: Index.h:2185
@ CXCursor_InclusionDirective
Definition: Index.h:2219
@ CXCursor_FlagEnum
Definition: Index.h:2207
@ CXCursor_OMPTargetParallelGenericLoopDirective
OpenMP target parallel loop directive.
Definition: Index.h:2119
@ CXCursor_OMPTargetParallelDirective
OpenMP target parallel directive.
Definition: Index.h:1975
@ CXCursor_TypeAliasDecl
A C++ alias declaration.
Definition: Index.h:1270
@ CXCursor_OMPTargetUpdateDirective
OpenMP target update directive.
Definition: Index.h:1983
@ CXCursor_ParenExpr
A parenthesized expression, e.g.
Definition: Index.h:1448
@ CXCursor_ObjCForCollectionStmt
Objective-C's collection statement.
Definition: Index.h:1808
@ CXCursor_OMPParallelMasterTaskLoopDirective
OpenMP parallel master taskloop directive.
Definition: Index.h:2051
@ CXCursor_UsingDirective
A C++ using directive.
Definition: Index.h:1266
@ CXCursor_LastAttr
Definition: Index.h:2212
@ CXCursor_ObjCBoxable
Definition: Index.h:2206
@ CXCursor_OMPTaskgroupDirective
OpenMP taskgroup directive.
Definition: Index.h:1939
@ CXCursor_CXXBaseSpecifier
Definition: Index.h:1302
@ CXCursor_CXXNewExpr
A new expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: Index.h:1561
@ CXCursor_CXXDeleteExpr
A delete expression for memory deallocation and destructor calls, e.g.
Definition: Index.h:1566
@ CXCursor_ObjCProtocolExpr
An Objective-C @protocol expression.
Definition: Index.h:1586
@ CXCursor_ObjCReturnsInnerPointer
Definition: Index.h:2199
@ CXCursor_ObjCPreciseLifetime
Definition: Index.h:2198
@ CXCursor_VisibilityAttr
Definition: Index.h:2187
@ CXCursor_OMPParallelMaskedDirective
OpenMP parallel masked directive.
Definition: Index.h:2123
@ CXCursor_CompoundLiteralExpr
[C99 6.5.2.5]
Definition: Index.h:1481
@ CXCursor_OMPIteratorExpr
OpenMP 5.0 [2.1.6 Iterators].
Definition: Index.h:1667
@ CXCursor_RequiresExpr
Expression that references a C++20 requires expression.
Definition: Index.h:1681
@ CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective
OpenMP target teams distribute parallel for simd directive.
Definition: Index.h:2035
@ CXCursor_ObjCAtTryStmt
Objective-C's overall @try-@catch-@finally statement.
Definition: Index.h:1784
@ CXCursor_ObjCAtCatchStmt
Objective-C's @catch statement.
Definition: Index.h:1788
@ CXCursor_ExceptionSpecificationKind_MSAny
The cursor has exception specification throw(...).
Definition: Index.h:198
@ CXCursor_ExceptionSpecificationKind_BasicNoexcept
The cursor has exception specification basic noexcept.
Definition: Index.h:203
@ CXCursor_ExceptionSpecificationKind_DynamicNone
The cursor has exception specification throw()
Definition: Index.h:188
@ CXCursor_ExceptionSpecificationKind_ComputedNoexcept
The cursor has exception specification computed noexcept.
Definition: Index.h:208
@ CXCursor_ExceptionSpecificationKind_NoThrow
The cursor has a __declspec(nothrow) exception specification.
Definition: Index.h:228
@ CXCursor_ExceptionSpecificationKind_Unevaluated
The exception specification has not yet been evaluated.
Definition: Index.h:213
@ CXCursor_ExceptionSpecificationKind_Dynamic
The cursor has exception specification throw(T1, T2)
Definition: Index.h:193
@ CXCursor_ExceptionSpecificationKind_Unparsed
The exception specification has not been parsed yet.
Definition: Index.h:223
@ CXCursor_ExceptionSpecificationKind_None
The cursor has no exception specification.
Definition: Index.h:183
@ CXCursor_ExceptionSpecificationKind_Uninstantiated
The exception specification has not yet been instantiated.
Definition: Index.h:218
@ CXAvailability_Available
The entity is available.
Definition: Index.h:134
@ CXAvailability_Deprecated
The entity is available, but has been deprecated (and its use is not recommended).
Definition: Index.h:139
@ CXAvailability_NotAccessible
The entity is available, but not accessible; any use of it will be an error.
Definition: Index.h:148
@ CXAvailability_NotAvailable
The entity is not available; any use of it will be an error.
Definition: Index.h:143
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Definition: DiagnosticIDs.h:65
RangeSelector name(std::string ID)
Given a node with a "name", (like NamedDecl, DeclRefExpr, CxxCtorInitializer, and TypeLoc) selects th...
const FunctionProtoType * T
Contains the results of code-completion.
Definition: Index.h:5237
unsigned NumResults
The number of code-completion results stored in the Results array.
Definition: Index.h:5247
CXCompletionResult * Results
The code-completion results.
Definition: Index.h:5241
A single result of code completion.
Definition: Index.h:4903
CXCompletionString CompletionString
The code-completion string that describes how to insert this code-completion result into the editing ...
Definition: Index.h:4920
enum CXVisitorResult(* visit)(void *context, CXCursor, CXSourceRange)
Definition: Index.h:5865
A cursor representing some element in the abstract syntax tree for a translation unit.
Definition: Index.h:2269
int xdata
Definition: Index.h:2271
CXIdxLoc loc
Definition: Index.h:6082
CXIdxAttrKind kind
Definition: Index.h:6080
CXCursor cursor
Definition: Index.h:6081
const CXIdxEntityInfo * base
Definition: Index.h:6147
CXCursor cursor
Definition: Index.h:6148
CXIdxLoc loc
Definition: Index.h:6149
const CXIdxDeclInfo * declInfo
Definition: Index.h:6184
const CXIdxBaseClassInfo *const * bases
Definition: Index.h:6185
unsigned numBases
Definition: Index.h:6186
CXCursor cursor
Definition: Index.h:6097
int isImplicit
Whether the declaration exists in code or was created implicitly by the compiler, e....
Definition: Index.h:6127
const CXIdxContainerInfo * semanticContainer
Definition: Index.h:6113
unsigned flags
Definition: Index.h:6131
const CXIdxContainerInfo * declAsContainer
Definition: Index.h:6122
int isRedeclaration
Definition: Index.h:6119
CXIdxLoc loc
Definition: Index.h:6112
int isDefinition
Definition: Index.h:6120
const CXIdxEntityInfo * entityInfo
Definition: Index.h:6110
unsigned numAttributes
Definition: Index.h:6129
const CXIdxAttrInfo *const * attributes
Definition: Index.h:6128
CXCursor cursor
Definition: Index.h:6111
int isContainer
Definition: Index.h:6121
const CXIdxContainerInfo * lexicalContainer
Generally same as semanticContainer but can be different in cases like out-of-line C++ member functio...
Definition: Index.h:6118
const char * USR
Definition: Index.h:6090
const char * name
Definition: Index.h:6089
CXIdxEntityKind kind
Definition: Index.h:6086
CXCursor cursor
Definition: Index.h:6091
CXIdxEntityCXXTemplateKind templateKind
Definition: Index.h:6087
CXIdxEntityLanguage lang
Definition: Index.h:6088
unsigned numAttributes
Definition: Index.h:6093
const CXIdxAttrInfo *const * attributes
Definition: Index.h:6092
Data for IndexerCallbacks::indexEntityReference.
Definition: Index.h:6229
CXIdxEntityRefKind kind
Definition: Index.h:6230
CXCursor cursor
Reference cursor.
Definition: Index.h:6234
const CXIdxContainerInfo * container
Lexical container context of the reference.
Definition: Index.h:6255
CXSymbolRole role
Sets of symbol roles of the reference.
Definition: Index.h:6259
const CXIdxEntityInfo * referencedEntity
The entity that gets referenced.
Definition: Index.h:6239
CXIdxLoc loc
Definition: Index.h:6235
const CXIdxEntityInfo * parentEntity
Immediate "parent" of the reference.
Definition: Index.h:6251
const CXIdxAttrInfo * attrInfo
Definition: Index.h:6101
const CXIdxEntityInfo * objcClass
Definition: Index.h:6102
Data for IndexerCallbacks::importedASTFile.
Definition: Index.h:5990
CXIdxLoc loc
Location where the file is imported.
Definition: Index.h:6002
CXFile file
Top level AST file containing the imported PCH, module or submodule.
Definition: Index.h:5994
int isImplicit
Non-zero if an inclusion directive was automatically turned into a module import.
Definition: Index.h:6007
CXModule module
The imported module or NULL if the AST file is a PCH.
Definition: Index.h:5998
Data for ppIncludedFile callback.
Definition: Index.h:5965
CXIdxLoc hashLoc
Location of '#' in the #include/#import directive.
Definition: Index.h:5969
CXFile file
The actual file that the #include/#import directive resolved to.
Definition: Index.h:5977
int isModuleImport
Non-zero if the directive was automatically turned into a module import.
Definition: Index.h:5984
const char * filename
Filename as written in the #include/#import directive.
Definition: Index.h:5973
Source location passed to index callbacks.
Definition: Index.h:5957
unsigned int_data
Definition: Index.h:5959
const CXIdxEntityInfo * objcClass
Definition: Index.h:6171
const CXIdxObjCProtocolRefListInfo * protocols
Definition: Index.h:6174
const CXIdxObjCContainerDeclInfo * containerInfo
Definition: Index.h:6170
const CXIdxDeclInfo * declInfo
Definition: Index.h:6142
CXIdxObjCContainerKind kind
Definition: Index.h:6143
const CXIdxBaseClassInfo * superInfo
Definition: Index.h:6165
const CXIdxObjCContainerDeclInfo * containerInfo
Definition: Index.h:6164
const CXIdxObjCProtocolRefListInfo * protocols
Definition: Index.h:6166
const CXIdxEntityInfo * setter
Definition: Index.h:6180
const CXIdxEntityInfo * getter
Definition: Index.h:6179
const CXIdxDeclInfo * declInfo
Definition: Index.h:6178
const CXIdxEntityInfo * protocol
Definition: Index.h:6153
const CXIdxObjCProtocolRefInfo *const * protocols
Definition: Index.h:6159
Index initialization options.
Definition: Index.h:353
unsigned char ThreadBackgroundPriorityForEditing
A CXChoice enumerator that specifies the editing priority policy.
Definition: Index.h:370
unsigned char ThreadBackgroundPriorityForIndexing
A CXChoice enumerator that specifies the indexing priority policy.
Definition: Index.h:365
unsigned Size
The size of struct CXIndexOptions used for option versioning.
Definition: Index.h:360
const char * InvocationEmissionPath
Specifies a path which will contain log files for certain libclang invocations.
Definition: Index.h:400
unsigned ExcludeDeclarationsFromPCH
Definition: Index.h:374
unsigned StorePreamblesInMemory
Store PCH in memory.
Definition: Index.h:382
const char * PreambleStoragePath
The path to a directory, in which to store temporary PCH files.
Definition: Index.h:395
unsigned DisplayDiagnostics
Definition: Index.h:378
Describes the availability of a given entity on a particular platform, e.g., a particular class might...
Definition: Index.h:2450
CXString Platform
A string that describes the platform for which this structure provides availability information.
Definition: Index.h:2457
CXVersion Obsoleted
The version number in which this entity was obsoleted, and therefore is no longer available.
Definition: Index.h:2471
CXString Message
An optional message to provide to a user of this API, e.g., to suggest replacement APIs.
Definition: Index.h:2480
int Unavailable
Whether the entity is unconditionally unavailable on this platform.
Definition: Index.h:2475
CXVersion Deprecated
The version number in which this entity was deprecated (but is still available).
Definition: Index.h:2466
CXVersion Introduced
The version number in which this entity was introduced.
Definition: Index.h:2461
Identifies a specific source location within a translation unit.
Identifies an array of ranges.
Identifies a half-open character range in the source code.
A character string.
Definition: CXString.h:37
enum CXTUResourceUsageKind kind
Definition: Index.h:1121
unsigned long amount
Definition: Index.h:1124
The memory usage of a CXTranslationUnit, broken into categories.
Definition: Index.h:1130
CXTUResourceUsageEntry * entries
Definition: Index.h:1139
unsigned numEntries
Definition: Index.h:1135
Describes a single preprocessing token.
Definition: Index.h:4745
The type of an element in the abstract syntax tree.
Definition: Index.h:3019
Provides the contents of a file that has not yet been saved to disk.
Definition: Index.h:106
const char * Filename
The file whose contents have not yet been saved.
Definition: Index.h:112
unsigned long Length
The length of the unsaved contents of this buffer.
Definition: Index.h:122
const char * Contents
A buffer containing the unsaved contents of this file.
Definition: Index.h:117
Describes a version number of the form major.minor.subminor.
Definition: Index.h:154
int Major
The major version number, e.g., the '10' in '10.7.3'.
Definition: Index.h:159
int Subminor
The subminor version number, e.g., the '3' in '10.7.3'.
Definition: Index.h:171
int Minor
The minor version number, e.g., the '7' in '10.7.3'.
Definition: Index.h:165
A group of callbacks used by clang_indexSourceFile and clang_indexTranslationUnit.
Definition: Index.h:6266