Index.h revision 04b6748ee90649069ee79464317ae6cd6aca317d
1d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\ 2d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* *| 3d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* The LLVM Compiler Infrastructure *| 4d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* *| 5d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* This file is distributed under the University of Illinois Open Source *| 6d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* License. See LICENSE.TXT for details. *| 7d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* *| 8d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|*===----------------------------------------------------------------------===*| 9d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* *| 10d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* This header provides a public inferface to a Clang library for extracting *| 11d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* high-level symbol information from source files without exposing the full *| 12d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* Clang C++ API. *| 13d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek|* *| 14d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek\*===----------------------------------------------------------------------===*/ 15d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek 16d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#ifndef CLANG_C_INDEX_H 17d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#define CLANG_C_INDEX_H 18d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek 1988145034694ed5267fa6fa5febc54fadc02bd479Steve Naroff#include <sys/stat.h> 203d31560343856c573376a04558a7111e7afad4f7Chandler Carruth#include <time.h> 210a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor#include <stdio.h> 2288145034694ed5267fa6fa5febc54fadc02bd479Steve Naroff 23db2a685287e57d9dfec09c867152c465af6fc6b0Arnaud A. de Grandmaison#include "clang-c/Platform.h" 24db2a685287e57d9dfec09c867152c465af6fc6b0Arnaud A. de Grandmaison#include "clang-c/CXString.h" 25db2a685287e57d9dfec09c867152c465af6fc6b0Arnaud A. de Grandmaison 264d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis/** 274d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * \brief The version constants for the libclang API. 284d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * CINDEX_VERSION_MINOR should increase when there are API additions. 294d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes. 304d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * 314d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * The policy about the libclang API was always to keep it source and ABI 324d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. 334d9eff53c49a2c1b9b460b899c95dcdbb3e056e1Argyrios Kyrtzidis */ 34ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION_MAJOR 0 35411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis#define CINDEX_VERSION_MINOR 16 36ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis 37ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION_ENCODE(major, minor) ( \ 38ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis ((major) * 10000) \ 39ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis + ((minor) * 1)) 40ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis 41ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ 42ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis CINDEX_VERSION_MAJOR, \ 43ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis CINDEX_VERSION_MINOR ) 44ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis 45ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION_STRINGIZE_(major, minor) \ 46ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis #major"."#minor 47ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION_STRINGIZE(major, minor) \ 48ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis CINDEX_VERSION_STRINGIZE_(major, minor) 49ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis 50ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis#define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE( \ 51ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis CINDEX_VERSION_MAJOR, \ 52ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis CINDEX_VERSION_MINOR) 53ca9805a79dad01f12fa13c245f48724203699f08Argyrios Kyrtzidis 54d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#ifdef __cplusplus 55d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenekextern "C" { 56d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#endif 57d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek 5887fb9404cd962b78c98947d75d68be1691c4e737Douglas Gregor/** \defgroup CINDEX libclang: C Interface to Clang 5920d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor * 601efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * The C Interface to Clang provides a relatively small API that exposes 61f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * facilities for parsing source code into an abstract syntax tree (AST), 62f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * loading already-parsed ASTs, traversing the AST, associating 63f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * physical source locations with elements within the AST, and other 64f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * facilities that support Clang-based development tools. 65f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * 661efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * This C interface to Clang will never provide all of the information 67f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * representation stored in Clang's C++ AST, nor should it: the intent is to 68f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * maintain an API that is relatively stable from one release to the next, 69f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * providing only the basic functionality needed to support development tools. 701efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * 711efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * To avoid namespace pollution, data types are prefixed with "CX" and 72f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * functions are prefixed with "clang_". 7320d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor * 7420d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor * @{ 7520d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor */ 761efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 777f17376e0931a337d544b75d9030bc92763be287Douglas Gregor/** 787f17376e0931a337d544b75d9030bc92763be287Douglas Gregor * \brief An "index" that consists of a set of translation units that would 797f17376e0931a337d544b75d9030bc92763be287Douglas Gregor * typically be linked together into an executable or library. 807f17376e0931a337d544b75d9030bc92763be287Douglas Gregor */ 817f17376e0931a337d544b75d9030bc92763be287Douglas Gregortypedef void *CXIndex; 82600866cc7d6d9ec2e27d4b6d6ec461f6463b5ab6Steve Naroff 837f17376e0931a337d544b75d9030bc92763be287Douglas Gregor/** 847f17376e0931a337d544b75d9030bc92763be287Douglas Gregor * \brief A single translation unit, which resides in an index. 857f17376e0931a337d544b75d9030bc92763be287Douglas Gregor */ 860a90d32523bfe5fa63e11b648686c9699f786d15Ted Kremenektypedef struct CXTranslationUnitImpl *CXTranslationUnit; 87600866cc7d6d9ec2e27d4b6d6ec461f6463b5ab6Steve Naroff 887f17376e0931a337d544b75d9030bc92763be287Douglas Gregor/** 89c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Opaque pointer representing client data that will be passed through 90c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * to various callbacks and visitors. 917f17376e0931a337d544b75d9030bc92763be287Douglas Gregor */ 92c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregortypedef void *CXClientData; 931efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 94735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor/** 95735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * \brief Provides the contents of a file that has not yet been saved to disk. 96735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * 97735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * Each CXUnsavedFile instance provides the name of a file on the 98735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * system along with the current contents of that file that have not 99735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * yet been saved to disk. 100735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor */ 101735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregorstruct CXUnsavedFile { 1021efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 1031efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief The file whose contents have not yet been saved. 104735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * 105735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor * This file must already exist in the file system. 106735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor */ 107735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor const char *Filename; 108735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor 1091efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 110c8dfe5ece04e683106eb96c58a2999f70b53ac21Douglas Gregor * \brief A buffer containing the unsaved contents of this file. 111735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor */ 112735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor const char *Contents; 113735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor 114735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor /** 115c8dfe5ece04e683106eb96c58a2999f70b53ac21Douglas Gregor * \brief The length of the unsaved contents of this buffer. 116735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor */ 117735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor unsigned long Length; 118735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor}; 119735df88a38e80c1ca70daa889aa516b8b9f54b50Douglas Gregor 120076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne/** 121076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * \brief Describes the availability of a particular entity, which indicates 122076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * whether the use of this entity will result in a warning or error due to 123076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * it being deprecated or unavailable. 124076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne */ 12558ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregorenum CXAvailabilityKind { 126076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne /** 127076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * \brief The entity is available. 128076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne */ 12958ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor CXAvailability_Available, 130076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne /** 131076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * \brief The entity is available, but has been deprecated (and its use is 132076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * not recommended). 133076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne */ 13458ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor CXAvailability_Deprecated, 135076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne /** 136076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne * \brief The entity is not available; any use of it will be an error. 137076c22a99ed82e11b59e8fbf57d8467ceb3fec77Peter Collingbourne */ 138d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen CXAvailability_NotAvailable, 139d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen /** 140d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen * \brief The entity is available, but not accessible; any use of it will be 141d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen * an error. 142d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen */ 143d12059673dcef32bc2b6bae5321654d33863afe6Erik Verbruggen CXAvailability_NotAccessible 14458ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor}; 145cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor 146cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor/** 147cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief Describes a version number of the form major.minor.subminor. 148cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 149cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregortypedef struct CXVersion { 150cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 151cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The major version number, e.g., the '10' in '10.7.3'. A negative 152cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * value indicates that there is no version number at all. 153cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 154cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int Major; 155cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 156cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The minor version number, e.g., the '7' in '10.7.3'. This value 157cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * will be negative if no minor version number was provided, e.g., for 158cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * version '10'. 159cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 160cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int Minor; 161cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 162cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The subminor version number, e.g., the '3' in '10.7.3'. This value 163cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * will be negative if no minor or subminor version number was provided, 164cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * e.g., in version '10' or '10.7'. 165cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 166cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int Subminor; 167cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor} CXVersion; 16858ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor 1697f17376e0931a337d544b75d9030bc92763be287Douglas Gregor/** 1707eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Provides a shared context for creating translation units. 1717eee0184570366285589d788bcd7f5dda8345915James Dennett * 1727eee0184570366285589d788bcd7f5dda8345915James Dennett * It provides two options: 173e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * 174e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" 175e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * declarations (when loading any new translation units). A "local" declaration 1761efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * is one that belongs in the translation unit itself and not in a precompiled 177e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * header that was used by the translation unit. If zero, all declarations 178e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * will be enumerated. 179e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff * 180b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * Here is an example: 181b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * 1827eee0184570366285589d788bcd7f5dda8345915James Dennett * \code 1830a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * // excludeDeclsFromPCH = 1, displayDiagnostics=1 1840a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * Idx = clang_createIndex(1, 1); 185b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * 186b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * // IndexTest.pch was produced with the following command: 187b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" 188b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); 189b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * 190b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * // This will load all the symbols from 'IndexTest.pch' 1911efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * clang_visitChildren(clang_getTranslationUnitCursor(TU), 192002a528ab0189fc60cfbf9328962c96ccbe567eeDouglas Gregor * TranslationUnitVisitor, 0); 193b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * clang_disposeTranslationUnit(TU); 194b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * 195b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * // This will load all the symbols from 'IndexTest.c', excluding symbols 196b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * // from 'IndexTest.pch'. 197fd9f23464bfd35314c87c4df410f3937d59eb96dDaniel Dunbar * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; 198fd9f23464bfd35314c87c4df410f3937d59eb96dDaniel Dunbar * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, 199fd9f23464bfd35314c87c4df410f3937d59eb96dDaniel Dunbar * 0, 0); 200b2cd48756119f4d8d2a865b4b3e0e8efd02e26a0Douglas Gregor * clang_visitChildren(clang_getTranslationUnitCursor(TU), 201b2cd48756119f4d8d2a865b4b3e0e8efd02e26a0Douglas Gregor * TranslationUnitVisitor, 0); 202b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * clang_disposeTranslationUnit(TU); 2037eee0184570366285589d788bcd7f5dda8345915James Dennett * \endcode 204b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * 205b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * This process of creating the 'pch', loading it separately, and using it (via 206b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks 207b4ece6377d95e35a8df01cd010d910c34d690f67Steve Naroff * (which gives the indexer the same performance benefit as the compiler). 208e56b4baeba5097852e04bc41ca2e0396cf729955Steve Naroff */ 2090a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas GregorCINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, 2100a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor int displayDiagnostics); 211896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 2120087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor/** 2130087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor * \brief Destroy the given index. 2140087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor * 2150087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor * The index must not be destroyed until all of the translation units created 2160087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor * within that index have been destroyed. 2170087e1a12b67b6bb032a72ea485a863daeccf55bDouglas Gregor */ 2188506dde586459887b7e14e23a30af8ac5be5adb6Daniel DunbarCINDEX_LINKAGE void clang_disposeIndex(CXIndex index); 2191efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 220fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidistypedef enum { 221fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis /** 222fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \brief Used to indicate that no special CXIndex options are needed. 223fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 224fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_None = 0x0, 225fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 226fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis /** 227fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \brief Used to indicate that threads that libclang creates for indexing 228fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * purposes should use background priority. 2297eee0184570366285589d788bcd7f5dda8345915James Dennett * 2307eee0184570366285589d788bcd7f5dda8345915James Dennett * Affects #clang_indexSourceFile, #clang_indexTranslationUnit, 2317eee0184570366285589d788bcd7f5dda8345915James Dennett * #clang_parseTranslationUnit, #clang_saveTranslationUnit. 232fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 233fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1, 234fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 235fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis /** 236fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \brief Used to indicate that threads that libclang creates for editing 237fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * purposes should use background priority. 2387eee0184570366285589d788bcd7f5dda8345915James Dennett * 2397eee0184570366285589d788bcd7f5dda8345915James Dennett * Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, 2407eee0184570366285589d788bcd7f5dda8345915James Dennett * #clang_annotateTokens 241fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 242fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2, 243fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 244fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis /** 245fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \brief Used to indicate that all threads that libclang creates should use 246fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * background priority. 247fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 248fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_ThreadBackgroundPriorityForAll = 249fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_ThreadBackgroundPriorityForIndexing | 250fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis CXGlobalOpt_ThreadBackgroundPriorityForEditing 251fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 252fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis} CXGlobalOptFlags; 253fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 254fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis/** 2557eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Sets general options associated with a CXIndex. 256fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * 257fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * For example: 258fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \code 259fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * CXIndex idx = ...; 260fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * clang_CXIndex_setGlobalOptions(idx, 261fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * clang_CXIndex_getGlobalOptions(idx) | 262fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * CXGlobalOpt_ThreadBackgroundPriorityForIndexing); 263fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \endcode 264fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * 265fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. 266fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 267fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios KyrtzidisCINDEX_LINKAGE void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options); 268fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 269fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis/** 270fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \brief Gets the general options associated with a CXIndex. 271fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * 272fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that 273fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis * are associated with the given CXIndex object. 274fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis */ 275fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios KyrtzidisCINDEX_LINKAGE unsigned clang_CXIndex_getGlobalOptions(CXIndex); 276fdc1795acc9d5d73a767cc7d43ad1546e93adbbaArgyrios Kyrtzidis 2771efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar/** 278c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_FILES File manipulation routines 279f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * 280f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * @{ 281f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 2821efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 283f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 284f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * \brief A particular source file that is part of a translation unit. 285f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 286f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregortypedef void *CXFile; 2871efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 288f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor 289f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 290f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * \brief Retrieve the complete file and path name of the given file. 29188145034694ed5267fa6fa5febc54fadc02bd479Steve Naroff */ 29274844072411bae91d5dbb89955d200cbe1e0a1c8Ted KremenekCINDEX_LINKAGE CXString clang_getFileName(CXFile SFile); 2931efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 294f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 295f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * \brief Retrieve the last modification time of the given file. 296f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 29708b0e8daeb683686b876d72674962ad96df21d45Douglas GregorCINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); 29888145034694ed5267fa6fa5febc54fadc02bd479Steve Naroff 2993c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor/** 300db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * \brief Uniquely identifies a CXFile, that refers to the same underlying file, 301db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * across an indexing session. 302db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis */ 303db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidistypedef struct { 304db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis unsigned long long data[3]; 305db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis} CXFileUniqueID; 306db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis 307db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis/** 308db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * \brief Retrieve the unique ID for the given \c file. 309db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * 310db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * \param file the file to get the ID for. 311db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * \param outID stores the returned CXFileUniqueID. 312db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * \returns If there was a failure getting the unique ID, returns non-zero, 313db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis * otherwise returns 0. 314db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis*/ 315db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios KyrtzidisCINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID); 316db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis 317db84e7a44dce24c3a8e4e0fc84434c00fc2da168Argyrios Kyrtzidis/** 318dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregor * \brief Determine whether the given header is guarded against 319dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregor * multiple inclusions, either with the conventional 3207eee0184570366285589d788bcd7f5dda8345915James Dennett * \#ifndef/\#define/\#endif macro guards or with \#pragma once. 321dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregor */ 322dd3e5549e3c11e217078938aacf72f042eea5343Douglas GregorCINDEX_LINKAGE unsigned 323dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregorclang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file); 324dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregor 325dd3e5549e3c11e217078938aacf72f042eea5343Douglas Gregor/** 326b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \brief Retrieve a file handle within the given translation unit. 327b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * 328b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \param tu the translation unit 3291efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * 330b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \param file_name the name of the file. 331b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * 332b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \returns the file handle for the named file in the translation unit \p tu, 333b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * or a NULL file handle if the file was not a part of this translation unit. 334b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor */ 3351efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel DunbarCINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, 336b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor const char *file_name); 3371efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 338b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor/** 339f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * @} 340f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 341f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor 342f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 343f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * \defgroup CINDEX_LOCATIONS Physical source locations 344f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * 345f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * Clang represents physical source locations in its abstract syntax tree in 346f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * great detail, with file, line, and column information for the majority of 347f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * the tokens parsed in the source code. These data types and functions are 348f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * used to represent source location information, either for a particular 349f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * point in the program or for a range of points in the program, and extract 350f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * specific location information from those data types. 351f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * 352f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * @{ 353f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 3541efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 355f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 3561db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * \brief Identifies a specific source location within a translation 3571db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * unit. 3581db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * 35920174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * Use clang_getExpansionLocation() or clang_getSpellingLocation() 360a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * to map a source location to a particular file, line, and column. 3613c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor */ 3623c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregortypedef struct { 363e2748288a04cda2e976a3fe859e4334afaf9274aArgyrios Kyrtzidis const void *ptr_data[2]; 3641db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor unsigned int_data; 3653c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor} CXSourceLocation; 366fe6fd3d41a7f48317d6856c9327b6cead32c3498Ted Kremenek 3673c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor/** 368d52864bd33c66aacc84133460d8c9c0dfcdd5c18Daniel Dunbar * \brief Identifies a half-open character range in the source code. 3693c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor * 3701db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the 3711db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * starting and end locations from a source range, respectively. 3723c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor */ 3733c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregortypedef struct { 374e2748288a04cda2e976a3fe859e4334afaf9274aArgyrios Kyrtzidis const void *ptr_data[2]; 3751db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor unsigned begin_int_data; 3761db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor unsigned end_int_data; 3773c7313d96cd4a18cd8c1fcd3ddd8128c2fcbe58fDouglas Gregor} CXSourceRange; 378fe6fd3d41a7f48317d6856c9327b6cead32c3498Ted Kremenek 3791db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor/** 380b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \brief Retrieve a NULL (invalid) source location. 381b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor */ 382f9c21665faa7e4936d484396469ee7afc46e1f00NAKAMURA TakumiCINDEX_LINKAGE CXSourceLocation clang_getNullLocation(void); 3831efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 384b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor/** 3857eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Determine whether two source locations, which must refer into 3861efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * the same translation unit, refer to exactly the same point in the source 387b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * code. 388b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * 389b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \returns non-zero if the source locations refer to the same location, zero 390b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * if they refer to different locations. 391b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor */ 392b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas GregorCINDEX_LINKAGE unsigned clang_equalLocations(CXSourceLocation loc1, 393b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor CXSourceLocation loc2); 3941efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 395b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor/** 3961efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Retrieves the source location associated with a given file/line/column 3971efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * in a particular translation unit. 398b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor */ 399b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas GregorCINDEX_LINKAGE CXSourceLocation clang_getLocation(CXTranslationUnit tu, 400b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor CXFile file, 401b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor unsigned line, 402b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor unsigned column); 40383889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall/** 40483889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall * \brief Retrieves the source location associated with a given character offset 40583889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall * in a particular translation unit. 40683889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall */ 40783889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid ChisnallCINDEX_LINKAGE CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu, 40883889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall CXFile file, 40983889a7f1f338e343ef72aeeef9c27f7b62c0f0fDavid Chisnall unsigned offset); 4101efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 411b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor/** 4125352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Retrieve a NULL (invalid) source range. 4135352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 414f9c21665faa7e4936d484396469ee7afc46e1f00NAKAMURA TakumiCINDEX_LINKAGE CXSourceRange clang_getNullRange(void); 415896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4165352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 417b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \brief Retrieve a source range given the beginning and ending source 418b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * locations. 419b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor */ 420b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas GregorCINDEX_LINKAGE CXSourceRange clang_getRange(CXSourceLocation begin, 421b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor CXSourceLocation end); 4221efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 423b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor/** 424ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor * \brief Determine whether two ranges are equivalent. 425ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor * 426ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor * \returns non-zero if the ranges are the same, zero if they differ. 427ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor */ 428ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas GregorCINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, 429ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor CXSourceRange range2); 430ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor 431ab4e83b904d81d8ab1f8c594655822a023cad87dDouglas Gregor/** 4321824d54df85a462ada812dadda18130f951d40f3Dmitri Gribenko * \brief Returns non-zero if \p range is null. 433de5db649fd5f9aedde200f443ad73d62517b1c88Argyrios Kyrtzidis */ 434733dbc805facad7cebec5420f6c47c83848cee5fErik VerbruggenCINDEX_LINKAGE int clang_Range_isNull(CXSourceRange range); 435de5db649fd5f9aedde200f443ad73d62517b1c88Argyrios Kyrtzidis 436de5db649fd5f9aedde200f443ad73d62517b1c88Argyrios Kyrtzidis/** 43746766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor * \brief Retrieve the file, line, column, and offset represented by 43846766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor * the given source location. 4391db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * 44020174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * If the location refers into a macro expansion, retrieves the 44120174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * location of the macro expansion. 442a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 4431efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \param location the location within a source file that will be decomposed 4441efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * into its parts. 4451db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * 4461efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \param file [out] if non-NULL, will be set to the file to which the given 4471db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * source location points. 4481db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * 4491efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \param line [out] if non-NULL, will be set to the line to which the given 4501db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * source location points. 4511db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor * 4521efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \param column [out] if non-NULL, will be set to the column to which the given 4531efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * source location points. 45446766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor * 45546766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor * \param offset [out] if non-NULL, will be set to the offset into the 45646766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor * buffer to which the given source location points. 4571db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor */ 45820174221af145554b76a0b0f5e4eb3ac70d05945Chandler CarruthCINDEX_LINKAGE void clang_getExpansionLocation(CXSourceLocation location, 45920174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth CXFile *file, 46020174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth unsigned *line, 46120174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth unsigned *column, 46220174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth unsigned *offset); 46320174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth 46420174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth/** 465e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * \brief Retrieve the file, line, column, and offset represented by 466e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * the given source location, as specified in a # line directive. 467e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 468e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * Example: given the following source code in a file somefile.c 469e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 4707eee0184570366285589d788bcd7f5dda8345915James Dennett * \code 471e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * #123 "dummy.c" 1 472e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 473e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * static int func(void) 474e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * { 475e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * return 0; 476e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * } 4777eee0184570366285589d788bcd7f5dda8345915James Dennett * \endcode 478e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 479e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * the location information returned by this function would be 480e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 481e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * File: dummy.c Line: 124 Column: 12 482e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 483e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * whereas clang_getExpansionLocation would have returned 484e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 485e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * File: somefile.c Line: 3 Column: 12 486e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 487e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * \param location the location within a source file that will be decomposed 488e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * into its parts. 489e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 490e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * \param filename [out] if non-NULL, will be set to the filename of the 491e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * source location. Note that filenames returned will be for "virtual" files, 492e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * which don't necessarily exist on the machine running clang - e.g. when 493e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * parsing preprocessed output obtained from a different environment. If 494e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * a non-NULL value is passed in, remember to dispose of the returned value 495e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * using \c clang_disposeString() once you've finished with it. For an invalid 496e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * source location, an empty string is returned. 497e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 498e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * \param line [out] if non-NULL, will be set to the line number of the 499e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * source location. For an invalid source location, zero is returned. 500e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * 501e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * \param column [out] if non-NULL, will be set to the column number of the 502e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis * source location. For an invalid source location, zero is returned. 503e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis */ 504e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios KyrtzidisCINDEX_LINKAGE void clang_getPresumedLocation(CXSourceLocation location, 505e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis CXString *filename, 506e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis unsigned *line, 507e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis unsigned *column); 508e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis 509e6be34d8f77312edf9ed38034e52cb4d22c8e1c1Argyrios Kyrtzidis/** 51020174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * \brief Legacy API to retrieve the file, line, column, and offset represented 51120174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * by the given source location. 51220174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * 51320174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * This interface has been replaced by the newer interface 5147eee0184570366285589d788bcd7f5dda8345915James Dennett * #clang_getExpansionLocation(). See that interface's documentation for 51520174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth * details. 51620174221af145554b76a0b0f5e4eb3ac70d05945Chandler Carruth */ 5171db19dea8d221f27be46332d668d1e2decb7f1abDouglas GregorCINDEX_LINKAGE void clang_getInstantiationLocation(CXSourceLocation location, 5181db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor CXFile *file, 5191db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor unsigned *line, 52046766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor unsigned *column, 52146766dc31c09d89024de5aba9e22112a56eadbdfDouglas Gregor unsigned *offset); 522e69517ce61638f12c9abe4605753a45275ac4e37Douglas Gregor 523e69517ce61638f12c9abe4605753a45275ac4e37Douglas Gregor/** 524a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \brief Retrieve the file, line, column, and offset represented by 525a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * the given source location. 526a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 527a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * If the location refers into a macro instantiation, return where the 528a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * location was originally spelled in the source file. 529a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 530a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \param location the location within a source file that will be decomposed 531a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * into its parts. 532a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 533a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \param file [out] if non-NULL, will be set to the file to which the given 534a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * source location points. 535a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 536a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \param line [out] if non-NULL, will be set to the line to which the given 537a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * source location points. 538a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 539a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \param column [out] if non-NULL, will be set to the column to which the given 540a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * source location points. 541a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * 542a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * \param offset [out] if non-NULL, will be set to the offset into the 543a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor * buffer to which the given source location points. 544a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor */ 545a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas GregorCINDEX_LINKAGE void clang_getSpellingLocation(CXSourceLocation location, 546a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor CXFile *file, 547a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor unsigned *line, 548a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor unsigned *column, 549a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor unsigned *offset); 5502d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis 5512d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis/** 5522d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \brief Retrieve the file, line, column, and offset represented by 5532d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * the given source location. 5542d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5552d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * If the location refers into a macro expansion, return where the macro was 5562d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * expanded or where the macro argument was written, if the location points at 5572d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * a macro argument. 5582d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5592d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \param location the location within a source file that will be decomposed 5602d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * into its parts. 5612d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5622d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \param file [out] if non-NULL, will be set to the file to which the given 5632d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * source location points. 5642d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5652d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \param line [out] if non-NULL, will be set to the line to which the given 5662d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * source location points. 5672d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5682d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \param column [out] if non-NULL, will be set to the column to which the given 5692d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * source location points. 5702d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * 5712d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * \param offset [out] if non-NULL, will be set to the offset into the 5722d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis * buffer to which the given source location points. 5732d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis */ 5742d5c133d3dd95507db63147997109f06e8cfa833Argyrios KyrtzidisCINDEX_LINKAGE void clang_getFileLocation(CXSourceLocation location, 5752d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis CXFile *file, 5762d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis unsigned *line, 5772d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis unsigned *column, 5782d5c133d3dd95507db63147997109f06e8cfa833Argyrios Kyrtzidis unsigned *offset); 579a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor 580a9b06d4c246d6c301e3dd1844f5dba669ed9c631Douglas Gregor/** 5811efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Retrieve a source location representing the first character within a 5821efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * source range. 5831db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor */ 5841db19dea8d221f27be46332d668d1e2decb7f1abDouglas GregorCINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range); 5851db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor 5861db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor/** 5871efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Retrieve a source location representing the last character within a 5881efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * source range. 5891db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor */ 5901db19dea8d221f27be46332d668d1e2decb7f1abDouglas GregorCINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range); 5911db19dea8d221f27be46332d668d1e2decb7f1abDouglas Gregor 592f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor/** 593f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor * @} 594f55254472e496340cbb4f0a24cff398e441475b5Douglas Gregor */ 595c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 596c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 5975352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \defgroup CINDEX_DIAG Diagnostic reporting 5985352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 5995352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * @{ 6005352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6015352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6025352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 6035352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Describes the severity of a particular diagnostic. 6045352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6055352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregorenum CXDiagnosticSeverity { 6065352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor /** 607896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief A diagnostic that has been suppressed, e.g., by a command-line 6085352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * option. 6095352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6105352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXDiagnostic_Ignored = 0, 611896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 6125352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor /** 6135352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief This diagnostic is a note that should be attached to the 6145352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * previous (non-note) diagnostic. 6155352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6165352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXDiagnostic_Note = 1, 6175352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6185352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor /** 6195352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief This diagnostic indicates suspicious code that may not be 6205352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * wrong. 6215352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6225352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXDiagnostic_Warning = 2, 6235352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6245352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor /** 6255352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief This diagnostic indicates that the code is ill-formed. 6265352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6275352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXDiagnostic_Error = 3, 6285352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6295352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor /** 6305352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief This diagnostic indicates that the code is ill-formed such 6315352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * that future parser recovery is unlikely to produce useful 6325352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * results. 6335352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6345352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXDiagnostic_Fatal = 4 6355352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor}; 6365352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6375352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 6385352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief A single diagnostic, containing the diagnostic's severity, 6395352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * location, text, source ranges, and fix-it hints. 6405352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 6415352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregortypedef void *CXDiagnostic; 6425352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 6435352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 644153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief A group of CXDiagnostics. 645153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 646153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenektypedef void *CXDiagnosticSet; 647153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 648153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 649153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Determine the number of diagnostics in a CXDiagnosticSet. 650153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 651153221717e39ce41323d5bc6b8b8bf130923c1bdTed KremenekCINDEX_LINKAGE unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags); 652153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 653153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 654153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Retrieve a diagnostic associated with the given CXDiagnosticSet. 655153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * 6567eee0184570366285589d788bcd7f5dda8345915James Dennett * \param Diags the CXDiagnosticSet to query. 657153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \param Index the zero-based diagnostic number to retrieve. 658153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * 659153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \returns the requested diagnostic. This diagnostic must be freed 660153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * via a call to \c clang_disposeDiagnostic(). 661153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 662153221717e39ce41323d5bc6b8b8bf130923c1bdTed KremenekCINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags, 663153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek unsigned Index); 664153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 665153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 666153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 667153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Describes the kind of error that occurred (if any) in a call to 668153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \c clang_loadDiagnostics. 669153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 670153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenekenum CXLoadDiag_Error { 671153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek /** 672153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Indicates that no error occurred. 673153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 674153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek CXLoadDiag_None = 0, 675153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 676153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek /** 677153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Indicates that an unknown error occurred while attempting to 678153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * deserialize diagnostics. 679153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 680153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek CXLoadDiag_Unknown = 1, 681153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 682153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek /** 683153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Indicates that the file containing the serialized diagnostics 684153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * could not be opened. 685153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 686153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek CXLoadDiag_CannotLoad = 2, 687153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 688153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek /** 689153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Indicates that the serialized diagnostics file is invalid or 6907eee0184570366285589d788bcd7f5dda8345915James Dennett * corrupt. 691153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 692153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek CXLoadDiag_InvalidFile = 3 693153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek}; 694153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 695153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 696153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Deserialize a set of diagnostics from a Clang diagnostics bitcode 6977eee0184570366285589d788bcd7f5dda8345915James Dennett * file. 698153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * 6997eee0184570366285589d788bcd7f5dda8345915James Dennett * \param file The name of the file to deserialize. 7007eee0184570366285589d788bcd7f5dda8345915James Dennett * \param error A pointer to a enum value recording if there was a problem 701153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * deserializing the diagnostics. 7027eee0184570366285589d788bcd7f5dda8345915James Dennett * \param errorString A pointer to a CXString for recording the error string 703153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * if the file was not successfully loaded. 704153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * 705153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These 7067eee0184570366285589d788bcd7f5dda8345915James Dennett * diagnostics should be released using clang_disposeDiagnosticSet(). 707153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 708153221717e39ce41323d5bc6b8b8bf130923c1bdTed KremenekCINDEX_LINKAGE CXDiagnosticSet clang_loadDiagnostics(const char *file, 709153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek enum CXLoadDiag_Error *error, 710153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek CXString *errorString); 711153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 712153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 713153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek * \brief Release a CXDiagnosticSet and all of its contained diagnostics. 714153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 715153221717e39ce41323d5bc6b8b8bf130923c1bdTed KremenekCINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags); 716153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 717153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 7187eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Retrieve the child diagnostics of a CXDiagnostic. 7197eee0184570366285589d788bcd7f5dda8345915James Dennett * 7207eee0184570366285589d788bcd7f5dda8345915James Dennett * This CXDiagnosticSet does not need to be released by 7217eee0184570366285589d788bcd7f5dda8345915James Dennett * clang_diposeDiagnosticSet. 722153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek */ 723153221717e39ce41323d5bc6b8b8bf130923c1bdTed KremenekCINDEX_LINKAGE CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic D); 724153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek 725153221717e39ce41323d5bc6b8b8bf130923c1bdTed Kremenek/** 726a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \brief Determine the number of diagnostics produced for the given 727a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * translation unit. 728a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor */ 729a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas GregorCINDEX_LINKAGE unsigned clang_getNumDiagnostics(CXTranslationUnit Unit); 730a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor 731a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor/** 732a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \brief Retrieve a diagnostic associated with the given translation unit. 7335352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 734a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \param Unit the translation unit to query. 735a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \param Index the zero-based diagnostic number to retrieve. 7365352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 737a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \returns the requested diagnostic. This diagnostic must be freed 738a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * via a call to \c clang_disposeDiagnostic(). 7395352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 740a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas GregorCINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, 741a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor unsigned Index); 742a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor 743a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor/** 7440373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek * \brief Retrieve the complete set of diagnostics associated with a 7450373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek * translation unit. 7460373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek * 7470373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek * \param Unit the translation unit to query. 7480373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek */ 7490373fcc3e5b205cc26656c70d7dff737b0e08345Ted KremenekCINDEX_LINKAGE CXDiagnosticSet 7500373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek clang_getDiagnosticSetFromTU(CXTranslationUnit Unit); 7510373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek 7520373fcc3e5b205cc26656c70d7dff737b0e08345Ted Kremenek/** 753a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \brief Destroy a diagnostic. 754a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor */ 755a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas GregorCINDEX_LINKAGE void clang_disposeDiagnostic(CXDiagnostic Diagnostic); 7565352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 7575352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 7580a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \brief Options to control the display of diagnostics. 7590a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 7600a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * The values in this enum are meant to be combined to customize the 7610a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * behavior of \c clang_displayDiagnostic(). 7620a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 7630a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregorenum CXDiagnosticDisplayOptions { 7640a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor /** 7650a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \brief Display the source-location information where the 7660a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * diagnostic was located. 7670a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 7680a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * When set, diagnostics will be prefixed by the file, line, and 7690a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * (optionally) column to which the diagnostic refers. For example, 7700a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 7710a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \code 7720a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * test.c:28: warning: extra tokens at end of #endif directive 7730a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \endcode 7740a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 7750a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * This option corresponds to the clang flag \c -fshow-source-location. 7760a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 7770a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor CXDiagnostic_DisplaySourceLocation = 0x01, 7780a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor 7790a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor /** 7800a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \brief If displaying the source-location information of the 7810a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * diagnostic, also include the column number. 7820a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 7830a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * This option corresponds to the clang flag \c -fshow-column. 7840a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 7850a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor CXDiagnostic_DisplayColumn = 0x02, 7860a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor 7870a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor /** 7880a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \brief If displaying the source-location information of the 7890a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * diagnostic, also include information about source ranges in a 7900a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * machine-parsable format. 7910a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 792896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * This option corresponds to the clang flag 7930a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \c -fdiagnostics-print-source-range-info. 7940a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 795aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor CXDiagnostic_DisplaySourceRanges = 0x04, 796aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 797aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor /** 798aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \brief Display the option name associated with this diagnostic, if any. 799aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 800aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * The option name displayed (e.g., -Wconversion) will be placed in brackets 801aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * after the diagnostic text. This option corresponds to the clang flag 802aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \c -fdiagnostics-show-option. 803aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 804aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor CXDiagnostic_DisplayOption = 0x08, 805aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 806aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor /** 807aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \brief Display the category number associated with this diagnostic, if any. 808aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 809aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * The category number is displayed within brackets after the diagnostic text. 810aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * This option corresponds to the clang flag 811aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \c -fdiagnostics-show-category=id. 812aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 813aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor CXDiagnostic_DisplayCategoryId = 0x10, 814aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 815aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor /** 816aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \brief Display the category name associated with this diagnostic, if any. 817aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 818aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * The category name is displayed within brackets after the diagnostic text. 819aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * This option corresponds to the clang flag 820aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \c -fdiagnostics-show-category=name. 821aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 822aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor CXDiagnostic_DisplayCategoryName = 0x20 8230a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor}; 8240a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor 8250a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor/** 826274f1906f12ebf8fcc179701deeda6d3271120c1Douglas Gregor * \brief Format the given diagnostic in a manner that is suitable for display. 8270a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 828274f1906f12ebf8fcc179701deeda6d3271120c1Douglas Gregor * This routine will format the given diagnostic to a string, rendering 829896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * the diagnostic according to the various options given. The 830896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \c clang_defaultDiagnosticDisplayOptions() function returns the set of 8310a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * options that most closely mimics the behavior of the clang compiler. 8320a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 8330a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \param Diagnostic The diagnostic to print. 8340a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 835896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \param Options A set of options that control the diagnostic display, 8360a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * created by combining \c CXDiagnosticDisplayOptions values. 837274f1906f12ebf8fcc179701deeda6d3271120c1Douglas Gregor * 838274f1906f12ebf8fcc179701deeda6d3271120c1Douglas Gregor * \returns A new string containing for formatted diagnostic. 8390a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 840274f1906f12ebf8fcc179701deeda6d3271120c1Douglas GregorCINDEX_LINKAGE CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, 841274f1906f12ebf8fcc179701deeda6d3271120c1Douglas Gregor unsigned Options); 8420a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor 8430a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor/** 8440a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \brief Retrieve the set of display options most similar to the 8450a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * default behavior of the clang compiler. 8460a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * 8470a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * \returns A set of display options suitable for use with \c 8480a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor * clang_displayDiagnostic(). 8490a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor */ 8500a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas GregorCINDEX_LINKAGE unsigned clang_defaultDiagnosticDisplayOptions(void); 8510a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor 8520a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas Gregor/** 8535352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Determine the severity of the given diagnostic. 8545352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 855896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE enum CXDiagnosticSeverity 8565352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregorclang_getDiagnosticSeverity(CXDiagnostic); 8575352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 8585352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 8595352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Retrieve the source location of the given diagnostic. 8605352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 8615352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * This location is where Clang would print the caret ('^') when 8625352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * displaying the diagnostic on the command line. 8635352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 8645352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic); 8655352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 8665352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 8675352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Retrieve the text of the given diagnostic. 8685352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 8695352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE CXString clang_getDiagnosticSpelling(CXDiagnostic); 870a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor 871a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor/** 872aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \brief Retrieve the name of the command-line option that enabled this 873aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * diagnostic. 874aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 875aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \param Diag The diagnostic to be queried. 876aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 877aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \param Disable If non-NULL, will be set to the option that disables this 878aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * diagnostic (if any). 879aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 880aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \returns A string that contains the command-line option used to enable this 881aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * warning, such as "-Wconversion" or "-pedantic". 882aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 883aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas GregorCINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag, 884aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor CXString *Disable); 885aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 886aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor/** 887aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \brief Retrieve the category number for this diagnostic. 888aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 889aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * Diagnostics can be categorized into groups along with other, related 890aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * diagnostics (e.g., diagnostics under the same warning flag). This routine 891aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * retrieves the category number for the given diagnostic. 892aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 893aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \returns The number of the category that contains this diagnostic, or zero 894aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * if this diagnostic is uncategorized. 895aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 896aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas GregorCINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic); 897aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 898aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor/** 89978d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * \brief Retrieve the name of a particular diagnostic category. This 90078d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * is now deprecated. Use clang_getDiagnosticCategoryText() 90178d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * instead. 902aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 903aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \param Category A diagnostic category number, as returned by 904aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \c clang_getDiagnosticCategory(). 905aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * 906aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor * \returns The name of the given diagnostic category. 907aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor */ 90878d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted KremenekCINDEX_DEPRECATED CINDEX_LINKAGE 90978d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted KremenekCXString clang_getDiagnosticCategoryName(unsigned Category); 91078d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek 91178d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek/** 91278d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * \brief Retrieve the diagnostic category text for a given diagnostic. 91378d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * 91478d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek * \returns The text of the given diagnostic category. 91578d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted Kremenek */ 91678d5d3bb9386a5aa31d19445eb8f81bf2652acb4Ted KremenekCINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic); 917aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor 918aa5f135f8db82b5e5fb1640fd51f8078e0b2d82dDouglas Gregor/** 919a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * \brief Determine the number of source ranges associated with the given 920a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * diagnostic. 921a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor */ 922a3890baf1256ff26081306c7fef70202f8223f41Douglas GregorCINDEX_LINKAGE unsigned clang_getDiagnosticNumRanges(CXDiagnostic); 923896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 9245352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 925a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * \brief Retrieve a source range associated with the diagnostic. 9265352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 927a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * A diagnostic's source ranges highlight important elements in the source 9285352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * code. On the command line, Clang displays source ranges by 929896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * underlining them with '~' characters. 9305352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 931a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * \param Diagnostic the diagnostic whose range is being extracted. 9325352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 933896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \param Range the zero-based index specifying which range to 9345352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 935a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor * \returns the requested source range. 9365352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 937896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diagnostic, 938a3890baf1256ff26081306c7fef70202f8223f41Douglas Gregor unsigned Range); 9395352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 9405352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 9415352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Determine the number of fix-it hints associated with the 9425352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * given diagnostic. 9435352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 9445352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diagnostic); 9455352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 9465352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 947473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * \brief Retrieve the replacement information for a given fix-it. 9485352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 949473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * Fix-its are described in terms of a source range whose contents 950473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * should be replaced by a string. This approach generalizes over 951473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * three kinds of operations: removal of source code (the range covers 952473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * the code to be removed and the replacement string is empty), 953473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * replacement of source code (the range covers the code to be 954473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * replaced and the replacement string provides the new code), and 955473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * insertion (both the start and end of the range point at the 956473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * insertion location, and the replacement string provides the text to 957473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * insert). 9585352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 959473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * \param Diagnostic The diagnostic whose fix-its are being queried. 9605352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 961473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * \param FixIt The zero-based index of the fix-it. 9625352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 963473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * \param ReplacementRange The source range whose contents will be 964473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * replaced with the returned replacement string. Note that source 965473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * ranges are half-open ranges [a, b), so the source code should be 966473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * replaced from a and up to (but not including) b. 9675352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 968473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * \returns A string containing text that should be replace the source 969473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor * code indicated by the \c ReplacementRange. 9705352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 971896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, 972473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor unsigned FixIt, 973473d7019bb54f8a2f0140dca9e9644a935cc6b20Douglas Gregor CXSourceRange *ReplacementRange); 9745352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 9755352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 9765352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * @} 9775352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 9785352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 9795352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 9805352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \defgroup CINDEX_TRANSLATION_UNIT Translation unit manipulation 9815352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 9825352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * The routines in this group provide the ability to create and destroy 9835352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * translation units from files, either by parsing the contents of the files or 9845352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * by reading in a serialized representation of a translation unit. 9855352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 9865352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * @{ 9875352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 988896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 9895352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 9905352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Get the original translation unit source file name. 9915352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 9925352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE CXString 9935352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregorclang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); 9945352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 9955352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 9965352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Return the CXTranslationUnit for a given source file and the provided 9975352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * command line arguments one would pass to the compiler. 9985352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 9995352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * Note: The 'source_filename' argument is optional. If the caller provides a 10005352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * NULL pointer, the name of the source file is expected to reside in the 10015352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * specified command line arguments. 10025352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10035352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * Note: When encountered in 'clang_command_line_args', the following options 10045352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * are ignored: 10055352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10065352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * '-c' 10075352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * '-emit-ast' 10085352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * '-fsyntax-only' 10097eee0184570366285589d788bcd7f5dda8345915James Dennett * '-o \<output file>' (both '-o' and '\<output file>' are ignored) 10105352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10111ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * \param CIdx The index object with which the translation unit will be 10121ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * associated. 10135352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10147eee0184570366285589d788bcd7f5dda8345915James Dennett * \param source_filename The name of the source file to load, or NULL if the 10151ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * source file is included in \p clang_command_line_args. 10161ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * 10171ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * \param num_clang_command_line_args The number of command-line arguments in 10181ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * \p clang_command_line_args. 10191ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * 10201ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * \param clang_command_line_args The command-line arguments that would be 10211ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * passed to the \c clang executable if it were being invoked out-of-process. 10221ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * These command-line options will be parsed and will affect how the translation 10231ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * unit is parsed. Note that the following options are ignored: '-c', 10247eee0184570366285589d788bcd7f5dda8345915James Dennett * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'. 10255352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10265352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \param num_unsaved_files the number of unsaved file entries in \p 10275352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * unsaved_files. 10285352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * 10295352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \param unsaved_files the files that have not yet been saved to disk 10305352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * but may be required for code completion, including the contents of 1031c6f530defd937faa1c00998e60deea6368526961Ted Kremenek * those files. The contents and name of these files (as specified by 1032c6f530defd937faa1c00998e60deea6368526961Ted Kremenek * CXUnsavedFile) are copied when necessary, so the client only needs to 1033c6f530defd937faa1c00998e60deea6368526961Ted Kremenek * guarantee their validity until the call to this function returns. 10345352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 10355352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile( 10365352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor CXIndex CIdx, 10375352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor const char *source_filename, 10385352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor int num_clang_command_line_args, 10392ef6944d529c94824f5bf96f65665f5bee30f5a2Douglas Gregor const char * const *clang_command_line_args, 10405352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor unsigned num_unsaved_files, 1041a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor struct CXUnsavedFile *unsaved_files); 1042896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 10435352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 10445352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Create a translation unit from an AST file (-emit-ast). 10455352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 1046896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit(CXIndex, 1047a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor const char *ast_filename); 10485352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor 104944c181aec37789f25f6c15543c164416f72e562aDouglas Gregor/** 105044c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * \brief Flags that control the creation of translation units. 105144c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * 105244c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * The enumerators in this enumeration type are meant to be bitwise 105344c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * ORed together to specify which options should be used when 105444c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * constructing the translation unit. 105544c181aec37789f25f6c15543c164416f72e562aDouglas Gregor */ 10565a43021ac491bf091494167127772a20d9a9bb48Douglas Gregorenum CXTranslationUnit_Flags { 10575a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor /** 10585a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \brief Used to indicate that no special translation-unit options are 10595a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * needed. 10605a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor */ 10615a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor CXTranslationUnit_None = 0x0, 10625a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor 10635a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor /** 10645a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \brief Used to indicate that the parser should construct a "detailed" 10655a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * preprocessing record, including all macro definitions and instantiations. 10665a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 10675a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * Constructing a detailed preprocessing record requires more memory 10685a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * and time to parse, since the information contained in the record 10695a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * is usually not retained. However, it can be useful for 10705a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * applications that require more detailed information about the 10715a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * behavior of the preprocessor. 10725a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor */ 107344c181aec37789f25f6c15543c164416f72e562aDouglas Gregor CXTranslationUnit_DetailedPreprocessingRecord = 0x01, 107444c181aec37789f25f6c15543c164416f72e562aDouglas Gregor 107544c181aec37789f25f6c15543c164416f72e562aDouglas Gregor /** 1076b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * \brief Used to indicate that the translation unit is incomplete. 107744c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * 1078b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * When a translation unit is considered "incomplete", semantic 1079b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * analysis that is typically performed at the end of the 1080b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * translation unit will be suppressed. For example, this suppresses 1081b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * the completion of tentative declarations in C and of 1082b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * instantiation of implicitly-instantiation function templates in 1083b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * C++. This option is typically used when parsing a header with the 1084b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * intent of producing a precompiled header. 108544c181aec37789f25f6c15543c164416f72e562aDouglas Gregor */ 1086b1c031be513705d924038f497279b9b599868ba1Douglas Gregor CXTranslationUnit_Incomplete = 0x02, 108744c181aec37789f25f6c15543c164416f72e562aDouglas Gregor 108844c181aec37789f25f6c15543c164416f72e562aDouglas Gregor /** 108944c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * \brief Used to indicate that the translation unit should be built with an 109044c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * implicit precompiled header for the preamble. 109144c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * 109244c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * An implicit precompiled header is used as an optimization when a 109344c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * particular translation unit is likely to be reparsed many times 109444c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * when the sources aren't changing that often. In this case, an 109544c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * implicit precompiled header will be built containing all of the 109644c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * initial includes at the top of the main file (what we refer to as 109744c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * the "preamble" of the file). In subsequent parses, if the 109844c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * preamble or the files in it have not changed, \c 109944c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * clang_reparseTranslationUnit() will re-use the implicit 110044c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * precompiled header to improve parsing performance. 110144c181aec37789f25f6c15543c164416f72e562aDouglas Gregor */ 1102e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor CXTranslationUnit_PrecompiledPreamble = 0x04, 1103e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor 1104e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor /** 1105e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \brief Used to indicate that the translation unit should cache some 1106e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * code-completion results with each reparse of the source file. 1107e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * 1108e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * Caching of code-completion results is a performance optimization that 1109e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * introduces some overhead to reparsing but improves the performance of 1110e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * code-completion operations. 1111e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor */ 111299ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor CXTranslationUnit_CacheCompletionResults = 0x08, 1113900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis 111499ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor /** 1115900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis * \brief Used to indicate that the translation unit will be serialized with 1116900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis * \c clang_saveTranslationUnit. 111799ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor * 1118900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis * This option is typically used when parsing a header with the intent of 1119900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis * producing a precompiled header. 112099ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor */ 1121900ab95e12bb7483971640a91075699eec391804Argyrios Kyrtzidis CXTranslationUnit_ForSerialization = 0x10, 112299ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor 112399ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor /** 1124b5af843a20e237ad1a13ad66a867e200695b8c8eDouglas Gregor * \brief DEPRECATED: Enabled chained precompiled preambles in C++. 112599ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor * 112699ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor * Note: this is a *temporary* option that is available only while 1127b5af843a20e237ad1a13ad66a867e200695b8c8eDouglas Gregor * we are testing C++ precompiled preamble support. It is deprecated. 112899ba202f659e1885fa5ee114f97c97cf6a857491Douglas Gregor */ 11296a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen CXTranslationUnit_CXXChainedPCH = 0x20, 11306a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen 11316a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen /** 11326a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen * \brief Used to indicate that function/method bodies should be skipped while 11336a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen * parsing. 11346a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen * 11356a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen * This option can be used to search for declarations/definitions while 11366a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen * ignoring the usages. 11376a91d385618ea4d28236c496f540a26877c95525Erik Verbruggen */ 1138d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko CXTranslationUnit_SkipFunctionBodies = 0x40, 1139d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko 1140d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko /** 1141d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * \brief Used to indicate that brief documentation comments should be 1142d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * included into the set of code completions returned from this translation 1143d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * unit. 1144d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko */ 1145d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80 11465a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor}; 11475a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor 11485a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor/** 1149b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * \brief Returns the set of flags that is suitable for parsing a translation 1150b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * unit that is being edited. 1151b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * 1152b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * The set of flags returned provide options for \c clang_parseTranslationUnit() 1153b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * to indicate that the translation unit is likely to be reparsed many times, 1154b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly 1155b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag 1156b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * set contains an unspecified set of optimizations (e.g., the precompiled 1157b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * preamble) geared toward improving the performance of these routines. The 1158b1c031be513705d924038f497279b9b599868ba1Douglas Gregor * set of optimizations enabled may change from one version to the next. 1159b1c031be513705d924038f497279b9b599868ba1Douglas Gregor */ 1160e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas GregorCINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void); 1161b1c031be513705d924038f497279b9b599868ba1Douglas Gregor 1162b1c031be513705d924038f497279b9b599868ba1Douglas Gregor/** 11635a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \brief Parse the given source file and the translation unit corresponding 11645a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * to that file. 11655a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11665a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * This routine is the main entry point for the Clang C API, providing the 11675a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * ability to parse a source file into a translation unit that can then be 11685a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * queried by other functions in the API. This routine accepts a set of 11695a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * command-line arguments so that the compilation can be configured in the same 11705a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * way that the compiler is configured on the command line. 11715a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11725a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param CIdx The index object with which the translation unit will be 11735a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * associated. 11745a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11755a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param source_filename The name of the source file to load, or NULL if the 11761ddb02cabd4374bcbe9afdff5123be0be8e32d12Ted Kremenek * source file is included in \p command_line_args. 11775a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11785a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param command_line_args The command-line arguments that would be 11795a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * passed to the \c clang executable if it were being invoked out-of-process. 11805a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * These command-line options will be parsed and will affect how the translation 11815a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * unit is parsed. Note that the following options are ignored: '-c', 11827eee0184570366285589d788bcd7f5dda8345915James Dennett * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'. 11835a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11845a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param num_command_line_args The number of command-line arguments in 11855a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \p command_line_args. 11865a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11875a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param unsaved_files the files that have not yet been saved to disk 11881abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * but may be required for parsing, including the contents of 11895a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * those files. The contents and name of these files (as specified by 11905a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * CXUnsavedFile) are copied when necessary, so the client only needs to 11915a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * guarantee their validity until the call to this function returns. 11925a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11935a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param num_unsaved_files the number of unsaved file entries in \p 11945a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * unsaved_files. 11955a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 11965a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \param options A bitmask of options that affects how the translation unit 11975a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * is managed but not its compilation. This should be a bitwise OR of the 11985a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * CXTranslationUnit_XXX flags. 11995a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * 12005a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * \returns A new translation unit describing the parsed code and containing 12015a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * any diagnostics produced by the compiler. If there is a failure from which 12025a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor * the compiler cannot recover, returns NULL. 12035a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor */ 12045a43021ac491bf091494167127772a20d9a9bb48Douglas GregorCINDEX_LINKAGE CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, 12055a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor const char *source_filename, 12062ef6944d529c94824f5bf96f65665f5bee30f5a2Douglas Gregor const char * const *command_line_args, 12075a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor int num_command_line_args, 12085a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor struct CXUnsavedFile *unsaved_files, 12095a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor unsigned num_unsaved_files, 12105a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor unsigned options); 12115a43021ac491bf091494167127772a20d9a9bb48Douglas Gregor 12125352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 12131999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * \brief Flags that control how translation units are saved. 12141999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * 12151999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * The enumerators in this enumeration type are meant to be bitwise 12161999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * ORed together to specify which options should be used when 12171999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * saving the translation unit. 12181999844e7a18786e61e619e1dc6c789827541863Douglas Gregor */ 12191999844e7a18786e61e619e1dc6c789827541863Douglas Gregorenum CXSaveTranslationUnit_Flags { 12201999844e7a18786e61e619e1dc6c789827541863Douglas Gregor /** 12211999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * \brief Used to indicate that no special saving options are needed. 12221999844e7a18786e61e619e1dc6c789827541863Douglas Gregor */ 12231999844e7a18786e61e619e1dc6c789827541863Douglas Gregor CXSaveTranslationUnit_None = 0x0 12241999844e7a18786e61e619e1dc6c789827541863Douglas Gregor}; 12251999844e7a18786e61e619e1dc6c789827541863Douglas Gregor 12261999844e7a18786e61e619e1dc6c789827541863Douglas Gregor/** 12271999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * \brief Returns the set of flags that is suitable for saving a translation 12281999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * unit. 12291999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * 12301999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * The set of flags returned provide options for 12311999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * \c clang_saveTranslationUnit() by default. The returned flag 12321999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * set contains an unspecified set of options that save translation units with 12331999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * the most commonly-requested data. 12341999844e7a18786e61e619e1dc6c789827541863Douglas Gregor */ 12351999844e7a18786e61e619e1dc6c789827541863Douglas GregorCINDEX_LINKAGE unsigned clang_defaultSaveOptions(CXTranslationUnit TU); 12361999844e7a18786e61e619e1dc6c789827541863Douglas Gregor 12371999844e7a18786e61e619e1dc6c789827541863Douglas Gregor/** 123839c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \brief Describes the kind of error that occurred (if any) in a call to 123939c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \c clang_saveTranslationUnit(). 124039c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor */ 124139c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregorenum CXSaveError { 124239c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor /** 124339c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \brief Indicates that no error occurred while saving a translation unit. 124439c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor */ 124539c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor CXSaveError_None = 0, 124639c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor 124739c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor /** 124839c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \brief Indicates that an unknown error occurred while attempting to save 124939c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * the file. 125039c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * 125139c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * This error typically indicates that file I/O failed when attempting to 125239c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * write the file. 125339c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor */ 125439c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor CXSaveError_Unknown = 1, 125539c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor 125639c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor /** 125739c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \brief Indicates that errors during translation prevented this attempt 125839c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * to save the translation unit. 125939c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * 126039c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * Errors that prevent the translation unit from being saved can be 126139c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic(). 126239c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor */ 126339c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor CXSaveError_TranslationErrors = 2, 126439c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor 126539c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor /** 126639c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \brief Indicates that the translation unit to be saved was somehow 126739c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * invalid (e.g., NULL). 126839c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor */ 126939c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor CXSaveError_InvalidTU = 3 127039c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor}; 127139c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor 127239c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor/** 12737ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * \brief Saves a translation unit into a serialized representation of 12747ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * that translation unit on disk. 12757ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * 12767ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * Any translation unit that was parsed without error can be saved 12777ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * into a file. The translation unit can then be deserialized into a 12787ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * new \c CXTranslationUnit with \c clang_createTranslationUnit() or, 12797ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * if it is an incomplete translation unit that corresponds to a 12807ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * header, used as a precompiled header when parsing other translation 12817ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * units. 12827ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * 12837ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * \param TU The translation unit to save. 12841999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * 12857ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * \param FileName The file to which the translation unit will be saved. 12867ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor * 12871999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * \param options A bitmask of options that affects how the translation unit 12881999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * is saved. This should be a bitwise OR of the 12891999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * CXSaveTranslationUnit_XXX flags. 12901999844e7a18786e61e619e1dc6c789827541863Douglas Gregor * 129139c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * \returns A value that will match one of the enumerators of the CXSaveError 129239c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * enumeration. Zero (CXSaveError_None) indicates that the translation unit was 129339c411fa229b2a6747b92f945d1702ee674d3470Douglas Gregor * saved successfully, while a non-zero value indicates that a problem occurred. 12947ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor */ 12957ae2faafd30524ef5f863bb3b8701977888839bbDouglas GregorCINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, 12961999844e7a18786e61e619e1dc6c789827541863Douglas Gregor const char *FileName, 12971999844e7a18786e61e619e1dc6c789827541863Douglas Gregor unsigned options); 12987ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor 12997ae2faafd30524ef5f863bb3b8701977888839bbDouglas Gregor/** 13005352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * \brief Destroy the specified CXTranslationUnit object. 13015352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 13025352ac06d8f6194825bb2a99ffa009b61bafb503Douglas GregorCINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit); 1303896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 13045352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 1305e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \brief Flags that control the reparsing of translation units. 1306e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * 1307e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * The enumerators in this enumeration type are meant to be bitwise 1308e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * ORed together to specify which options should be used when 1309e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * reparsing the translation unit. 1310e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor */ 1311e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregorenum CXReparse_Flags { 1312e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor /** 1313e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \brief Used to indicate that no special reparsing options are needed. 1314e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor */ 1315e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor CXReparse_None = 0x0 1316e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor}; 1317e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor 1318e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor/** 1319e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \brief Returns the set of flags that is suitable for reparsing a translation 1320e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * unit. 1321e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * 1322e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * The set of flags returned provide options for 1323e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \c clang_reparseTranslationUnit() by default. The returned flag 1324e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * set contains an unspecified set of optimizations geared toward common uses 1325e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * of reparsing. The set of optimizations enabled may change from one version 1326e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * to the next. 1327e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor */ 1328e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas GregorCINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU); 1329e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor 1330e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor/** 1331abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \brief Reparse the source files that produced this translation unit. 1332abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1333abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * This routine can be used to re-parse the source files that originally 1334abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * created the given translation unit, for example because those source files 1335abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * have changed (either on disk or as passed via \p unsaved_files). The 1336abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * source code will be reparsed with the same command-line options as it 1337abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * was originally parsed. 1338abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1339abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * Reparsing a translation unit invalidates all cursors and source locations 1340abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * that refer into that translation unit. This makes reparsing a translation 1341abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * unit semantically equivalent to destroying the translation unit and then 1342abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * creating a new translation unit with the same command-line arguments. 1343abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * However, it may be more efficient to reparse a translation 1344abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * unit using this routine. 1345abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1346abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \param TU The translation unit whose contents will be re-parsed. The 1347abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * translation unit must originally have been built with 1348abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \c clang_createTranslationUnitFromSourceFile(). 1349abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1350abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \param num_unsaved_files The number of unsaved file entries in \p 1351abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * unsaved_files. 1352abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1353abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \param unsaved_files The files that have not yet been saved to disk 1354abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * but may be required for parsing, including the contents of 1355abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * those files. The contents and name of these files (as specified by 1356abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * CXUnsavedFile) are copied when necessary, so the client only needs to 1357abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * guarantee their validity until the call to this function returns. 1358abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * 1359e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * \param options A bitset of options composed of the flags in CXReparse_Flags. 1360e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * The function \c clang_defaultReparseOptions() produces a default set of 1361e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * options recommended for most uses, based on the translation unit. 1362e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor * 1363abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \returns 0 if the sources could be reparsed. A non-zero value will be 1364abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * returned if reparsing was impossible, such that the translation unit is 1365abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * invalid. In such cases, the only valid call for \p TU is 1366abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor * \c clang_disposeTranslationUnit(TU). 1367abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor */ 1368abc563f554951259bbe0315055cad92ee14d87e4Douglas GregorCINDEX_LINKAGE int clang_reparseTranslationUnit(CXTranslationUnit TU, 1369abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor unsigned num_unsaved_files, 1370e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor struct CXUnsavedFile *unsaved_files, 1371e1e13bf568a7e37c95eda6fcfa626659a06e67b1Douglas Gregor unsigned options); 137259fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 137359fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek/** 137459fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek * \brief Categorizes how memory is being used by a translation unit. 137559fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek */ 1376f787002478f09af1741fb0f82a562002e6799c49Ted Kremenekenum CXTUResourceUsageKind { 1377f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_AST = 1, 1378f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_Identifiers = 2, 1379f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_Selectors = 3, 1380f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_GlobalCompletionResults = 4, 1381457aaf0692dfb2d9638f383334b81027f637f20cTed Kremenek CXTUResourceUsage_SourceManagerContentCache = 5, 1382ba29bd25515fbd99e98ba0fedb9d93617b27609eTed Kremenek CXTUResourceUsage_AST_SideTables = 6, 1383f61b831d7f6a15676b07647f507de80324cb7056Ted Kremenek CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, 1384e9b5f3d4acfc2ad6e8b65a4072464e997dea9ed3Ted Kremenek CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, 1385e9b5f3d4acfc2ad6e8b65a4072464e997dea9ed3Ted Kremenek CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, 1386e9b5f3d4acfc2ad6e8b65a4072464e997dea9ed3Ted Kremenek CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, 13875e1db6a434d0e3fe0fbde0bca2ec44552818fb22Ted Kremenek CXTUResourceUsage_Preprocessor = 11, 13885e1db6a434d0e3fe0fbde0bca2ec44552818fb22Ted Kremenek CXTUResourceUsage_PreprocessingRecord = 12, 1389ca7dc2b755eb81ac95121ce1a1f1aa44a4a0fe12Ted Kremenek CXTUResourceUsage_SourceManager_DataStructures = 13, 1390d1194fbbf65374bfa3578eb40a547e4f97b497d1Ted Kremenek CXTUResourceUsage_Preprocessor_HeaderSearch = 14, 1391f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST, 1392f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_MEMORY_IN_BYTES_END = 1393d1194fbbf65374bfa3578eb40a547e4f97b497d1Ted Kremenek CXTUResourceUsage_Preprocessor_HeaderSearch, 1394f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek 1395f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsage_First = CXTUResourceUsage_AST, 1396d1194fbbf65374bfa3578eb40a547e4f97b497d1Ted Kremenek CXTUResourceUsage_Last = CXTUResourceUsage_Preprocessor_HeaderSearch 139759fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek}; 139859fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 139959fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek/** 140059fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek * \brief Returns the human-readable null-terminated C string that represents 1401f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek * the name of the memory category. This string should never be freed. 140259fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek */ 140359fc1e55da9c856d1703d3d3ac14a36320d26b30Ted KremenekCINDEX_LINKAGE 1404f787002478f09af1741fb0f82a562002e6799c49Ted Kremenekconst char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind); 140559fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 1406f787002478f09af1741fb0f82a562002e6799c49Ted Kremenektypedef struct CXTUResourceUsageEntry { 140759fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek /* \brief The memory usage category. */ 1408f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek enum CXTUResourceUsageKind kind; 1409f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek /* \brief Amount of resources used. 1410f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek The units will depend on the resource kind. */ 141159fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek unsigned long amount; 1412f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek} CXTUResourceUsageEntry; 141359fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 141459fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek/** 141559fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek * \brief The memory usage of a CXTranslationUnit, broken into categories. 141659fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek */ 1417f787002478f09af1741fb0f82a562002e6799c49Ted Kremenektypedef struct CXTUResourceUsage { 141859fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek /* \brief Private data member, used for queries. */ 141959fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek void *data; 142059fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 142159fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek /* \brief The number of entries in the 'entries' array. */ 142259fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek unsigned numEntries; 142359fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 142459fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek /* \brief An array of key-value pairs, representing the breakdown of memory 142559fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek usage. */ 1426f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek CXTUResourceUsageEntry *entries; 142759fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 1428f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek} CXTUResourceUsage; 142959fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 143059fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek/** 143159fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek * \brief Return the memory usage of a translation unit. This object 1432f787002478f09af1741fb0f82a562002e6799c49Ted Kremenek * should be released with clang_disposeCXTUResourceUsage(). 143359fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek */ 1434f787002478f09af1741fb0f82a562002e6799c49Ted KremenekCINDEX_LINKAGE CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU); 143559fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 1436f787002478f09af1741fb0f82a562002e6799c49Ted KremenekCINDEX_LINKAGE void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage); 143759fc1e55da9c856d1703d3d3ac14a36320d26b30Ted Kremenek 1438abc563f554951259bbe0315055cad92ee14d87e4Douglas Gregor/** 14395352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor * @} 14405352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor */ 1441896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 14425352ac06d8f6194825bb2a99ffa009b61bafb503Douglas Gregor/** 1443c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Describes the kind of entity that a cursor refers to. 1444c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1445c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregorenum CXCursorKind { 1446c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /* Declarations */ 14471efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 1448c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief A declaration whose specific kind is not exposed via this 14491efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * interface. 1450c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1451c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Unexposed declarations have the same operations as any other kind 1452c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * of declaration; one can extract their location information, 1453c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * spelling, find their definitions, etc. However, the specific kind 1454c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * of the declaration is not reported. 1455c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1456c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_UnexposedDecl = 1, 1457c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A C or C++ struct. */ 14581efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar CXCursor_StructDecl = 2, 1459c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A C or C++ union. */ 1460c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_UnionDecl = 3, 1461c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A C++ class. */ 1462c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ClassDecl = 4, 1463c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An enumeration. */ 1464c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_EnumDecl = 5, 14651efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 1466c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief A field (in C) or non-static data member (in C++) in a 1467c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * struct, union, or C++ class. 1468c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1469c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FieldDecl = 6, 1470c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An enumerator constant. */ 1471c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_EnumConstantDecl = 7, 1472c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A function. */ 1473c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FunctionDecl = 8, 1474c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A variable. */ 1475c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_VarDecl = 9, 1476c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A function or method parameter. */ 1477c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ParmDecl = 10, 147817d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@interface. */ 1479c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCInterfaceDecl = 11, 148017d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@interface for a category. */ 1481c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCCategoryDecl = 12, 148217d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@protocol declaration. */ 1483c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCProtocolDecl = 13, 148417d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@property declaration. */ 1485c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCPropertyDecl = 14, 1486c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An Objective-C instance variable. */ 1487c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCIvarDecl = 15, 1488c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An Objective-C instance method. */ 1489c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCInstanceMethodDecl = 16, 1490c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An Objective-C class method. */ 1491c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCClassMethodDecl = 17, 149217d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@implementation. */ 1493c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCImplementationDecl = 18, 149417d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@implementation for a category. */ 1495c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCCategoryImplDecl = 19, 1496c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief A typedef */ 1497c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_TypedefDecl = 20, 14988bd5a69999cfd06b6b5a58fdd04e4f802b2df5a4Ted Kremenek /** \brief A C++ class method. */ 14998bd5a69999cfd06b6b5a58fdd04e4f802b2df5a4Ted Kremenek CXCursor_CXXMethod = 21, 15008f06e0e9fec3ca501e5fb129f413adbfc88e82f8Ted Kremenek /** \brief A C++ namespace. */ 15018f06e0e9fec3ca501e5fb129f413adbfc88e82f8Ted Kremenek CXCursor_Namespace = 22, 1502a0536d8dd900bb48ea886bd68d777b03b061c068Ted Kremenek /** \brief A linkage specification, e.g. 'extern "C"'. */ 1503a0536d8dd900bb48ea886bd68d777b03b061c068Ted Kremenek CXCursor_LinkageSpec = 23, 150401829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor /** \brief A C++ constructor. */ 150501829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor CXCursor_Constructor = 24, 150601829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor /** \brief A C++ destructor. */ 150701829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor CXCursor_Destructor = 25, 150801829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor /** \brief A C++ conversion function. */ 150901829d3afafdfd355cbe93537bc408aeeed964c6Douglas Gregor CXCursor_ConversionFunction = 26, 1510fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor /** \brief A C++ template type parameter. */ 1511fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor CXCursor_TemplateTypeParameter = 27, 1512fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor /** \brief A C++ non-type template parameter. */ 1513fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor CXCursor_NonTypeTemplateParameter = 28, 1514fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor /** \brief A C++ template template parameter. */ 1515fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor CXCursor_TemplateTemplateParameter = 29, 1516fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor /** \brief A C++ function template. */ 1517fe72e9ceeae6cc8669cd8bb722425300190638eaDouglas Gregor CXCursor_FunctionTemplate = 30, 151839d6f07b056c31e1e6b5946165ed4b23e7887f22Douglas Gregor /** \brief A C++ class template. */ 151939d6f07b056c31e1e6b5946165ed4b23e7887f22Douglas Gregor CXCursor_ClassTemplate = 31, 152074dbe640021d96a8dbb85c592471c04449ade81cDouglas Gregor /** \brief A C++ class template partial specialization. */ 152174dbe640021d96a8dbb85c592471c04449ade81cDouglas Gregor CXCursor_ClassTemplatePartialSpecialization = 32, 15226931900f43cea558c6974075256c07728dbfecc6Douglas Gregor /** \brief A C++ namespace alias declaration. */ 15236931900f43cea558c6974075256c07728dbfecc6Douglas Gregor CXCursor_NamespaceAlias = 33, 15240a35bceb7768fc0be62cb644a4e31d8bfd9fb44aDouglas Gregor /** \brief A C++ using directive. */ 15250a35bceb7768fc0be62cb644a4e31d8bfd9fb44aDouglas Gregor CXCursor_UsingDirective = 34, 1526162e1c1b487352434552147967c3dd296ebee2f7Richard Smith /** \brief A C++ using declaration. */ 15277e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregor CXCursor_UsingDeclaration = 35, 1528162e1c1b487352434552147967c3dd296ebee2f7Richard Smith /** \brief A C++ alias declaration */ 1529162e1c1b487352434552147967c3dd296ebee2f7Richard Smith CXCursor_TypeAliasDecl = 36, 15307eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief An Objective-C \@synthesize definition. */ 1531352697a87bca664356f21a838b162084013625eaDouglas Gregor CXCursor_ObjCSynthesizeDecl = 37, 15327eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief An Objective-C \@dynamic definition. */ 1533352697a87bca664356f21a838b162084013625eaDouglas Gregor CXCursor_ObjCDynamicDecl = 38, 15342dfdb948bef51a601e763191e4becfe59880d382Argyrios Kyrtzidis /** \brief An access specifier. */ 15352dfdb948bef51a601e763191e4becfe59880d382Argyrios Kyrtzidis CXCursor_CXXAccessSpecifier = 39, 153642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 153750aa6acd0b8d40c8956372a69e0a73f0802a5494Ted Kremenek CXCursor_FirstDecl = CXCursor_UnexposedDecl, 15382dfdb948bef51a601e763191e4becfe59880d382Argyrios Kyrtzidis CXCursor_LastDecl = CXCursor_CXXAccessSpecifier, 15391efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1540c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /* References */ 1541c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FirstRef = 40, /* Decl references */ 15421efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar CXCursor_ObjCSuperClassRef = 40, 1543c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCProtocolRef = 41, 1544c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCClassRef = 42, 1545c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 1546c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief A reference to a type declaration. 1547c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1548c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * A type reference occurs anywhere where a type is named but not 1549c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * declared. For example, given: 1550c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1551c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \code 1552c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * typedef unsigned size_type; 1553c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * size_type size; 1554c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \endcode 1555c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1556c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * The typedef is a declaration of size_type (CXCursor_TypedefDecl), 1557c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * while the type of the variable "size" is referenced. The cursor 1558c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * referenced by the type of size is the typedef for size_type. 1559c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1560c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_TypeRef = 43, 15613064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek CXCursor_CXXBaseSpecifier = 44, 15620b36e614aa19df72885d5e0de996f7fbb9874ec3Douglas Gregor /** 1563a67e03fdf1ae8a1f92463a307d0b6281f1161f40Douglas Gregor * \brief A reference to a class template, function template, template 1564a67e03fdf1ae8a1f92463a307d0b6281f1161f40Douglas Gregor * template parameter, or class template partial specialization. 15650b36e614aa19df72885d5e0de996f7fbb9874ec3Douglas Gregor */ 15660b36e614aa19df72885d5e0de996f7fbb9874ec3Douglas Gregor CXCursor_TemplateRef = 45, 15676931900f43cea558c6974075256c07728dbfecc6Douglas Gregor /** 15686931900f43cea558c6974075256c07728dbfecc6Douglas Gregor * \brief A reference to a namespace or namespace alias. 15696931900f43cea558c6974075256c07728dbfecc6Douglas Gregor */ 15706931900f43cea558c6974075256c07728dbfecc6Douglas Gregor CXCursor_NamespaceRef = 46, 1571a67e03fdf1ae8a1f92463a307d0b6281f1161f40Douglas Gregor /** 157236897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \brief A reference to a member of a struct, union, or class that occurs in 157336897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * some non-expression context, e.g., a designated initializer. 1574a67e03fdf1ae8a1f92463a307d0b6281f1161f40Douglas Gregor */ 1575a67e03fdf1ae8a1f92463a307d0b6281f1161f40Douglas Gregor CXCursor_MemberRef = 47, 157636897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor /** 157736897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \brief A reference to a labeled statement. 157836897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 157936897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * This cursor kind is used to describe the jump to "start_over" in the 158036897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * goto statement in the following example: 158136897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 158236897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \code 158336897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * start_over: 158436897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * ++counter; 158536897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 158636897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * goto start_over; 158736897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \endcode 158836897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 158936897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * A label reference cursor refers to a label statement. 159036897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor */ 159136897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor CXCursor_LabelRef = 48, 159236897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor 15931f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor /** 15941f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \brief A reference to a set of overloaded functions or function templates 15951f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * that has not yet been resolved to a specific function or function template. 15961f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 15971f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * An overloaded declaration reference cursor occurs in C++ templates where 15981f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * a dependent name refers to a function. For example: 15991f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16001f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \code 16011f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * template<typename T> void swap(T&, T&); 16021f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16031f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * struct X { ... }; 16041f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * void swap(X&, X&); 16051f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16061f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * template<typename T> 16071f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * void reverse(T* first, T* last) { 16081f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * while (first < last - 1) { 16091f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * swap(*first, *--last); 16101f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * ++first; 16111f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * } 16121f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * } 16131f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16141f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * struct Y { }; 16151f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * void swap(Y&, Y&); 16161f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \endcode 16171f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16181f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * Here, the identifier "swap" is associated with an overloaded declaration 16191f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * reference. In the template definition, "swap" refers to either of the two 16201f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * "swap" functions declared above, so both results will be available. At 16211f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * instantiation time, "swap" may also refer to other functions found via 16221f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * argument-dependent lookup (e.g., the "swap" function at the end of the 16231f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * example). 16241f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 16251f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * The functions \c clang_getNumOverloadedDecls() and 16261f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \c clang_getOverloadedDecl() can be used to retrieve the definitions 16271f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * referenced by this cursor. 16281f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor */ 16291f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor CXCursor_OverloadedDeclRef = 49, 16301f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor 1631011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor /** 1632011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * \brief A reference to a variable that occurs in some non-expression 1633011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * context, e.g., a C++ lambda capture list. 1634011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor */ 1635011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor CXCursor_VariableRef = 50, 1636011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor 1637011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor CXCursor_LastRef = CXCursor_VariableRef, 16381efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1639c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /* Error conditions */ 1640c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FirstInvalid = 70, 1641c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_InvalidFile = 70, 1642c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_NoDeclFound = 71, 1643c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_NotImplemented = 72, 1644ebfa339321f8a4df9d5011e591a615d5765107d5Ted Kremenek CXCursor_InvalidCode = 73, 1645ebfa339321f8a4df9d5011e591a615d5765107d5Ted Kremenek CXCursor_LastInvalid = CXCursor_InvalidCode, 16461efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1647c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /* Expressions */ 1648c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FirstExpr = 100, 16491efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1650c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 1651c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief An expression whose specific kind is not exposed via this 16521efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * interface. 1653c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1654c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Unexposed expressions have the same operations as any other kind 1655c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * of expression; one can extract their location information, 1656c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * spelling, children, etc. However, the specific kind of the 1657c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * expression is not reported. 1658c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1659c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_UnexposedExpr = 100, 16601efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1661c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 1662c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief An expression that refers to some value declaration, such 1663c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * as a function, varible, or enumerator. 1664c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1665c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_DeclRefExpr = 101, 16661efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1667c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 1668c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief An expression that refers to a member of a struct, union, 1669c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * class, Objective-C class, etc. 1670c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1671c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_MemberRefExpr = 102, 16721efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1673c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An expression that calls a function. */ 1674c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_CallExpr = 103, 16751efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1676c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** \brief An expression that sends a message to an Objective-C 1677c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor object or class. */ 1678c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_ObjCMessageExpr = 104, 16791ee6cad59f017601ea54fbb4f62a6e8d69897e3eTed Kremenek 16801ee6cad59f017601ea54fbb4f62a6e8d69897e3eTed Kremenek /** \brief An expression that represents a block literal. */ 16811ee6cad59f017601ea54fbb4f62a6e8d69897e3eTed Kremenek CXCursor_BlockExpr = 105, 16821ee6cad59f017601ea54fbb4f62a6e8d69897e3eTed Kremenek 168342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An integer literal. 168442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 168542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_IntegerLiteral = 106, 168642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 168742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A floating point number literal. 168842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 168942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_FloatingLiteral = 107, 169042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 169142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An imaginary number literal. 169242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 169342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ImaginaryLiteral = 108, 169442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 169542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A string literal. 169642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 169742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_StringLiteral = 109, 169842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 169942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A character literal. 170042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 170142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CharacterLiteral = 110, 170242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 170342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A parenthesized expression, e.g. "(1)". 170442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 170542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * This AST node is only formed if full location information is requested. 170642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 170742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ParenExpr = 111, 170842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 170942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief This represents the unary-expression's (except sizeof and 171042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * alignof). 171142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 171242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_UnaryOperator = 112, 171342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 171442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief [C99 6.5.2.1] Array Subscripting. 171542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 171642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ArraySubscriptExpr = 113, 171742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 171842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A builtin binary operation expression such as "x + y" or 171942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * "x <= y". 172042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 172142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_BinaryOperator = 114, 172242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 172342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Compound assignment such as "+=". 172442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 172542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CompoundAssignOperator = 115, 172642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 172742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief The ?: ternary operator. 172842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 172942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ConditionalOperator = 116, 173042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 173142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An explicit cast in C (C99 6.5.4) or a C-style cast in C++ 173242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * (C++ [expr.cast]), which uses the syntax (Type)expr. 173342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 173442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * For example: (int)f. 173542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 173642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CStyleCastExpr = 117, 173742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 173842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief [C99 6.5.2.5] 173942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 174042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CompoundLiteralExpr = 118, 174142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 174242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Describes an C or C++ initializer list. 174342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 174442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_InitListExpr = 119, 174542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 174642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief The GNU address of label extension, representing &&label. 174742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 174842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_AddrLabelExpr = 120, 174942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 175042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief This is the GNU Statement Expression extension: ({int X=4; X;}) 175142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 175242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_StmtExpr = 121, 175342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 1754ffbe9b9c64ab2e94b9d48ec56e511f75826fc80aBenjamin Kramer /** \brief Represents a C11 generic selection. 175542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 175642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_GenericSelectionExpr = 122, 175742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 175842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Implements the GNU __null extension, which is a name for a null 175942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * pointer constant that has integral type (e.g., int or long) and is the same 176042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * size and alignment as a pointer. 176142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 176242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * The __null extension is typically only used by system headers, which define 176342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * NULL as __null in C++ rather than using 0 (which is an integer that may not 176442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * match the size of a pointer). 176542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 176642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_GNUNullExpr = 123, 176742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 176842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s static_cast<> expression. 176942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 177042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXStaticCastExpr = 124, 177142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 177242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s dynamic_cast<> expression. 177342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 177442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXDynamicCastExpr = 125, 177542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 177642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s reinterpret_cast<> expression. 177742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 177842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXReinterpretCastExpr = 126, 177942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 178042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s const_cast<> expression. 178142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 178242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXConstCastExpr = 127, 178342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 178442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Represents an explicit C++ type conversion that uses "functional" 178542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * notion (C++ [expr.type.conv]). 178642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 178742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * Example: 178842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \code 178942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * x = int(0.5); 179042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \endcode 179142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 179242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXFunctionalCastExpr = 128, 179342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 179442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A C++ typeid expression (C++ [expr.typeid]). 179542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 179642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXTypeidExpr = 129, 179742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 179842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief [C++ 2.13.5] C++ Boolean Literal. 179942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 180042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXBoolLiteralExpr = 130, 180142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 180242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief [C++0x 2.14.7] C++ Pointer Literal. 180342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 180442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXNullPtrLiteralExpr = 131, 180542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 180642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Represents the "this" expression in C++ 180742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 180842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXThisExpr = 132, 180942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 181042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief [C++ 15] C++ Throw Expression. 181142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 181242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * This handles 'throw' and 'throw' assignment-expression. When 181342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * assignment-expression isn't present, Op will be null. 181442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 181542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXThrowExpr = 133, 181642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 181742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A new expression for memory allocation and constructor calls, e.g: 181842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * "new CXXNewExpr(foo)". 181942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 182042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXNewExpr = 134, 182142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 182242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A delete expression for memory deallocation and destructor calls, 182342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * e.g. "delete[] pArray". 182442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 182542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXDeleteExpr = 135, 182642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 182742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A unary expression. 182842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 182942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_UnaryExpr = 136, 183042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 18319793e8f72a2d1f420bbbd97d41f7aaf727c26ca6Douglas Gregor /** \brief An Objective-C string literal i.e. @"foo". 183242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 183342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCStringLiteral = 137, 183442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 18357eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief An Objective-C \@encode expression. 183642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 183742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCEncodeExpr = 138, 183842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 18397eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief An Objective-C \@selector expression. 184042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 184142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCSelectorExpr = 139, 184242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 184317d26a6c1f2cb921d0000c337b4967699dc928fdJames Dennett /** \brief An Objective-C \@protocol expression. 184442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 184542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCProtocolExpr = 140, 184642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 184742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An Objective-C "bridged" cast expression, which casts between 184842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * Objective-C pointers and C pointers, transferring ownership in the process. 184942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 185042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \code 185142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * NSString *str = (__bridge_transfer NSString *)CFCreateString(); 185242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \endcode 185342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 185442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCBridgedCastExpr = 141, 185542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 185642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Represents a C++0x pack expansion that produces a sequence of 185742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * expressions. 185842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 185942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * A pack expansion expression contains a pattern (which itself is an 186042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * expression) followed by an ellipsis. For example: 186142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 186242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \code 186342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * template<typename F, typename ...Types> 186442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * void forward(F f, Types &&...args) { 186542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * f(static_cast<Types&&>(args)...); 186642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * } 186742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \endcode 186842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 186942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_PackExpansionExpr = 142, 187042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 187142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Represents an expression that computes the length of a parameter 187242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * pack. 187342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 187442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \code 187542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * template<typename ...Types> 187642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * struct count { 187742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * static const unsigned value = sizeof...(Types); 187842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * }; 187942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * \endcode 188042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 188142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_SizeOfPackExpr = 143, 188242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 1883011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor /* \brief Represents a C++ lambda expression that produces a local function 1884011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * object. 1885011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * 1886011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * \code 1887011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * void abssort(float *x, unsigned N) { 1888011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * std::sort(x, x + N, 1889011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * [](float a, float b) { 1890011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * return std::abs(a) < std::abs(b); 1891011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * }); 1892011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * } 1893011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor * \endcode 1894011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor */ 1895011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor CXCursor_LambdaExpr = 144, 1896011d8b93b7cfa8492b8a9c909a850d6577e08dcaDouglas Gregor 1897b3f7542a950ac0d585a7783e825cfe670e05c553Ted Kremenek /** \brief Objective-c Boolean Literal. 1898b3f7542a950ac0d585a7783e825cfe670e05c553Ted Kremenek */ 1899b3f7542a950ac0d585a7783e825cfe670e05c553Ted Kremenek CXCursor_ObjCBoolLiteralExpr = 145, 1900b3f7542a950ac0d585a7783e825cfe670e05c553Ted Kremenek 1901b3f7542a950ac0d585a7783e825cfe670e05c553Ted Kremenek CXCursor_LastExpr = CXCursor_ObjCBoolLiteralExpr, 19021efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 1903c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /* Statements */ 1904c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_FirstStmt = 200, 1905c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 1906c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief A statement whose specific kind is not exposed via this 1907c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * interface. 1908c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 1909c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Unexposed statements have the same operations as any other kind of 1910c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * statement; one can extract their location information, spelling, 1911c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * children, etc. However, the specific kind of the statement is not 1912c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * reported. 1913c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 1914c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursor_UnexposedStmt = 200, 191536897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor 191636897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor /** \brief A labelled statement in a function. 191736897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 191836897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * This cursor kind is used to describe the "start_over:" label statement in 191936897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * the following example: 192036897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 192136897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \code 192236897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * start_over: 192336897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * ++counter; 192436897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * \endcode 192536897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor * 192636897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor */ 192736897b05ca2886e287f01802614bc10cbadcec22Douglas Gregor CXCursor_LabelStmt = 201, 192842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 192942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A group of statements like { stmt stmt }. 193042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 193142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * This cursor kind is used to describe compound statements, e.g. function 193242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * bodies. 193342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 193442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CompoundStmt = 202, 193542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 193642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A case statment. 193742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 193842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CaseStmt = 203, 193942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 194042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A default statement. 194142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 194242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_DefaultStmt = 204, 194342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 194442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An if statement 194542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 194642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_IfStmt = 205, 194742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 194842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A switch statement. 194942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 195042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_SwitchStmt = 206, 195142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 195242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A while statement. 195342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 195442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_WhileStmt = 207, 195542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 195642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A do statement. 195742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 195842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_DoStmt = 208, 195942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 196042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A for statement. 196142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 196242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ForStmt = 209, 196342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 196442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A goto statement. 196542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 196642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_GotoStmt = 210, 196742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 196842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief An indirect goto statement. 196942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 197042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_IndirectGotoStmt = 211, 197142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 197242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A continue statement. 197342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 197442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ContinueStmt = 212, 197542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 197642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A break statement. 197742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 197842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_BreakStmt = 213, 197942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 198042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief A return statement. 198142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 198242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ReturnStmt = 214, 198342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 1984df5faf5e7ae6823d0af0b801c4ac26d47f2cee97Chad Rosier /** \brief A GCC inline assembly statement extension. 198542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 1986df5faf5e7ae6823d0af0b801c4ac26d47f2cee97Chad Rosier CXCursor_GCCAsmStmt = 215, 19875e02f6525d109c42650575c352bd2fdb14ed4193Argyrios Kyrtzidis CXCursor_AsmStmt = CXCursor_GCCAsmStmt, 198842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 19897eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief Objective-C's overall \@try-\@catch-\@finally statement. 199042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 199142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAtTryStmt = 216, 199242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 19937eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief Objective-C's \@catch statement. 199442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 199542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAtCatchStmt = 217, 199642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 19977eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief Objective-C's \@finally statement. 199842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 199942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAtFinallyStmt = 218, 200042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 20017eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief Objective-C's \@throw statement. 200242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 200342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAtThrowStmt = 219, 200442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 20057eee0184570366285589d788bcd7f5dda8345915James Dennett /** \brief Objective-C's \@synchronized statement. 200642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 200742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAtSynchronizedStmt = 220, 200842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 200942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Objective-C's autorelease pool statement. 201042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 201142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCAutoreleasePoolStmt = 221, 201242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 201342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Objective-C's collection statement. 201442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 201542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_ObjCForCollectionStmt = 222, 201642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 201742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s catch statement. 201842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 201942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXCatchStmt = 223, 202042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 202142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s try statement. 202242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 202342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXTryStmt = 224, 202442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 202542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief C++'s for (* : *) statement. 202642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 202742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_CXXForRangeStmt = 225, 202842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 202942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Windows Structured Exception Handling's try statement. 203042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 203142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_SEHTryStmt = 226, 203242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 203342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Windows Structured Exception Handling's except statement. 203442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 203542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_SEHExceptStmt = 227, 203642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 203742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Windows Structured Exception Handling's finally statement. 203842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 203942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_SEHFinallyStmt = 228, 204042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 20418cd64b4c5553fa6284d248336cb7c82dc960a394Chad Rosier /** \brief A MS inline assembly statement extension. 20428cd64b4c5553fa6284d248336cb7c82dc960a394Chad Rosier */ 20438cd64b4c5553fa6284d248336cb7c82dc960a394Chad Rosier CXCursor_MSAsmStmt = 229, 20448cd64b4c5553fa6284d248336cb7c82dc960a394Chad Rosier 204542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief The null satement ";": C99 6.8.3p3. 204642b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * 204742b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * This cursor kind is used to describe the null statement. 204842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 204942b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_NullStmt = 230, 205042b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 205142b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor /** \brief Adaptor class for mixing declarations with statements and 205242b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor * expressions. 205342b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor */ 205442b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor CXCursor_DeclStmt = 231, 205542b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor 20564c5fa4292a2ae1fd69c8b984543519c4f119c540Joao Matos CXCursor_LastStmt = CXCursor_DeclStmt, 20571efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2058c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 2059c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Cursor that represents the translation unit itself. 2060c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2061c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * The translation unit cursor exists primarily to act as the root 2062c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * cursor for traversing the contents of a translation unit. 2063c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2064e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek CXCursor_TranslationUnit = 300, 2065e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek 2066ad017fa7a4df7389d245d02a49b3c79ed70bedb9Bill Wendling /* Attributes */ 2067e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek CXCursor_FirstAttr = 400, 2068e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek /** 2069e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek * \brief An attribute whose specific kind is not exposed via this 2070e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek * interface. 2071e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek */ 2072e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek CXCursor_UnexposedAttr = 400, 2073e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek 2074e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek CXCursor_IBActionAttr = 401, 2075e77f443dbca8cdc23e5aa94a2653367e4a7cbe47Ted Kremenek CXCursor_IBOutletAttr = 402, 2076857e918a8a40deb128840308a318bf623d68295fTed Kremenek CXCursor_IBOutletCollectionAttr = 403, 20776639e9255489ad8e10278d5658fdd4b3c0e1e4cdArgyrios Kyrtzidis CXCursor_CXXFinalAttr = 404, 20786639e9255489ad8e10278d5658fdd4b3c0e1e4cdArgyrios Kyrtzidis CXCursor_CXXOverrideAttr = 405, 20795f1c822def3efffe1d8f7299fbbbc3b1cdd4833dErik Verbruggen CXCursor_AnnotateAttr = 406, 208084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCursor_AsmLabelAttr = 407, 208184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCursor_LastAttr = CXCursor_AsmLabelAttr, 20829f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor 20839f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor /* Preprocessing */ 20849f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor CXCursor_PreprocessingDirective = 500, 2085572feb2a190b5e8b04fb06c4ac50ee0f61e93ff0Douglas Gregor CXCursor_MacroDefinition = 501, 20869b2a0ac970a077bdc0bf08c6c682f80ad733c892Chandler Carruth CXCursor_MacroExpansion = 502, 20879b2a0ac970a077bdc0bf08c6c682f80ad733c892Chandler Carruth CXCursor_MacroInstantiation = CXCursor_MacroExpansion, 2088ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor CXCursor_InclusionDirective = 503, 20899f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor CXCursor_FirstPreprocessing = CXCursor_PreprocessingDirective, 20906a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis CXCursor_LastPreprocessing = CXCursor_InclusionDirective, 20916a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis 20926a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis /* Extra Declarations */ 20936a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis /** 20946a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis * \brief A module import declaration. 20956a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis */ 20966a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis CXCursor_ModuleImportDecl = 600, 20976a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, 20986a01012e6bffa246810dc5c655a9a30082331fb2Argyrios Kyrtzidis CXCursor_LastExtraDecl = CXCursor_ModuleImportDecl 2099c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor}; 2100c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2101c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2102c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief A cursor representing some element in the abstract syntax tree for 2103c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * a translation unit. 2104c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 21051efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * The cursor abstraction unifies the different kinds of entities in a 2106c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * program--declaration, statements, expressions, references to declarations, 2107c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * etc.--under a single "cursor" abstraction with a common set of operations. 2108c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Common operation for a cursor include: getting the physical location in 2109c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * a source file where the cursor points, getting the name associated with a 2110c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * cursor, and retrieving cursors for any child nodes of a particular cursor. 2111c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2112c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Cursors can be produced in two specific ways. 2113c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * clang_getTranslationUnitCursor() produces a cursor for a translation unit, 2114c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * from which one can use clang_visitChildren() to explore the rest of the 2115c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * translation unit. clang_getCursor() maps from a physical source location 2116c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * to the entity that resides at that location, allowing one to map from the 2117c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * source code into the AST. 2118c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2119c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregortypedef struct { 2120c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor enum CXCursorKind kind; 2121aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis int xdata; 212267812b2f94f4b5e7d2596db1705ffa1149ddc45aDmitri Gribenko const void *data[3]; 21231efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar} CXCursor; 2124c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2125c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2126ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A comment AST node. 2127ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 2128ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkotypedef struct { 2129e4330a302ac20b41b9800267ebd4b5b01f8553f8Dmitri Gribenko const void *ASTNode; 2130e4330a302ac20b41b9800267ebd4b5b01f8553f8Dmitri Gribenko CXTranslationUnit TranslationUnit; 2131ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko} CXComment; 2132ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 2133ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 2134c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_CURSOR_MANIP Cursor manipulations 2135c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2136c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 2137c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 21381efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2139c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2140c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Retrieve the NULL cursor, which represents no entity. 2141c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2142c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE CXCursor clang_getNullCursor(void); 21431efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2144c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2145c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Retrieve the cursor that represents the given translation unit. 2146c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2147c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * The translation unit cursor can be used to start traversing the 2148c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * various declarations within the given translation unit. 2149c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2150c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit); 2151c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2152c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2153c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Determine whether two cursors are equivalent. 2154c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2155c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); 21561efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2157c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 21581824d54df85a462ada812dadda18130f951d40f3Dmitri Gribenko * \brief Returns non-zero if \p cursor is null. 2159b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis */ 21601824d54df85a462ada812dadda18130f951d40f3Dmitri GribenkoCINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor); 2161b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis 2162b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis/** 21639ce5584553054d0cb934940586aca0186e87fa57Douglas Gregor * \brief Compute a hash value for the given cursor. 21649ce5584553054d0cb934940586aca0186e87fa57Douglas Gregor */ 21659ce5584553054d0cb934940586aca0186e87fa57Douglas GregorCINDEX_LINKAGE unsigned clang_hashCursor(CXCursor); 21669ce5584553054d0cb934940586aca0186e87fa57Douglas Gregor 21679ce5584553054d0cb934940586aca0186e87fa57Douglas Gregor/** 2168c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Retrieve the kind of the given cursor. 2169c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2170c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor); 2171c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2172c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2173c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Determine whether the given cursor kind represents a declaration. 2174c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2175c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); 2176c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2177c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2178c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Determine whether the given cursor kind represents a simple 2179c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * reference. 2180c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2181c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Note that other kinds of cursors (such as expressions) can also refer to 2182c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * other cursors. Use clang_getCursorReferenced() to determine whether a 2183c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * particular cursor refers to another entity. 2184c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2185c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind); 2186c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2187c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2188c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Determine whether the given cursor kind represents an expression. 2189c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2190c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isExpression(enum CXCursorKind); 2191c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2192c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2193c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Determine whether the given cursor kind represents a statement. 2194c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2195c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind); 2196c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2197c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 21988be80e1e6effd5a333bc70e7f030dc9397d0554eDouglas Gregor * \brief Determine whether the given cursor kind represents an attribute. 21998be80e1e6effd5a333bc70e7f030dc9397d0554eDouglas Gregor */ 22008be80e1e6effd5a333bc70e7f030dc9397d0554eDouglas GregorCINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind); 22018be80e1e6effd5a333bc70e7f030dc9397d0554eDouglas Gregor 22028be80e1e6effd5a333bc70e7f030dc9397d0554eDouglas Gregor/** 22031efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Determine whether the given cursor kind represents an invalid 2204c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * cursor. 22051efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar */ 2206c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind); 2207c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2208c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 22091efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Determine whether the given cursor kind represents a translation 22101efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * unit. 2211c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 2212c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind); 22131efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2214ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted Kremenek/*** 22159f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor * \brief Determine whether the given cursor represents a preprocessing 22169f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor * element, such as a preprocessor directive or macro instantiation. 22179f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor */ 22189f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas GregorCINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind); 22199f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor 22209f1e3ff3b3095967e2b92b57a53524e2d6bb141cDouglas Gregor/*** 2221ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted Kremenek * \brief Determine whether the given cursor represents a currently 2222ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted Kremenek * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). 2223ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted Kremenek */ 2224ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted KremenekCINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind); 2225ad6eff611a4391f89fd6c458db16993f76e7f5d0Ted Kremenek 2226c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 222716b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek * \brief Describe the linkage of the entity referred to by a cursor. 222816b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek */ 222916b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenekenum CXLinkageKind { 223016b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek /** \brief This value indicates that no linkage information is available 223116b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek * for a provided CXCursor. */ 223216b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek CXLinkage_Invalid, 223316b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek /** 223416b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek * \brief This is the linkage for variables, parameters, and so on that 223516b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek * have automatic storage. This covers normal (non-extern) local variables. 223616b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek */ 223716b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek CXLinkage_NoLinkage, 223816b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek /** \brief This is the linkage for static variables and static functions. */ 223916b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek CXLinkage_Internal, 224016b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek /** \brief This is the linkage for entities with external linkage that live 224116b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek * in C++ anonymous namespaces.*/ 224216b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek CXLinkage_UniqueExternal, 224316b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek /** \brief This is the linkage for entities with true, external linkage. */ 224416b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek CXLinkage_External 224516b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek}; 224616b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek 224716b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek/** 224845e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek * \brief Determine the linkage of the entity referred to by a given cursor. 224916b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek */ 225016b4259aecaa22b642d35d36fd89965ed700c1e0Ted KremenekCINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor); 225116b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek 225216b4259aecaa22b642d35d36fd89965ed700c1e0Ted Kremenek/** 2253cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief Determine the availability of the entity that this cursor refers to, 2254cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * taking the current target platform into account. 225558ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * 225658ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * \param cursor The cursor to query. 225758ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * 225858ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * \returns The availability of the cursor. 225958ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor */ 226058ddb60f409125eda5436c4a1f070f7fa4744295Douglas GregorCINDEX_LINKAGE enum CXAvailabilityKind 226158ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregorclang_getCursorAvailability(CXCursor cursor); 226258ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor 226358ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor/** 2264cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * Describes the availability of a given entity on a particular platform, e.g., 2265cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * a particular class might only be available on Mac OS 10.7 or newer. 2266cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2267cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregortypedef struct CXPlatformAvailability { 2268cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2269cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief A string that describes the platform for which this structure 2270cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * provides availability information. 2271cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2272cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * Possible values are "ios" or "macosx". 2273cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2274cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXString Platform; 2275cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2276cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The version number in which this entity was introduced. 2277cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2278cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXVersion Introduced; 2279cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2280cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The version number in which this entity was deprecated (but is 2281cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * still available). 2282cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2283cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXVersion Deprecated; 2284cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2285cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief The version number in which this entity was obsoleted, and therefore 2286cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * is no longer available. 2287cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2288cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXVersion Obsoleted; 2289cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2290cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief Whether the entity is unconditionally unavailable on this platform. 2291cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2292cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int Unavailable; 2293cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor /** 2294cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief An optional message to provide to a user of this API, e.g., to 2295cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * suggest replacement APIs. 2296cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2297cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXString Message; 2298cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor} CXPlatformAvailability; 2299cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor 2300cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor/** 2301cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief Determine the availability of the entity that this cursor refers to 2302cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * on any platforms for which availability information is known. 2303cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2304cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param cursor The cursor to query. 2305cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2306cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param always_deprecated If non-NULL, will be set to indicate whether the 2307cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * entity is deprecated on all platforms. 2308cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2309cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param deprecated_message If non-NULL, will be set to the message text 2310cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * provided along with the unconditional deprecation of this entity. The client 2311cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * is responsible for deallocating this string. 2312cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 23137eee0184570366285589d788bcd7f5dda8345915James Dennett * \param always_unavailable If non-NULL, will be set to indicate whether the 2314cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * entity is unavailable on all platforms. 2315cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2316cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param unavailable_message If non-NULL, will be set to the message text 2317cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * provided along with the unconditional unavailability of this entity. The 2318cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * client is responsible for deallocating this string. 2319cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2320cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param availability If non-NULL, an array of CXPlatformAvailability instances 2321cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * that will be populated with platform availability information, up to either 2322cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * the number of platforms for which availability information is available (as 2323cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * returned by this function) or \c availability_size, whichever is smaller. 2324cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2325cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \param availability_size The number of elements available in the 2326cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \c availability array. 2327cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2328cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \returns The number of platforms (N) for which availability information is 2329cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * available (which is unrelated to \c availability_size). 2330cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * 2331cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * Note that the client is responsible for calling 2332cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \c clang_disposeCXPlatformAvailability to free each of the 2333cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * platform-availability structures returned. There are 2334cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \c min(N, availability_size) such structures. 2335cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2336cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas GregorCINDEX_LINKAGE int 2337cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregorclang_getCursorPlatformAvailability(CXCursor cursor, 2338cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int *always_deprecated, 2339cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXString *deprecated_message, 2340cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int *always_unavailable, 2341cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXString *unavailable_message, 2342cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor CXPlatformAvailability *availability, 2343cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor int availability_size); 2344cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor 2345cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor/** 2346cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor * \brief Free the memory associated with a \c CXPlatformAvailability structure. 2347cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor */ 2348cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas GregorCINDEX_LINKAGE void 2349cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregorclang_disposeCXPlatformAvailability(CXPlatformAvailability *availability); 2350cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor 2351cc889664dec7776ebb598e4584e7df5ba2f59ab4Douglas Gregor/** 235245e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek * \brief Describe the "language" of the entity referred to by a cursor. 235345e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek */ 235445e1dae500bba7a9ef5b8206263a5609c07c6f03Ted KremenekCINDEX_LINKAGE enum CXLanguageKind { 23556cd1e7cb04d1da66e8b5675062152ff60bbc354fTed Kremenek CXLanguage_Invalid = 0, 235645e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek CXLanguage_C, 235745e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek CXLanguage_ObjC, 23586cd1e7cb04d1da66e8b5675062152ff60bbc354fTed Kremenek CXLanguage_CPlusPlus 235945e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek}; 236045e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek 236145e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek/** 236245e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek * \brief Determine the "language" of the entity referred to by a given cursor. 236345e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek */ 236445e1dae500bba7a9ef5b8206263a5609c07c6f03Ted KremenekCINDEX_LINKAGE enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor); 236545e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek 2366b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis/** 2367b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis * \brief Returns the translation unit that a cursor originated from. 2368b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis */ 2369b0d6eaa6b646c18c49923aefc76973801f561701Argyrios KyrtzidisCINDEX_LINKAGE CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor); 2370b0d6eaa6b646c18c49923aefc76973801f561701Argyrios Kyrtzidis 2371eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 2372eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek/** 2373eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \brief A fast container representing a set of CXCursors. 2374eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek */ 2375eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenektypedef struct CXCursorSetImpl *CXCursorSet; 2376eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 2377eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek/** 2378eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \brief Creates an empty CXCursorSet. 2379eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek */ 2380f9c21665faa7e4936d484396469ee7afc46e1f00NAKAMURA TakumiCINDEX_LINKAGE CXCursorSet clang_createCXCursorSet(void); 2381eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 2382eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek/** 2383eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \brief Disposes a CXCursorSet and releases its associated memory. 2384eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek */ 2385eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted KremenekCINDEX_LINKAGE void clang_disposeCXCursorSet(CXCursorSet cset); 2386eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 2387eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek/** 2388eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \brief Queries a CXCursorSet to see if it contains a specific CXCursor. 2389eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * 2390eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \returns non-zero if the set contains the specified cursor. 2391eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek*/ 2392eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted KremenekCINDEX_LINKAGE unsigned clang_CXCursorSet_contains(CXCursorSet cset, 2393eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek CXCursor cursor); 2394eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 2395eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek/** 2396eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \brief Inserts a CXCursor into a CXCursorSet. 2397eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * 2398eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek * \returns zero if the CXCursor was already in the set, and non-zero otherwise. 2399eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek*/ 2400eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted KremenekCINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset, 2401eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek CXCursor cursor); 2402eca099bdb0178d408d4f717c2e9627e0d0e673c6Ted Kremenek 24032be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor/** 24042be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \brief Determine the semantic parent of the given cursor. 24052be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24062be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * The semantic parent of a cursor is the cursor that semantically contains 24072be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * the given \p cursor. For many declarations, the lexical and semantic parents 24082be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * are equivalent (the lexical parent is returned by 24092be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \c clang_getCursorLexicalParent()). They diverge when declarations or 24102be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * definitions are provided out-of-line. For example: 24112be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24122be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \code 24132be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * class C { 24142be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * void f(); 24152be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * }; 24162be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24172be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * void C::f() { } 24182be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \endcode 24192be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24202be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * In the out-of-line definition of \c C::f, the semantic parent is the 24212be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * the class \c C, of which this function is a member. The lexical parent is 24222be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * the place where the declaration actually occurs in the source code; in this 24232be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * case, the definition occurs in the translation unit. In general, the 24242be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * lexical parent for a given entity can change without affecting the semantics 24252be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * of the program, and the lexical parent of different declarations of the 24262be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * same entity may be different. Changing the semantic parent of a declaration, 24272be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * on the other hand, can have a major impact on semantics, and redeclarations 24282be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * of a particular entity should all have the same semantic context. 24292be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24302be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * In the example above, both declarations of \c C::f have \c C as their 24312be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * semantic context, while the lexical context of the first \c C::f is \c C 24322be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * and the lexical context of the second \c C::f is the translation unit. 24333910cfd17fcd99ac80158e625fc63e4784d26435Douglas Gregor * 24343910cfd17fcd99ac80158e625fc63e4784d26435Douglas Gregor * For global declarations, the semantic parent is the translation unit. 24352be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor */ 24362be5bc9ad3981347a000742f81b91ab3080f1214Douglas GregorCINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor); 24372be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor 24382be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor/** 24392be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \brief Determine the lexical parent of the given cursor. 24402be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24412be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * The lexical parent of a cursor is the cursor in which the given \p cursor 24422be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * was actually written. For many declarations, the lexical and semantic parents 24432be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * are equivalent (the semantic parent is returned by 24442be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \c clang_getCursorSemanticParent()). They diverge when declarations or 24452be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * definitions are provided out-of-line. For example: 24462be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24472be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \code 24482be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * class C { 24492be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * void f(); 24502be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * }; 24512be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24522be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * void C::f() { } 24532be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * \endcode 24542be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24552be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * In the out-of-line definition of \c C::f, the semantic parent is the 24562be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * the class \c C, of which this function is a member. The lexical parent is 24572be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * the place where the declaration actually occurs in the source code; in this 24582be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * case, the definition occurs in the translation unit. In general, the 24592be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * lexical parent for a given entity can change without affecting the semantics 24602be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * of the program, and the lexical parent of different declarations of the 24612be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * same entity may be different. Changing the semantic parent of a declaration, 24622be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * on the other hand, can have a major impact on semantics, and redeclarations 24632be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * of a particular entity should all have the same semantic context. 24642be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * 24652be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * In the example above, both declarations of \c C::f have \c C as their 24662be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * semantic context, while the lexical context of the first \c C::f is \c C 24672be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor * and the lexical context of the second \c C::f is the translation unit. 24683910cfd17fcd99ac80158e625fc63e4784d26435Douglas Gregor * 24693910cfd17fcd99ac80158e625fc63e4784d26435Douglas Gregor * For declarations written in the global scope, the lexical parent is 24703910cfd17fcd99ac80158e625fc63e4784d26435Douglas Gregor * the translation unit. 24712be5bc9ad3981347a000742f81b91ab3080f1214Douglas Gregor */ 24722be5bc9ad3981347a000742f81b91ab3080f1214Douglas GregorCINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor); 24739f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor 24749f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor/** 24759f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \brief Determine the set of methods that are overridden by the given 24769f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * method. 24779f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 24789f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * In both Objective-C and C++, a method (aka virtual member function, 24799f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * in C++) can override a virtual method in a base class. For 24809f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * Objective-C, a method is said to override any method in the class's 2481044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * base class, its protocols, or its categories' protocols, that has the same 2482044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * selector and is of the same kind (class or instance). 2483044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * If no such method exists, the search continues to the class's superclass, 2484044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * its protocols, and its categories, and so on. A method from an Objective-C 2485044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * implementation is considered to override the same methods as its 2486044e645605c6d75223e33d23e3c5701cb389969fArgyrios Kyrtzidis * corresponding method in the interface. 24879f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 24889f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * For C++, a virtual member function overrides any virtual member 24899f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * function with the same signature that occurs in its base 24909f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * classes. With multiple inheritance, a virtual member function can 24919f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * override several virtual member functions coming from different 24929f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * base classes. 24939f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 24949f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * In all cases, this function determines the immediate overridden 24959f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * method, rather than all of the overridden methods. For example, if 24969f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * a method is originally declared in a class A, then overridden in B 24979f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * (which in inherits from A) and also in C (which inherited from B), 24989f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * then the only overridden method returned from this function when 24999f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * invoked on C's method will be B's method. The client may then 25009f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * invoke this function again, given the previously-found overridden 25019f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * methods, to map out the complete method-override set. 25029f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 25039f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \param cursor A cursor representing an Objective-C or C++ 25049f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * method. This routine will compute the set of methods that this 25059f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * method overrides. 25069f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 25079f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \param overridden A pointer whose pointee will be replaced with a 25089f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * pointer to an array of cursors, representing the set of overridden 25099f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * methods. If there are no overridden methods, the pointee will be 25109f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * set to NULL. The pointee must be freed via a call to 25119f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \c clang_disposeOverriddenCursors(). 25129f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * 25139f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \param num_overridden A pointer to the number of overridden 25149f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * functions, will be set to the number of overridden functions in the 25159f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * array pointed to by \p overridden. 25169f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor */ 25179f59234a91d057cee7c5e3cee91da8696858c692Douglas GregorCINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor, 25189f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor CXCursor **overridden, 25199f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor unsigned *num_overridden); 25209f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor 25219f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor/** 25229f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * \brief Free the set of overridden cursors returned by \c 25239f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor * clang_getOverriddenCursors(). 25249f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor */ 25259f59234a91d057cee7c5e3cee91da8696858c692Douglas GregorCINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden); 25269f59234a91d057cee7c5e3cee91da8696858c692Douglas Gregor 252745e1dae500bba7a9ef5b8206263a5609c07c6f03Ted Kremenek/** 2528ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor * \brief Retrieve the file that is included by the given inclusion directive 2529ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor * cursor. 2530ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor */ 2531ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas GregorCINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor); 2532ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor 2533ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0edDouglas Gregor/** 2534c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 2535c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 25361efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 2537c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2538c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_CURSOR_SOURCE Mapping between cursors and source code 2539c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2540c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Cursors represent a location within the Abstract Syntax Tree (AST). These 2541c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * routines help map between cursors and the physical locations where the 2542c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * described entities occur in the source code. The mapping is provided in 2543c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * both directions, so one can map from source code to the AST and back. 2544c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 2545c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 254650398199fb10e196a8d92fbf7a062dbe42ed88fdSteve Naroff */ 25471efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 25486a6de8b4fc944ca1bfa4e47c516d049a0d627b0eSteve Naroff/** 2549b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \brief Map a source location to the cursor that describes the entity at that 2550b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * location in the source code. 2551b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * 2552b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * clang_getCursor() maps an arbitrary source location within a translation 2553b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * unit down to the most specific cursor that describes the entity at that 25541efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * location. For example, given an expression \c x + y, invoking 2555b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * clang_getCursor() with a source location pointing to "x" will return the 25561efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * cursor for "x"; similarly for "y". If the cursor points anywhere between 2557b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * "x" or "y" (e.g., on the + or the whitespace around it), clang_getCursor() 2558b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * will return a cursor referring to the "+" expression. 2559b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * 2560b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * \returns a cursor representing the entity at the given source location, or 2561b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas Gregor * a NULL cursor if no such entity can be found. 25626a6de8b4fc944ca1bfa4e47c516d049a0d627b0eSteve Naroff */ 2563b979034b100be14de2223f2b8f6cc7a3275cbe4fDouglas GregorCINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, CXSourceLocation); 25641efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 256598258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor/** 256698258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor * \brief Retrieve the physical location of the source constructor referenced 256798258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor * by the given cursor. 256898258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor * 256998258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor * The location of a declaration is typically the location of the name of that 25701efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * declaration, where the name of that declaration would occur if it is 25711efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * unnamed, or some keyword that introduces that particular declaration. 25721efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * The location of a reference is where that reference occurs within the 257398258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor * source code. 257498258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas Gregor */ 257598258afae66bab39b0c57a3efb6b20d4fbb5746cDouglas GregorCINDEX_LINKAGE CXSourceLocation clang_getCursorLocation(CXCursor); 2576c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 2577b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor/** 2578b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * \brief Retrieve the physical extent of the source construct referenced by 2579a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * the given cursor. 2580a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * 2581a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * The extent of a cursor starts with the file/line/column pointing at the 2582a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * first character within the source construct that the cursor refers to and 25831efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * ends with the last character withinin that source construct. For a 2584a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * declaration, the extent covers the declaration itself. For a reference, 2585a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * the extent covers the location of the reference (e.g., where the referenced 2586a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor * entity was actually used). 2587a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas Gregor */ 2588a7bde20f8c6334ccc3a7ef4dd77243d0921a8497Douglas GregorCINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor); 2589c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor 2590c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 2591c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 2592c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 259395f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek 2594c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 25958e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \defgroup CINDEX_TYPES Type information for CXCursors 25968e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * 25978e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * @{ 25988e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 25998e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26008e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 26018e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Describes the kind of type 26028e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 26038e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenekenum CXTypeKind { 26048e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek /** 26058e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Reprents an invalid type (e.g., where no type is available). 26068e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 26078e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Invalid = 0, 26088e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26098e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek /** 26108e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief A type whose specific kind is not exposed via this 26118e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * interface. 26128e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 26138e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Unexposed = 1, 26148e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26158e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek /* Builtin types */ 26168e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Void = 2, 26178e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Bool = 3, 26188e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Char_U = 4, 26198e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_UChar = 5, 26208e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Char16 = 6, 26218e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Char32 = 7, 26228e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_UShort = 8, 26238e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_UInt = 9, 26248e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ULong = 10, 26258e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ULongLong = 11, 26268e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_UInt128 = 12, 26278e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Char_S = 13, 26288e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_SChar = 14, 26298e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_WChar = 15, 26308e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Short = 16, 26318e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Int = 17, 26328e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Long = 18, 26338e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_LongLong = 19, 26348e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Int128 = 20, 26358e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Float = 21, 26368e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Double = 22, 26378e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_LongDouble = 23, 26388e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_NullPtr = 24, 26398e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Overload = 25, 26408e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Dependent = 26, 26418e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ObjCId = 27, 26428e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ObjCClass = 28, 26438e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ObjCSel = 29, 26448e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_FirstBuiltin = CXType_Void, 26458e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_LastBuiltin = CXType_ObjCSel, 26468e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26478e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Complex = 100, 26488e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Pointer = 101, 26498e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_BlockPointer = 102, 26508e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_LValueReference = 103, 26518e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_RValueReference = 104, 26528e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Record = 105, 26538e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Enum = 106, 26548e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_Typedef = 107, 26558e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek CXType_ObjCInterface = 108, 265604c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted Kremenek CXType_ObjCObjectPointer = 109, 265704c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted Kremenek CXType_FunctionNoProto = 110, 26585f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis CXType_FunctionProto = 111, 265984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXType_ConstantArray = 112, 266084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXType_Vector = 113 26618e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek}; 26628e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26638e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 266484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Describes the calling convention of a function type 266584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 266684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidisenum CXCallingConv { 266784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_Default = 0, 266884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_C = 1, 266984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_X86StdCall = 2, 267084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_X86FastCall = 3, 267184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_X86ThisCall = 4, 267284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_X86Pascal = 5, 267384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_AAPCS = 6, 267484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_AAPCS_VFP = 7, 2675263366f9241366f29ba65b703120f302490c39ffDerek Schuff CXCallingConv_PnaclCall = 8, 267638980086c0f791e8c23cc882574f18e5b4a87db6Guy Benyei CXCallingConv_IntelOclBicc = 9, 267784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 267884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_Invalid = 100, 267984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis CXCallingConv_Unexposed = 200 268084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis}; 268184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 268284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 268384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 26848e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief The type of an element in the abstract syntax tree. 26858e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * 26868e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 26878e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenektypedef struct { 26888e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek enum CXTypeKind kind; 26898e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek void *data[2]; 26908e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek} CXType; 26918e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26928e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 26938e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Retrieve the type of a CXCursor (if any). 26948e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 26958e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE CXType clang_getCursorType(CXCursor C); 26968e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 26978e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 2698ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko * \brief Pretty-print the underlying type using the rules of the 2699ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko * language of the translation unit from which it came. 2700ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko * 2701ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko * If the type is invalid, an empty string is returned. 2702ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko */ 2703ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri GribenkoCINDEX_LINKAGE CXString clang_getTypeSpelling(CXType CT); 2704ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko 2705ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko/** 270684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the underlying type of a typedef declaration. 270784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 270884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If the cursor does not reference a typedef declaration, an invalid type is 270984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * returned. 271084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 271184b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE CXType clang_getTypedefDeclUnderlyingType(CXCursor C); 271284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 271384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 271484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the integer type of an enum declaration. 271584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 271684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If the cursor does not reference an enum declaration, an invalid type is 271784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * returned. 271884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 271984b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE CXType clang_getEnumDeclIntegerType(CXCursor C); 272084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 272184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 272284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the integer value of an enum constant declaration as a signed 272384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * long long. 272484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 272584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. 272684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * Since this is also potentially a valid constant value, the kind of the cursor 272784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * must be verified before calling this function. 272884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 272984b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE long long clang_getEnumConstantDeclValue(CXCursor C); 273084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 273184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 273284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the integer value of an enum constant declaration as an unsigned 273384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * long long. 273484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 273584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. 273684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * Since this is also potentially a valid constant value, the kind of the cursor 273784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * must be verified before calling this function. 273884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 273984b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C); 274084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 274184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 27421eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko * \brief Retrieve the bit width of a bit field declaration as an integer. 27431eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko * 27441eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko * If a cursor that is not a bit field declaration is passed in, -1 is returned. 27451eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko */ 27461eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri GribenkoCINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C); 27471eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko 27481eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko/** 2749d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * \brief Retrieve the number of non-variadic arguments associated with a given 2750d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * cursor. 2751d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * 2752e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis * The number of arguments can be determined for calls as well as for 2753e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis * declarations of functions or methods. For other cursors -1 is returned. 2754d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis */ 2755d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios KyrtzidisCINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C); 2756d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis 2757d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis/** 2758d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * \brief Retrieve the argument cursor of a function or method. 2759d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * 2760e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis * The argument cursor can be determined for calls as well as for declarations 2761e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis * of functions or methods. For other cursors and for invalid indices, an 2762e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis * invalid cursor is returned. 2763d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis */ 2764d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios KyrtzidisCINDEX_LINKAGE CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); 2765d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis 2766d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis/** 27677eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Determine whether two CXTypes represent the same type. 27688e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * 27697eee0184570366285589d788bcd7f5dda8345915James Dennett * \returns non-zero if the CXTypes represent the same type and 27707eee0184570366285589d788bcd7f5dda8345915James Dennett * zero otherwise. 27718e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 27728e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE unsigned clang_equalTypes(CXType A, CXType B); 27738e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 27748e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 27758e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Return the canonical type for a CXType. 27768e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * 27778e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * Clang's type system explicitly models typedefs and all the ways 27788e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * a specific type can be represented. The canonical type is the underlying 27798e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * type with all the "sugar" removed. For example, if 'T' is a typedef 27808e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * for 'int', the canonical type for 'T' would be 'int'. 27818e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 27828e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE CXType clang_getCanonicalType(CXType T); 27838e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 27848e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 27857eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Determine whether a CXType has the "const" qualifier set, 27867eee0184570366285589d788bcd7f5dda8345915James Dennett * without looking through typedefs that may have added "const" at a 27877eee0184570366285589d788bcd7f5dda8345915James Dennett * different level. 2788e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor */ 2789e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas GregorCINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T); 2790e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor 2791e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor/** 27927eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Determine whether a CXType has the "volatile" qualifier set, 27937eee0184570366285589d788bcd7f5dda8345915James Dennett * without looking through typedefs that may have added "volatile" at 27947eee0184570366285589d788bcd7f5dda8345915James Dennett * a different level. 2795e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor */ 2796e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas GregorCINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(CXType T); 2797e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor 2798e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor/** 27997eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Determine whether a CXType has the "restrict" qualifier set, 28007eee0184570366285589d788bcd7f5dda8345915James Dennett * without looking through typedefs that may have added "restrict" at a 28017eee0184570366285589d788bcd7f5dda8345915James Dennett * different level. 2802e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor */ 2803e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas GregorCINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T); 2804e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor 2805e72fb6f40231a1e8372c7576b69f06f0a1eb28a7Douglas Gregor/** 28068e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief For pointer types, returns the type of the pointee. 28078e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 28088e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE CXType clang_getPointeeType(CXType T); 28098e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 28108e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 28118e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Return the cursor for the declaration of the given type. 28128e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 28138e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE CXCursor clang_getTypeDeclaration(CXType T); 28148e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 28155389f48b24937ad7b4093307128b3cbf25235654David Chisnall/** 28165389f48b24937ad7b4093307128b3cbf25235654David Chisnall * Returns the Objective-C type encoding for the specified declaration. 28175389f48b24937ad7b4093307128b3cbf25235654David Chisnall */ 28185389f48b24937ad7b4093307128b3cbf25235654David ChisnallCINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C); 28198e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 28208e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 28218e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * \brief Retrieve the spelling of a given CXTypeKind. 28228e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 28238e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted KremenekCINDEX_LINKAGE CXString clang_getTypeKindSpelling(enum CXTypeKind K); 28248e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 28258e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 282684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the calling convention associated with a function type. 282784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 282884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If a non-function type is passed in, CXCallingConv_Invalid is returned. 282984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 283084b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T); 283184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 283284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 28339a140845438c2fc31e7d48a6dedbc695f4c83c68Ted Kremenek * \brief Retrieve the result type associated with a function type. 283484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 283584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If a non-function type is passed in, an invalid type is returned. 283604c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted Kremenek */ 283704c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted KremenekCINDEX_LINKAGE CXType clang_getResultType(CXType T); 283804c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted Kremenek 283904c3cf35a80c09ab78e519f2e71ecccd5c5d8da0Ted Kremenek/** 28407eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Retrieve the number of non-variadic arguments associated with a 28417eee0184570366285589d788bcd7f5dda8345915James Dennett * function type. 284284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 2843d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios Kyrtzidis * If a non-function type is passed in, -1 is returned. 284484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 2845d98ef9ae48ab4090d4d5d703ce65cfac62807fdaArgyrios KyrtzidisCINDEX_LINKAGE int clang_getNumArgTypes(CXType T); 284684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 284784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 284884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the type of an argument of a function type. 284984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 28507eee0184570366285589d788bcd7f5dda8345915James Dennett * If a non-function type is passed in or the function does not have enough 28517eee0184570366285589d788bcd7f5dda8345915James Dennett * parameters, an invalid type is returned. 285284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 285384b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE CXType clang_getArgType(CXType T, unsigned i); 285484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 285584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 285684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Return 1 if the CXType is a variadic function type, and 0 otherwise. 285784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 285884b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic(CXType T); 285984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 286084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 286184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Retrieve the result type associated with a given cursor. 286284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 286384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * This only returns a valid type if the cursor refers to a function or method. 28649a140845438c2fc31e7d48a6dedbc695f4c83c68Ted Kremenek */ 28659a140845438c2fc31e7d48a6dedbc695f4c83c68Ted KremenekCINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C); 28669a140845438c2fc31e7d48a6dedbc695f4c83c68Ted Kremenek 28679a140845438c2fc31e7d48a6dedbc695f4c83c68Ted Kremenek/** 28683ce9e7d270e7df86c09c8126b4412d55be7c123bTed Kremenek * \brief Return 1 if the CXType is a POD (plain old data) type, and 0 28693ce9e7d270e7df86c09c8126b4412d55be7c123bTed Kremenek * otherwise. 28703ce9e7d270e7df86c09c8126b4412d55be7c123bTed Kremenek */ 28713ce9e7d270e7df86c09c8126b4412d55be7c123bTed KremenekCINDEX_LINKAGE unsigned clang_isPODType(CXType T); 28723ce9e7d270e7df86c09c8126b4412d55be7c123bTed Kremenek 28733ce9e7d270e7df86c09c8126b4412d55be7c123bTed Kremenek/** 287484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Return the element type of an array, complex, or vector type. 287584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 287684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If a type is passed in that is not an array, complex, or vector type, 287784b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * an invalid type is returned. 287884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 287984b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE CXType clang_getElementType(CXType T); 288084b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 288184b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 288284b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * \brief Return the number of elements of an array or vector type. 288384b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * 288484b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * If a type is passed in that is not an array or vector type, 288584b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis * -1 is returned. 288684b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis */ 288784b796492de8a708150dd3f86ae191041d42eef9Argyrios KyrtzidisCINDEX_LINKAGE long long clang_getNumElements(CXType T); 288884b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis 288984b796492de8a708150dd3f86ae191041d42eef9Argyrios Kyrtzidis/** 28905f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis * \brief Return the element type of an array type. 28915f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis * 28925f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis * If a non-array type is passed in, an invalid type is returned. 28935f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis */ 28945f0bfc522266f3319c4a6262b016a552de058c7fArgyrios KyrtzidisCINDEX_LINKAGE CXType clang_getArrayElementType(CXType T); 28955f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis 28965f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis/** 2897bed28ac1d1463adca3ecf24fca5c30646fa9dbb2Sylvestre Ledru * \brief Return the array size of a constant array. 28985f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis * 28995f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis * If a non-array type is passed in, -1 is returned. 29005f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis */ 29015f0bfc522266f3319c4a6262b016a552de058c7fArgyrios KyrtzidisCINDEX_LINKAGE long long clang_getArraySize(CXType T); 29025f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis 29035f0bfc522266f3319c4a6262b016a552de058c7fArgyrios Kyrtzidis/** 2904411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief List the possible error codes for \c clang_Type_getSizeOf, 2905411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and 2906411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \c clang_Cursor_getOffsetOf. 2907411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * 2908411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * A value of this enumeration type can be returned if the target type is not 2909411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * a valid argument to sizeof, alignof or offsetof. 2910411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2911411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidisenum CXTypeLayoutError { 2912411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis /** 2913411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief Type is of kind CXType_Invalid. 2914411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2915411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis CXTypeLayoutError_Invalid = -1, 2916411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis /** 2917411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief The type is an incomplete Type. 2918411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2919411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis CXTypeLayoutError_Incomplete = -2, 2920411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis /** 2921411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief The type is a dependent Type. 2922411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2923411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis CXTypeLayoutError_Dependent = -3, 2924411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis /** 2925411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief The type is not a constant size type. 2926411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2927411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis CXTypeLayoutError_NotConstantSize = -4, 2928411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis /** 2929411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief The Field name is not valid for this record. 2930411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2931411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis CXTypeLayoutError_InvalidFieldName = -5 2932411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis}; 2933411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis 2934411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis/** 2935411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief Return the alignment of a type in bytes as per C++[expr.alignof] 2936411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * standard. 2937411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * 2938411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. 2939411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete 2940411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * is returned. 2941411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is 2942411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * returned. 2943411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is not a constant size type, 2944411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * CXTypeLayoutError_NotConstantSize is returned. 2945411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2946411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios KyrtzidisCINDEX_LINKAGE long long clang_Type_getAlignOf(CXType T); 2947411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis 2948411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis/** 2949411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief Return the size of a type in bytes as per C++[expr.sizeof] standard. 2950411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * 2951411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. 2952411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete 2953411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * is returned. 2954411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is 2955411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * returned. 2956411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2957411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios KyrtzidisCINDEX_LINKAGE long long clang_Type_getSizeOf(CXType T); 2958411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis 2959411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis/** 2960411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief Return the offset of a field named S in a record of type T in bits 2961411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * as it would be returned by __offsetof__ as per C++11[18.2p4] 2962411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * 2963411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the cursor is not a record field declaration, CXTypeLayoutError_Invalid 2964411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * is returned. 2965411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the field's type declaration is an incomplete type, 2966411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * CXTypeLayoutError_Incomplete is returned. 2967411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the field's type declaration is a dependent type, 2968411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * CXTypeLayoutError_Dependent is returned. 2969411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * If the field's name S is not found, 2970411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * CXTypeLayoutError_InvalidFieldName is returned. 2971411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2972411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios KyrtzidisCINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S); 2973411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis 2974411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis/** 2975411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * \brief Returns non-zero if the cursor specifies a Record member that is a 2976411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis * bitfield. 2977411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis */ 2978411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios KyrtzidisCINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C); 2979411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis 2980411d33aa0b0d3bc9b2faec40cd821bdd836094abArgyrios Kyrtzidis/** 29813064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek * \brief Returns 1 if the base class specified by the cursor with kind 29823064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek * CX_CXXBaseSpecifier is virtual. 29833064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek */ 29843064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed KremenekCINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); 29853064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek 29863064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek/** 29873064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek * \brief Represents the C++ access control level to a base class for a 29883064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek * cursor with kind CX_CXXBaseSpecifier. 29893064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek */ 29903064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenekenum CX_CXXAccessSpecifier { 29913064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek CX_CXXInvalidAccessSpecifier, 29923064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek CX_CXXPublic, 29933064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek CX_CXXProtected, 29943064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek CX_CXXPrivate 29953064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek}; 29963064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek 29973064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek/** 299804b6748ee90649069ee79464317ae6cd6aca317dArgyrios Kyrtzidis * \brief Returns the access control level for the referenced object. 299904b6748ee90649069ee79464317ae6cd6aca317dArgyrios Kyrtzidis * If the cursor refers to a C++ declaration, its access control level within its 300004b6748ee90649069ee79464317ae6cd6aca317dArgyrios Kyrtzidis * parent scope is returned. Otherwise, if the cursor refers to a base specifier or 300104b6748ee90649069ee79464317ae6cd6aca317dArgyrios Kyrtzidis * access specifier, the specifier itself is returned. 30023064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek */ 30033064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed KremenekCINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor); 30043064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek 30053064ef9e604d19a0cfd0d8e3ed3055bfd83f88fdTed Kremenek/** 30061f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \brief Determine the number of overloaded declarations referenced by a 30071f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \c CXCursor_OverloadedDeclRef cursor. 30081f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 30091f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \param cursor The cursor whose overloaded declarations are being queried. 30101f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 30111f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \returns The number of overloaded declarations referenced by \c cursor. If it 30121f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * is not a \c CXCursor_OverloadedDeclRef cursor, returns 0. 30131f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor */ 30141f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas GregorCINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor); 30151f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor 30161f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor/** 30171f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \brief Retrieve a cursor for one of the overloaded declarations referenced 30181f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * by a \c CXCursor_OverloadedDeclRef cursor. 30191f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 30201f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \param cursor The cursor whose overloaded declarations are being queried. 30211f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 30221f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \param index The zero-based index into the set of overloaded declarations in 30231f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * the cursor. 30241f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * 30251f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \returns A cursor representing the declaration referenced by the given 30261f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * \c cursor at the specified \c index. If the cursor does not have an 30271f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * associated set of overloaded declarations, or if the index is out of bounds, 30281f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor * returns \c clang_getNullCursor(); 30291f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor */ 30301f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas GregorCINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor, 30311f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor unsigned index); 30321f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor 30331f60d9ea523fc321d811fe880ba9a1ec74fa8f9bDouglas Gregor/** 30348e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek * @} 30358e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek */ 303695f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek 303795f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek/** 3038ad72f4dad4cf0fd2b71eb8f4704d2fe7ac58fb44Ted Kremenek * \defgroup CINDEX_ATTRIBUTES Information for attributes 303995f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * 304095f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * @{ 304195f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek */ 304295f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek 304395f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek 304495f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek/** 304595f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * \brief For cursors representing an iboutletcollection attribute, 304695f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * this function returns the collection element type. 304795f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * 304895f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek */ 304995f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted KremenekCINDEX_LINKAGE CXType clang_getIBOutletCollectionType(CXCursor); 305095f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek 305195f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek/** 305295f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek * @} 305395f33555a6d51b6537a9ed3968c3d1c2e4991b51Ted Kremenek */ 30548e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek 30558e0ac174c8c8c980927b3e1447f16f62fbe2a2e4Ted Kremenek/** 3056c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_CURSOR_TRAVERSAL Traversing the AST with cursors 3057c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3058c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * These routines provide the ability to traverse the abstract syntax tree 3059c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * using cursors. 3060c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3061c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 3062c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 30631efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 3064c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3065c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Describes how the traversal of the children of a particular 3066c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * cursor should proceed after visiting a particular child cursor. 3067c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3068c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * A value of this enumeration type should be returned by each 3069c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \c CXCursorVisitor to indicate how clang_visitChildren() proceed. 3070c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3071c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregorenum CXChildVisitResult { 3072c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 30731efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Terminates the cursor traversal. 3074c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3075c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXChildVisit_Break, 30761efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 3077c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Continues the cursor traversal with the next sibling of 3078c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * the cursor just visited, without visiting its children. 3079c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3080c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXChildVisit_Continue, 3081c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor /** 3082c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Recursively traverse the children of this cursor, using 3083c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * the same visitor and client data. 3084c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3085c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXChildVisit_Recurse 3086c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor}; 3087c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 3088c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3089c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Visitor invoked for each cursor found by a traversal. 3090c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3091c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * This visitor function will be invoked for each cursor found by 3092c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * clang_visitCursorChildren(). Its first argument is the cursor being 3093c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * visited, its second argument is the parent visitor for that cursor, 3094c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * and its third argument is the client data provided to 3095c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * clang_visitCursorChildren(). 3096c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3097c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * The visitor should return one of the \c CXChildVisitResult values 3098c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * to direct clang_visitCursorChildren(). 3099c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 31001efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbartypedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor, 31011efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar CXCursor parent, 3102c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXClientData client_data); 3103c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 3104c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3105c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Visit the children of a particular cursor. 3106c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3107c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * This function visits all the direct children of the given cursor, 3108c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * invoking the given \p visitor function with the cursors of each 3109c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * visited child. The traversal may be recursive, if the visitor returns 3110c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \c CXChildVisit_Recurse. The traversal may also be ended prematurely, if 3111c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * the visitor returns \c CXChildVisit_Break. 3112c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3113c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \param parent the cursor whose child may be visited. All kinds of 3114a57259e9d7b30bcce93f0a62eee0488738026172Daniel Dunbar * cursors can be visited, including invalid cursors (which, by 3115c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * definition, have no children). 3116c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3117c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \param visitor the visitor function that will be invoked for each 3118c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * child of \p parent. 3119c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3120c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \param client_data pointer data supplied by the client, which will 3121c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * be passed to the visitor each time it is invoked. 3122c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3123c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \returns a non-zero value if the traversal was terminated 3124c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * prematurely by the visitor returning \c CXChildVisit_Break. 3125c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 31261efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel DunbarCINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent, 3127c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXCursorVisitor visitor, 3128c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor CXClientData client_data); 31293387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall#ifdef __has_feature 31303387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall# if __has_feature(blocks) 31313387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall/** 31323387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * \brief Visitor invoked for each cursor found by a traversal. 31333387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * 31343387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * This visitor block will be invoked for each cursor found by 31353387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * clang_visitChildrenWithBlock(). Its first argument is the cursor being 31363387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * visited, its second argument is the parent visitor for that cursor. 31373387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * 31383387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * The visitor should return one of the \c CXChildVisitResult values 31393387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * to direct clang_visitChildrenWithBlock(). 31403387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall */ 31413387c65a094a02b2a94c05111d035a97d3d5c794David Chisnalltypedef enum CXChildVisitResult 31423387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall (^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent); 31433387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall 31443387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall/** 31453387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * Visits the children of a cursor using the specified block. Behaves 31463387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall * identically to clang_visitChildren() in all other respects. 31473387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall */ 31483387c65a094a02b2a94c05111d035a97d3d5c794David Chisnallunsigned clang_visitChildrenWithBlock(CXCursor parent, 31493387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall CXCursorVisitorBlock block); 31503387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall# endif 31513387c65a094a02b2a94c05111d035a97d3d5c794David Chisnall#endif 31521efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 3153c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3154c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 3155c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 31561efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 3157c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3158c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_CURSOR_XREF Cross-referencing in the AST 3159c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 31601efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * These routines provide the ability to determine references within and 3161c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * across translation units, by providing the names of the entities referenced 3162c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * by cursors, follow reference cursors to the declarations they reference, 3163c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * and associate declarations with their definitions. 3164c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3165c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 3166c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 31671efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 3168c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3169c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Retrieve a Unified Symbol Resolution (USR) for the entity referenced 3170c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * by the given cursor. 3171c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 3172c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * A Unified Symbol Resolution (USR) is a string that identifies a particular 3173c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * entity (function, class, variable, etc.) within a program. USRs can be 3174c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * compared across translation units to determine, e.g., when references in 3175c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * one translation refer to an entity defined in another translation unit. 3176c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3177c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE CXString clang_getCursorUSR(CXCursor); 3178c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 3179c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 3180896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C class. 3181896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3182896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString clang_constructUSR_ObjCClass(const char *class_name); 3183896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3184896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3185896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C category. 3186896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3187896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString 318866ccaec73706f3623d2e7d191fe2c944feedcc2bTed Kremenek clang_constructUSR_ObjCCategory(const char *class_name, 3189896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek const char *category_name); 3190896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3191896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3192896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C protocol. 3193896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3194896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString 3195896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek clang_constructUSR_ObjCProtocol(const char *protocol_name); 3196896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3197896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3198896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3199896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C instance variable and 3200896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * the USR for its containing class. 3201896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3202896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString clang_constructUSR_ObjCIvar(const char *name, 3203896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek CXString classUSR); 3204896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3205896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3206896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C method and 3207896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * the USR for its containing class. 3208896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3209896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString clang_constructUSR_ObjCMethod(const char *name, 3210896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek unsigned isInstanceMethod, 3211896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek CXString classUSR); 3212896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3213896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3214896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Construct a USR for a specified Objective-C property and the USR 3215896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * for its containing class. 3216896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek */ 3217896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXString clang_constructUSR_ObjCProperty(const char *property, 3218896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek CXString classUSR); 3219896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 3220896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek/** 3221c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \brief Retrieve a name for the entity referenced by this cursor. 3222c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 3223c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas GregorCINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor); 3224c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor 3225358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor/** 3226ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * \brief Retrieve a range for a piece that forms the cursors spelling name. 3227ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * Most of the times there is only one range for the complete spelling but for 3228ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * objc methods and objc message expressions, there are multiple pieces for each 3229ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * selector identifier. 3230ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * 3231ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * \param pieceIndex the index of the spelling name piece. If this is greater 3232ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * than the actual number of pieces, it will return a NULL (invalid) range. 3233ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * 3234ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis * \param options Reserved. 3235ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis */ 3236ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios KyrtzidisCINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor, 3237ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis unsigned pieceIndex, 3238ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis unsigned options); 3239ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis 3240ba1da14e79c1ecd49306e5175b69baa1e7ed4293Argyrios Kyrtzidis/** 3241358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor * \brief Retrieve the display name for the entity referenced by this cursor. 3242358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor * 3243358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor * The display name contains extra information that helps identify the cursor, 3244358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor * such as the parameters of a function or template or the arguments of a 3245358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor * class template specialization. 3246358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor */ 3247358559d8d7b458c5f64941842383a16e61f0828dDouglas GregorCINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor); 3248358559d8d7b458c5f64941842383a16e61f0828dDouglas Gregor 3249c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor/** \brief For a cursor that is a reference, retrieve a cursor representing the 3250c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * entity that it references. 3251c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * 3252c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * Reference cursors refer to other entities in the AST. For example, an 3253c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * Objective-C superclass reference cursor refers to an Objective-C class. 32541efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * This function produces the cursor for the Objective-C class from the 3255c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * cursor for the superclass reference. If the input cursor is a declaration or 3256c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor * definition, it returns that declaration or definition unchanged. 32571efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * Otherwise, returns the NULL cursor. 3258c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas Gregor */ 3259c5d1e9375d71e66d22456e7cc52cc7c0a5c65c3fDouglas GregorCINDEX_LINKAGE CXCursor clang_getCursorReferenced(CXCursor); 3260b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor 32611efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar/** 3262b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * \brief For a cursor that is either a reference to or a declaration 3263b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * of some entity, retrieve a cursor that describes the definition of 3264b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * that entity. 3265b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * 3266b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * Some entities can be declared multiple times within a translation 3267b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * unit, but only one of those declarations can also be a 3268b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * definition. For example, given: 3269b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * 3270b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * \code 3271b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * int f(int, int); 3272b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * int g(int x, int y) { return f(x, y); } 3273b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * int f(int a, int b) { return a + b; } 3274b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * int f(int, int); 3275b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * \endcode 3276b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * 3277b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * there are three declarations of the function "f", but only the 3278b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * second one is a definition. The clang_getCursorDefinition() 3279b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * function will take any cursor pointing to a declaration of "f" 3280b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * (the first or fourth lines of the example) or a cursor referenced 3281b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * that uses "f" (the call to "f' inside "g") and will return a 3282b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * declaration cursor pointing to the definition (the second "f" 3283b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * declaration). 3284b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * 3285b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * If given a cursor for which there is no corresponding definition, 3286b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * e.g., because there is no definition of that entity within this 3287b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * translation unit, returns a NULL cursor. 3288b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor */ 3289b699866820102a69d83d6ac6941985c5ef4e8c40Douglas GregorCINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor); 3290b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor 32911efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar/** 3292b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * \brief Determine whether the declaration pointed to by this cursor 3293b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor * is also a definition of that entity. 3294b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor */ 3295b699866820102a69d83d6ac6941985c5ef4e8c40Douglas GregorCINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor); 3296b699866820102a69d83d6ac6941985c5ef4e8c40Douglas Gregor 3297c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 32981a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * \brief Retrieve the canonical cursor corresponding to the given cursor. 32991a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * 33001a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * In the C family of languages, many kinds of entities can be declared several 33011a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * times within a single translation unit. For example, a structure type can 33021a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * be forward-declared (possibly multiple times) and later defined: 33031a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * 33041a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * \code 33051a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * struct X; 33061a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * struct X; 33071a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * struct X { 33081a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * int member; 33091a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * }; 33101a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * \endcode 33111a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * 33121a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * The declarations and the definition of \c X are represented by three 33131a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * different cursors, all of which are declarations of the same underlying 33141a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * entity. One of these cursor is considered the "canonical" cursor, which 33151a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * is effectively the representative for the underlying entity. One can 33161a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * determine if two cursors are declarations of the same underlying entity by 33171a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * comparing their canonical cursors. 33181a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * 33191a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor * \returns The canonical cursor for the entity referred to by the given cursor. 33201a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor */ 33211a9d0503b67a499797141af0fd6d315d5045f0eaDouglas GregorCINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor); 33221a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor 332334ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis 332434ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis/** 332534ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * \brief If the cursor points to a selector identifier in a objc method or 332634ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * message expression, this returns the selector index. 332734ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * 33287eee0184570366285589d788bcd7f5dda8345915James Dennett * After getting a cursor with #clang_getCursor, this can be called to 332934ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * determine if the location points to a selector identifier. 333034ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * 333134ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * \returns The selector index if the cursor is an objc method or message 333234ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * expression and the cursor is pointing to a selector identifier, or -1 333334ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis * otherwise. 333434ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis */ 333534ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios KyrtzidisCINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor); 333634ebe1e1b0779bcea2f277bc6b4e9dd98bf70b7bArgyrios Kyrtzidis 33371a9d0503b67a499797141af0fd6d315d5045f0eaDouglas Gregor/** 3338f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * \brief Given a cursor pointing to a C++ method call or an ObjC message, 3339f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * returns non-zero if the method/message is "dynamic", meaning: 3340f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * 3341f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * For a C++ method: the call is virtual. 3342f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * For an ObjC message: the receiver is an object instance, not 'super' or a 3343f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * specific class. 3344f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * 3345f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * If the method/message is "static" or the cursor does not point to a 3346f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis * method/message, it will return zero. 3347f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis */ 3348f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios KyrtzidisCINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C); 3349e4a990f34904eb572c8d6aa1deef19465214359cArgyrios Kyrtzidis 3350e4a990f34904eb572c8d6aa1deef19465214359cArgyrios Kyrtzidis/** 3351e4a990f34904eb572c8d6aa1deef19465214359cArgyrios Kyrtzidis * \brief Given a cursor pointing to an ObjC message, returns the CXType of the 3352e4a990f34904eb572c8d6aa1deef19465214359cArgyrios Kyrtzidis * receiver. 3353e4a990f34904eb572c8d6aa1deef19465214359cArgyrios Kyrtzidis */ 3354e4a990f34904eb572c8d6aa1deef19465214359cArgyrios KyrtzidisCINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C); 3355f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis 3356f39a7aea7dd0bf0716a066e2db2f97ea8730e4faArgyrios Kyrtzidis/** 3357aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko * \brief Given a cursor that represents a declaration, return the associated 3358aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko * comment's source range. The range may include multiple consecutive comments 3359aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko * with whitespace in between. 3360aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko */ 3361aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri GribenkoCINDEX_LINKAGE CXSourceRange clang_Cursor_getCommentRange(CXCursor C); 3362aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko 3363aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko/** 3364aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko * \brief Given a cursor that represents a declaration, return the associated 3365aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko * comment text, including comment markers. 3366aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko */ 3367aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri GribenkoCINDEX_LINKAGE CXString clang_Cursor_getRawCommentText(CXCursor C); 3368aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko 3369aa0cd85838f2a024e589ea4e8c2094130065af21Dmitri Gribenko/** 3370ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Given a cursor that represents a documentable entity (e.g., 3371ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * declaration), return the associated \\brief paragraph; otherwise return the 3372ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * first paragraph. 33732d44d77fed3200e2eff289f55493317e90d3398cDmitri Gribenko */ 33742d44d77fed3200e2eff289f55493317e90d3398cDmitri GribenkoCINDEX_LINKAGE CXString clang_Cursor_getBriefCommentText(CXCursor C); 33752d44d77fed3200e2eff289f55493317e90d3398cDmitri Gribenko 33762d44d77fed3200e2eff289f55493317e90d3398cDmitri Gribenko/** 3377ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Given a cursor that represents a documentable entity (e.g., 3378ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * declaration), return the associated parsed comment as a 3379ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \c CXComment_FullComment AST node. 3380ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3381ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C); 3382ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3383ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3384ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * @} 3385ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3386ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3387ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 33885d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \defgroup CINDEX_MODULE Module introspection 33895d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 33905d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * The functions in this group provide access to information about modules. 33915d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 33925d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * @{ 33935d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 33945d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 33955d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidistypedef void *CXModule; 33965d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 33975d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 33985d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \brief Given a CXCursor_ModuleImportDecl cursor, return the associated module. 33995d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 34005d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios KyrtzidisCINDEX_LINKAGE CXModule clang_Cursor_getModule(CXCursor C); 34015d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34025d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3403d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios Kyrtzidis * \param Module a module object. 34045d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34055d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \returns the parent of a sub-module or NULL if the given module is top-level, 34065d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * e.g. for 'std.vector' it will return the 'std' module. 34075d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 3408d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios KyrtzidisCINDEX_LINKAGE CXModule clang_Module_getParent(CXModule Module); 34095d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34105d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3411d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios Kyrtzidis * \param Module a module object. 34125d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34135d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \returns the name of the module, e.g. for the 'std.vector' sub-module it 34145d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * will return "vector". 34155d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 3416d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios KyrtzidisCINDEX_LINKAGE CXString clang_Module_getName(CXModule Module); 34175d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34185d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3419d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios Kyrtzidis * \param Module a module object. 34205d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34215d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \returns the full name of the module, e.g. "std.vector". 34225d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 3423d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios KyrtzidisCINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module); 34245d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34255d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3426d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios Kyrtzidis * \param Module a module object. 34275d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34285d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \returns the number of top level headers associated with this module. 34295d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 3430c1d22393628a145e54396c0ac66e9625d13a7658Argyrios KyrtzidisCINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit, 3431c1d22393628a145e54396c0ac66e9625d13a7658Argyrios Kyrtzidis CXModule Module); 34325d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34335d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3434d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios Kyrtzidis * \param Module a module object. 34355d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34365d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \param Index top level header index (zero-based). 34375d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * 34385d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * \returns the specified top level header associated with the module. 34395d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 3440d29245ce5ed1f6aee6f056c85ba77b009f11ee83Argyrios KyrtzidisCINDEX_LINKAGE 3441c1d22393628a145e54396c0ac66e9625d13a7658Argyrios KyrtzidisCXFile clang_Module_getTopLevelHeader(CXTranslationUnit, 3442c1d22393628a145e54396c0ac66e9625d13a7658Argyrios Kyrtzidis CXModule Module, unsigned Index); 34435d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34445d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 34455d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis * @} 34465d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis */ 34475d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis 34485d04b1af7b76ed536557d4bba24005ad0d2fd608Argyrios Kyrtzidis/** 3449ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \defgroup CINDEX_COMMENT Comment AST introspection 3450ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3451ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * The routines in this group provide access to information in the 3452ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * documentation comment ASTs. 3453ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3454ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * @{ 3455ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3456ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3457ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3458ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Describes the type of the comment AST node (\c CXComment). A comment 3459ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * node can be considered block content (e. g., paragraph), inline content 3460ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * (plain text) or neither (the root AST node). 3461ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3462ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkoenum CXCommentKind { 3463ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3464ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Null comment. No AST node is constructed at the requested location 3465ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * because there is no text or a syntax error. 3466ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3467ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_Null = 0, 3468ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3469ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3470ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Plain text. Inline content. 3471ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3472ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_Text = 1, 3473ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3474ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3475ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A command with word-like arguments that is considered inline content. 3476ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3477ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * For example: \\c command. 3478ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3479ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_InlineCommand = 2, 3480ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3481ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3482ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief HTML start tag with attributes (name-value pairs). Considered 3483ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * inline content. 3484ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3485ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * For example: 3486ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \verbatim 3487ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * <br> <br /> <a href="http://example.org/"> 3488ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \endverbatim 3489ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3490ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_HTMLStartTag = 3, 3491ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3492ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3493ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief HTML end tag. Considered inline content. 3494ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3495ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * For example: 3496ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \verbatim 3497ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * </a> 3498ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \endverbatim 3499ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3500ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_HTMLEndTag = 4, 3501ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3502ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3503ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A paragraph, contains inline comment. The paragraph itself is 3504ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * block content. 3505ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3506ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_Paragraph = 5, 3507ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3508ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3509ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A command that has zero or more word-like arguments (number of 3510ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * word-like arguments depends on command name) and a paragraph as an 3511ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * argument. Block command is block content. 3512ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3513ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * Paragraph argument is also a child of the block command. 3514ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3515ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * For example: \\brief has 0 word-like arguments and a paragraph argument. 3516ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3517ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * AST nodes of special kinds that parser knows about (e. g., \\param 3518ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * command) have their own node kinds. 3519ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3520ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_BlockCommand = 6, 3521ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3522ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3523ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A \\param or \\arg command that describes the function parameter 3524ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * (name, passing direction, description). 3525ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 352670517ca5c07c4b41ff8662b94ee22047b0299f8cDmitri Gribenko * For example: \\param [in] ParamName description. 3527ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3528ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment_ParamCommand = 7, 3529ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3530ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 353196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \brief A \\tparam command that describes a template parameter (name and 353296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * description). 353396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 353470517ca5c07c4b41ff8662b94ee22047b0299f8cDmitri Gribenko * For example: \\tparam T description. 353596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko */ 353696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko CXComment_TParamCommand = 8, 353796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko 353896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko /** 3539ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A verbatim block command (e. g., preformatted code). Verbatim 3540ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * block has an opening and a closing command and contains multiple lines of 3541ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * text (\c CXComment_VerbatimBlockLine child nodes). 3542ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3543ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * For example: 3544ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \\verbatim 3545ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * aaa 3546ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \\endverbatim 3547ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 354896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko CXComment_VerbatimBlockCommand = 9, 3549ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3550ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3551ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A line of text that is contained within a 3552ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * CXComment_VerbatimBlockCommand node. 3553ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 355496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko CXComment_VerbatimBlockLine = 10, 3555ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3556ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3557ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A verbatim line command. Verbatim line has an opening command, 3558ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * a single line of text (up to the newline after the opening command) and 3559ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * has no closing command. 3560ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 356196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko CXComment_VerbatimLine = 11, 3562ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3563ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3564ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A full comment attached to a declaration, contains block content. 3565ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 356696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko CXComment_FullComment = 12 3567ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko}; 3568ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3569ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 35702d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \brief The most appropriate rendering mode for an inline command, chosen on 35712d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * command semantics in Doxygen. 35722d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 35732d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenkoenum CXCommentInlineCommandRenderKind { 35742d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko /** 35752d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \brief Command argument should be rendered in a normal font. 35762d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 35772d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko CXCommentInlineCommandRenderKind_Normal, 35782d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko 35792d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko /** 35802d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \brief Command argument should be rendered in a bold font. 35812d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 35822d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko CXCommentInlineCommandRenderKind_Bold, 35832d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko 35842d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko /** 35852d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \brief Command argument should be rendered in a monospaced font. 35862d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 35872d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko CXCommentInlineCommandRenderKind_Monospaced, 35882d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko 35892d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko /** 35902d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \brief Command argument should be rendered emphasized (typically italic 35912d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * font). 35922d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 35932d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko CXCommentInlineCommandRenderKind_Emphasized 35942d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko}; 35952d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko 35962d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko/** 3597ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Describes parameter passing direction for \\param or \\arg command. 3598ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3599ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkoenum CXCommentParamPassDirection { 3600ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3601ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief The parameter is an input parameter. 3602ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3603ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXCommentParamPassDirection_In, 3604ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3605ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3606ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief The parameter is an output parameter. 3607ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3608ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXCommentParamPassDirection_Out, 3609ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3610ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko /** 3611ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief The parameter is an input and output parameter. 3612ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3613ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXCommentParamPassDirection_InOut 3614ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko}; 3615ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3616ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3617ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment AST node of any kind. 3618ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3619ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns the type of the AST node. 3620ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3621ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment); 3622ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3623ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3624ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment AST node of any kind. 3625ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3626ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns number of children of the AST node. 3627ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3628ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment); 3629ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3630ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3631ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment AST node of any kind. 3632ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 363370517ca5c07c4b41ff8662b94ee22047b0299f8cDmitri Gribenko * \param ChildIdx child index (zero-based). 3634ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3635ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns the specified child of the AST node. 3636ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3637ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3638ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx); 3639ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3640ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3641ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief A \c CXComment_Paragraph node is considered whitespace if it contains 3642ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * only \c CXComment_Text nodes that are empty or whitespace. 3643ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3644ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are 3645ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * never considered whitespace. 3646ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3647ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns non-zero if \c Comment is whitespace. 3648ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3649ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment); 3650ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3651ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3652ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns non-zero if \c Comment is inline content and has a newline 3653ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * immediately following it in the comment text. Newlines between paragraphs 3654ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * do not count. 3655ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3656ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3657ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment); 3658ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3659ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3660ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_Text AST node. 3661ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3662ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns text contained in the AST node. 3663ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3664ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment); 3665ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3666ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3667ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_InlineCommand AST node. 3668ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3669ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns name of the inline command. 3670ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3671ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3672ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_InlineCommandComment_getCommandName(CXComment Comment); 3673ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3674ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3675ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_InlineCommand AST node. 3676ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 36772d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \returns the most appropriate rendering mode, chosen on command 36782d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * semantics in Doxygen. 36792d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko */ 36802d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri GribenkoCINDEX_LINKAGE enum CXCommentInlineCommandRenderKind 36812d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenkoclang_InlineCommandComment_getRenderKind(CXComment Comment); 36822d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko 36832d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko/** 36842d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * \param Comment a \c CXComment_InlineCommand AST node. 36852d66a5016d4aacce362f89290261c8a1a6eef0d3Dmitri Gribenko * 3686ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns number of command arguments. 3687ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3688ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3689ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_InlineCommandComment_getNumArgs(CXComment Comment); 3690ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3691ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3692ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_InlineCommand AST node. 3693ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3694ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param ArgIdx argument index (zero-based). 3695ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3696ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns text of the specified argument. 3697ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3698ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3699ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_InlineCommandComment_getArgText(CXComment Comment, 3700ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko unsigned ArgIdx); 3701ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3702ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3703ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST 3704ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * node. 3705ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3706ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns HTML tag name. 3707ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3708ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment); 3709ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3710ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3711ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag AST node. 3712ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3713ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns non-zero if tag is self-closing (for example, <br />). 3714ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3715ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3716ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); 3717ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3718ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3719ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag AST node. 3720ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3721ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns number of attributes (name-value pairs) attached to the start tag. 3722ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3723ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment); 3724ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3725ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3726ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag AST node. 3727ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3728ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param AttrIdx attribute index (zero-based). 3729ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3730ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns name of the specified attribute. 3731ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3732ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3733ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx); 3734ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3735ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3736ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag AST node. 3737ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3738ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param AttrIdx attribute index (zero-based). 3739ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3740ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns value of the specified attribute. 3741ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3742ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3743ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx); 3744ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3745ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3746ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_BlockCommand AST node. 3747ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3748ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns name of the block command. 3749ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3750ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3751ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_BlockCommandComment_getCommandName(CXComment Comment); 3752ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3753ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3754ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_BlockCommand AST node. 3755ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3756ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns number of word-like arguments. 3757ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3758ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3759ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_BlockCommandComment_getNumArgs(CXComment Comment); 3760ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3761ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3762ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_BlockCommand AST node. 3763ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3764ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param ArgIdx argument index (zero-based). 3765ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3766ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns text of the specified word-like argument. 3767ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3768ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3769ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_BlockCommandComment_getArgText(CXComment Comment, 3770ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko unsigned ArgIdx); 3771ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3772ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3773ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_BlockCommand or 3774ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \c CXComment_VerbatimBlockCommand AST node. 3775ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3776ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns paragraph argument of the block command. 3777ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3778ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3779ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXComment clang_BlockCommandComment_getParagraph(CXComment Comment); 3780ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3781ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3782ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_ParamCommand AST node. 3783ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3784ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns parameter name. 3785ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3786ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3787ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_ParamCommandComment_getParamName(CXComment Comment); 3788ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3789ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3790ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_ParamCommand AST node. 3791ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3792ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns non-zero if the parameter that this AST node represents was found 3793ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * in the function prototype and \c clang_ParamCommandComment_getParamIndex 3794ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * function will return a meaningful value. 3795ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3796ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3797ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment); 3798ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3799ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3800ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_ParamCommand AST node. 3801ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3802ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns zero-based parameter index in function prototype. 3803ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3804ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3805ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_ParamCommandComment_getParamIndex(CXComment Comment); 3806ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3807ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3808ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_ParamCommand AST node. 3809ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3810ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns non-zero if parameter passing direction was specified explicitly in 3811ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * the comment. 3812ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3813ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3814ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkounsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); 3815ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3816ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3817ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_ParamCommand AST node. 3818ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3819ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns parameter passing direction. 3820ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3821ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3822ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenkoenum CXCommentParamPassDirection clang_ParamCommandComment_getDirection( 3823ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko CXComment Comment); 3824ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3825ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 382696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \param Comment a \c CXComment_TParamCommand AST node. 382796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 382896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \returns template parameter name. 382996b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko */ 383096b098674908eaa59a9128f3305cda6fbbdad563Dmitri GribenkoCINDEX_LINKAGE 383196b098674908eaa59a9128f3305cda6fbbdad563Dmitri GribenkoCXString clang_TParamCommandComment_getParamName(CXComment Comment); 383296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko 383396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko/** 383496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \param Comment a \c CXComment_TParamCommand AST node. 383596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 383696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \returns non-zero if the parameter that this AST node represents was found 383796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * in the template parameter list and 383896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \c clang_TParamCommandComment_getDepth and 383996b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \c clang_TParamCommandComment_getIndex functions will return a meaningful 384096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * value. 384196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko */ 384296b098674908eaa59a9128f3305cda6fbbdad563Dmitri GribenkoCINDEX_LINKAGE 384396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenkounsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment); 384496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko 384596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko/** 384696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \param Comment a \c CXComment_TParamCommand AST node. 384796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 384896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \returns zero-based nesting depth of this parameter in the template parameter list. 384996b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 385096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * For example, 385196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \verbatim 385296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * template<typename C, template<typename T> class TT> 385396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * void test(TT<int> aaa); 385496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \endverbatim 385596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * for C and TT nesting depth is 0, 385696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * for T nesting depth is 1. 385796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko */ 385896b098674908eaa59a9128f3305cda6fbbdad563Dmitri GribenkoCINDEX_LINKAGE 385996b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenkounsigned clang_TParamCommandComment_getDepth(CXComment Comment); 386096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko 386196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko/** 386296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \param Comment a \c CXComment_TParamCommand AST node. 386396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 386496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \returns zero-based parameter index in the template parameter list at a 386596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * given nesting depth. 386696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 386796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * For example, 386896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \verbatim 386996b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * template<typename C, template<typename T> class TT> 387096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * void test(TT<int> aaa); 387196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \endverbatim 387296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * for C and TT nesting depth is 0, so we can ask for index at depth 0: 387396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * at depth 0 C's index is 0, TT's index is 1. 387496b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 387596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * For T nesting depth is 1, so we can ask for index at depth 0 and 1: 387696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * at depth 0 T's index is 1 (same as TT's), 387796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * at depth 1 T's index is 0. 387896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko */ 387996b098674908eaa59a9128f3305cda6fbbdad563Dmitri GribenkoCINDEX_LINKAGE 388096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenkounsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth); 388196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko 388296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko/** 3883ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_VerbatimBlockLine AST node. 3884ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3885ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns text contained in the AST node. 3886ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3887ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE 3888ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCXString clang_VerbatimBlockLineComment_getText(CXComment Comment); 3889ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3890ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3891ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_VerbatimLine AST node. 3892ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3893ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns text contained in the AST node. 3894ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3895ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment); 3896ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3897ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3898ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Convert an HTML tag AST node to string. 3899ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3900ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST 3901ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * node. 3902ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3903ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns string containing an HTML tag. 3904ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3905ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment); 3906ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3907ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3908ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \brief Convert a given full parsed comment to an HTML fragment. 3909ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3910ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * Specific details of HTML layout are subject to change. Don't try to parse 3911ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * this HTML back into an AST, use other APIs instead. 3912ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3913ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * Currently the following CSS classes are used: 3914ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \li "para-brief" for \\brief paragraph and equivalent commands; 3915ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \li "para-returns" for \\returns paragraph and equivalent commands; 3916ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \li "word-returns" for the "Returns" word in \\returns paragraph. 3917ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 39183e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * Function argument documentation is rendered as a \<dl\> list with arguments 39193e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * sorted in function prototype order. CSS classes used: 39203e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * \li "param-name-index-NUMBER" for parameter name (\<dt\>); 39213e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * \li "param-descr-index-NUMBER" for parameter description (\<dd\>); 39223e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if 39233e63d332baf0d3b8a5c0b7c2dac2ae85615b1d47Dmitri Gribenko * parameter index is invalid. 3924ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 392596b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * Template parameter documentation is rendered as a \<dl\> list with 392696b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * parameters sorted in template parameter list order. CSS classes used: 392796b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \li "tparam-name-index-NUMBER" for parameter name (\<dt\>); 392896b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \li "tparam-descr-index-NUMBER" for parameter description (\<dd\>); 39296a425525e52aba5a8e14db35d50a712be4e5e2e1Dmitri Gribenko * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for 393096b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * names inside template template parameters; 393196b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if 393296b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * parameter position is invalid. 393396b098674908eaa59a9128f3305cda6fbbdad563Dmitri Gribenko * 3934ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \param Comment a \c CXComment_FullComment AST node. 3935ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * 3936ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko * \returns string containing an HTML fragment. 3937ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko */ 3938ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri GribenkoCINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment); 3939ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko 3940ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72dDmitri Gribenko/** 3941f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * \brief Convert a given full parsed comment to an XML document. 3942f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * 3943f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * A Relax NG schema for the XML can be found in comment-xml-schema.rng file 3944f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * inside clang source tree. 3945f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * 3946f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * \param Comment a \c CXComment_FullComment AST node. 3947f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * 3948f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko * \returns string containing an XML document. 3949f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko */ 3950e4330a302ac20b41b9800267ebd4b5b01f8553f8Dmitri GribenkoCINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); 3951f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko 3952f303d4cb10648ac9c2080ae7c9dd507ba615e3a7Dmitri Gribenko/** 3953c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 3954c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 39551efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 3956c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 39579ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * \defgroup CINDEX_CPP C++ AST introspection 39589ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * 39599ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * The routines in this group provide access information in the ASTs specific 39609ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * to C++ language features. 39619ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * 39629ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * @{ 39639ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek */ 39649ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek 39659ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek/** 396649f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * \brief Determine if a C++ member function or member function template is 396749f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * declared 'static'. 39689ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek */ 39699ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed KremenekCINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); 39709ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek 39719ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek/** 3972211924b563aa31421836cee7655be729ad02733fDouglas Gregor * \brief Determine if a C++ member function or member function template is 3973211924b563aa31421836cee7655be729ad02733fDouglas Gregor * explicitly declared 'virtual' or if it overrides a virtual method from 3974211924b563aa31421836cee7655be729ad02733fDouglas Gregor * one of the base classes. 3975211924b563aa31421836cee7655be729ad02733fDouglas Gregor */ 3976211924b563aa31421836cee7655be729ad02733fDouglas GregorCINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); 3977211924b563aa31421836cee7655be729ad02733fDouglas Gregor 3978211924b563aa31421836cee7655be729ad02733fDouglas Gregor/** 397949f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * \brief Given a cursor that represents a template, determine 398049f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * the cursor kind of the specializations would be generated by instantiating 398149f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * the template. 398249f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * 398349f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * This routine can be used to determine what flavor of function template, 398449f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * class template, or class template partial specialization is stored in the 398549f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * cursor. For example, it can describe whether a class template cursor is 398649f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * declared with "struct", "class" or "union". 398749f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * 398849f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * \param C The cursor to query. This cursor should represent a template 398949f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * declaration. 399049f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * 399149f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * \returns The cursor kind of the specializations that would be generated 399249f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * by instantiating the template \p C. If \p C is not a template, returns 399349f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor * \c CXCursor_NoDeclFound. 399449f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor */ 399549f6f5489483beaffc7ce48dfc000af4e65b9216Douglas GregorCINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C); 399649f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor 399749f6f5489483beaffc7ce48dfc000af4e65b9216Douglas Gregor/** 3998e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * \brief Given a cursor that may represent a specialization or instantiation 3999e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * of a template, retrieve the cursor that represents the template that it 4000e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * specializes or from which it was instantiated. 4001e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * 4002e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * This routine determines the template involved both for explicit 4003e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * specializations of templates and for implicit instantiations of the template, 4004e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * both of which are referred to as "specializations". For a class template 4005e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * specialization (e.g., \c std::vector<bool>), this routine will return 4006e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * either the primary template (\c std::vector) or, if the specialization was 4007e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * instantiated from a class template partial specialization, the class template 4008e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * partial specialization. For a class template partial specialization and a 4009e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * function template specialization (including instantiations), this 4010e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * this routine will return the specialized template. 4011e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * 4012e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * For members of a class template (e.g., member functions, member classes, or 4013e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * static data members), returns the specialized or instantiated member. 4014e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * Although not strictly "templates" in the C++ language, members of class 4015e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * templates have the same notions of specializations and instantiations that 4016e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * templates do, so this routine treats them similarly. 4017e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * 4018e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * \param C A cursor that may be a specialization of a template or a member 4019e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * of a template. 4020e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * 4021e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * \returns If the given cursor is a specialization or instantiation of a 4022e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * template or a member thereof, the template or member that it specializes or 4023e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor * from which it was instantiated. Otherwise, returns a NULL cursor. 4024e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor */ 4025e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas GregorCINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C); 4026430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor 4027430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor/** 4028430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \brief Given a cursor that references something else, return the source range 4029430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * covering that reference. 4030430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * 4031430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \param C A cursor pointing to a member reference, a declaration reference, or 4032430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * an operator call. 4033430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \param NameFlags A bitset with three independent flags: 4034430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and 4035430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * CXNameRange_WantSinglePiece. 4036430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \param PieceIndex For contiguous names or when passing the flag 4037430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * CXNameRange_WantSinglePiece, only one piece with index 0 is 4038430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * available. When the CXNameRange_WantSinglePiece flag is not passed for a 403948d798ce32447607144db70a484cdb99c1180663Benjamin Kramer * non-contiguous names, this index can be used to retrieve the individual 4040430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * pieces of the name. See also CXNameRange_WantSinglePiece. 4041430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * 4042430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \returns The piece of the name pointed to by the given cursor. If there is no 4043430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * name, or if the PieceIndex is out-of-range, a null-cursor will be returned. 4044430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor */ 404548a8d14fc6f064a5297024c2b34733a4080b2efeFrancois PichetCINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, 404648a8d14fc6f064a5297024c2b34733a4080b2efeFrancois Pichet unsigned NameFlags, 4047430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor unsigned PieceIndex); 4048430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor 4049430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregorenum CXNameRefFlags { 4050430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor /** 4051430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \brief Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the 4052430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * range. 4053430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor */ 4054430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor CXNameRange_WantQualifier = 0x1, 4055430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor 4056430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor /** 40577eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Include the explicit template arguments, e.g. \<int> in x.f<int>, 40587eee0184570366285589d788bcd7f5dda8345915James Dennett * in the range. 4059430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor */ 4060430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor CXNameRange_WantTemplateArgs = 0x2, 4061430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor 4062430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor /** 4063430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \brief If the name is non-contiguous, return the full spanning range. 4064430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * 4065430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * Non-contiguous names occur in Objective-C when a selector with two or more 4066430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * parameters is used, or in C++ when using an operator: 4067430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \code 4068430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * [object doSomething:here withValue:there]; // ObjC 4069430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * return some_vector[1]; // C++ 4070430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor * \endcode 4071430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor */ 4072430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor CXNameRange_WantSinglePiece = 0x4 4073430d7a1a621a126a9ffe442ad8987ba02b46dae9Douglas Gregor}; 4074e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor 4075e0329acf5c9437e2086a2fb2bf7a95ae2ac96505Douglas Gregor/** 40769ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek * @} 40779ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek */ 40789ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek 40799ada39a4ac82ff5f5087b0a7fa9ed0d32be55a3bTed Kremenek/** 40800045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * \defgroup CINDEX_LEX Token extraction and manipulation 40810045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * 40820045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * The routines in this group provide access to the tokens within a 40830045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * translation unit, along with a semantic mapping of those tokens to 40840045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * their corresponding cursors. 4085fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4086fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * @{ 4087fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4088fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor 4089fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4090fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Describes a kind of token. 4091fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4092fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregortypedef enum CXTokenKind { 4093fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor /** 4094fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief A token that contains some kind of punctuation. 4095fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4096fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken_Punctuation, 4097896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4098fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor /** 40990045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * \brief A language keyword. 4100fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4101fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken_Keyword, 4102896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4103fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor /** 4104fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief An identifier (that is not a keyword). 4105fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4106fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken_Identifier, 4107896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4108fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor /** 4109fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief A numeric, string, or character literal. 4110fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4111fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken_Literal, 4112896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4113fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor /** 4114fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief A comment. 4115fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4116fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken_Comment 4117fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor} CXTokenKind; 4118fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor 4119fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4120fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Describes a single preprocessing token. 4121fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4122fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregortypedef struct { 4123fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor unsigned int_data[4]; 4124fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor void *ptr_data; 4125fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor} CXToken; 4126fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor 4127fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4128fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Determine the kind of the given token. 4129fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4130fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas GregorCINDEX_LINKAGE CXTokenKind clang_getTokenKind(CXToken); 4131896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4132fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4133fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Determine the spelling of the given token. 4134fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4135fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * The spelling of a token is the textual representation of that token, e.g., 4136fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * the text of an identifier or keyword. 4137fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4138fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas GregorCINDEX_LINKAGE CXString clang_getTokenSpelling(CXTranslationUnit, CXToken); 4139896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4140fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4141fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Retrieve the source location of the given token. 4142fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4143896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE CXSourceLocation clang_getTokenLocation(CXTranslationUnit, 4144fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken); 4145896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4146fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4147fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Retrieve a source range that covers the given token. 4148fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4149fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas GregorCINDEX_LINKAGE CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken); 4150fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor 4151fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4152fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Tokenize the source code described by the given range into raw 4153fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * lexical tokens. 4154fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4155fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param TU the translation unit whose text is being tokenized. 4156fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4157fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param Range the source range in which text should be tokenized. All of the 4158fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * tokens produced by tokenization will fall within this source range, 4159fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4160fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param Tokens this pointer will be set to point to the array of tokens 4161fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * that occur within the given source range. The returned pointer must be 4162fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * freed with clang_disposeTokens() before the translation unit is destroyed. 4163fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4164fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param NumTokens will be set to the number of tokens in the \c *Tokens 4165fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * array. 4166fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4167fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4168fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas GregorCINDEX_LINKAGE void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, 4169fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken **Tokens, unsigned *NumTokens); 4170896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4171fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4172fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Annotate the given set of tokens by providing cursors for each token 4173fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * that can be mapped to a specific entity within the abstract syntax tree. 4174fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 41750045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * This token-annotation routine is equivalent to invoking 41760045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * clang_getCursor() for the source locations of each of the 41770045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * tokens. The cursors provided are filtered, so that only those 41780045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * cursors that have a direct correspondence to the token are 41790045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * accepted. For example, given a function call \c f(x), 41800045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * clang_getCursor() would provide the following cursors: 41810045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * 41820045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. 41830045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. 41840045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'. 41850045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * 41860045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * Only the first and last of these cursors will occur within the 41870045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * annotate, since the tokens "f" and "x' directly refer to a function 41880045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * and a variable, respectively, but the parentheses are just a small 41890045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * part of the full syntax of the function call expression, which is 41900045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0Douglas Gregor * not provided as an annotation. 4191fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4192fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param TU the translation unit that owns the given tokens. 4193fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4194fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param Tokens the set of tokens to annotate. 4195fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4196fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param NumTokens the number of tokens in \p Tokens. 4197fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * 4198fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \param Cursors an array of \p NumTokens cursors, whose contents will be 4199fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * replaced with the cursors corresponding to each token. 4200fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4201fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas GregorCINDEX_LINKAGE void clang_annotateTokens(CXTranslationUnit TU, 4202fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken *Tokens, unsigned NumTokens, 4203fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXCursor *Cursors); 4204896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4205fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4206fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * \brief Free the given set of tokens. 4207fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4208896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE void clang_disposeTokens(CXTranslationUnit TU, 4209fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor CXToken *Tokens, unsigned NumTokens); 4210896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4211fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4212fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor * @} 4213fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor */ 4214896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek 4215fc8ea23eb6cbaaa5046f2abb4c033e24c8659efdDouglas Gregor/** 4216c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_DEBUG Debugging facilities 4217c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 4218c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * These routines are used for testing and debugging, only, and should not 4219c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * be relied upon. 4220c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 4221c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 4222c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 42231efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 42244ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff/* for debug/testing */ 4225e68fff6fc083c6270d835216a3de0b82c6ef0310Ted KremenekCINDEX_LINKAGE CXString clang_getCursorKindSpelling(enum CXCursorKind Kind); 42261efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel DunbarCINDEX_LINKAGE void clang_getDefinitionSpellingAndExtent(CXCursor, 42271efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar const char **startBuf, 42284ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff const char **endBuf, 42294ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff unsigned *startLine, 42304ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff unsigned *startColumn, 42314ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff unsigned *endLine, 42324ade6d6eae934f796ca43c81a5aa185e456dde9bSteve Naroff unsigned *endColumn); 42330a812cf707da15dadd19fdeb0178b9707f4e01a6Douglas GregorCINDEX_LINKAGE void clang_enableStackTraces(void); 4234995aaf9c8f0131bef0215a9a0bc794b83a49e0b7Daniel DunbarCINDEX_LINKAGE void clang_executeOnThread(void (*fn)(void*), void *user_data, 4235995aaf9c8f0131bef0215a9a0bc794b83a49e0b7Daniel Dunbar unsigned stack_size); 4236995aaf9c8f0131bef0215a9a0bc794b83a49e0b7Daniel Dunbar 42370c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 4238c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 4239c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 42401efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 4241c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 4242c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * \defgroup CINDEX_CODE_COMPLET Code completion 4243c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 4244c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * Code completion involves taking an (incomplete) source file, along with 4245c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * knowledge of where the user is actively editing that file, and suggesting 4246c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * syntactically- and semantically-valid constructs that the user might want to 4247c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * use at that particular point in the source code. These data structures and 4248c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * routines provide support for code completion. 4249c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * 4250c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @{ 4251c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 42521efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 4253c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 42540c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A semantic string that describes a code-completion result. 42550c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 42560c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * A semantic string that describes the formatting of a code-completion 42570c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * result as a single "template" of text that should be inserted into the 42580c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * source buffer when a particular code-completion result is selected. 42590c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * Each semantic string is made up of some number of "chunks", each of which 42600c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * contains some text along with a description of what that text means, e.g., 42610c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * the name of the entity being referenced, whether the text chunk is part of 42620c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * the template, or whether it is a "placeholder" that the user should replace 42630c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * with actual code,of a specific kind. See \c CXCompletionChunkKind for a 42641efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * description of the different kinds of chunks. 42650c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 42660c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregortypedef void *CXCompletionString; 42671efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 42680c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 42690c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A single result of code completion. 42700c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 42710c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregortypedef struct { 42720c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 42731efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief The kind of entity that this completion refers to. 42740c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 42751efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * The cursor kind will be a macro, keyword, or a declaration (one of the 42760c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * *Decl cursor kinds), describing the entity that the completion is 42770c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * referring to. 42780c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 42790c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \todo In the future, we would like to provide a full cursor, to allow 42800c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * the client to extract additional information from declaration. 42810c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 42820c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor enum CXCursorKind CursorKind; 42831efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 42841efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar /** 42850c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief The code-completion string that describes how to insert this 42860c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * code-completion result into the editing buffer. 42870c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 42880c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionString CompletionString; 42890c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor} CXCompletionResult; 42900c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor 42910c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 42920c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Describes a single piece of text within a code-completion string. 42930c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 42941efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * Each "chunk" within a code-completion string (\c CXCompletionString) is 42951efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * either a piece of text with a specific "kind" that describes how that text 42960c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * should be interpreted by the client or is another completion string. 42970c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 42980c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregorenum CXCompletionChunkKind { 42990c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43000c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A code-completion string that describes "optional" text that 43010c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * could be a part of the template (but is not required). 43020c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43030c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * The Optional chunk is the only kind of chunk that has a code-completion 43041efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * string for its representation, which is accessible via 43050c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \c clang_getCompletionChunkCompletionString(). The code-completion string 43060c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * describes an additional part of the template that is completely optional. 43070c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * For example, optional chunks can be used to describe the placeholders for 43080c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * arguments that match up with defaulted function parameters, e.g. given: 43090c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43100c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \code 43110c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * void f(int x, float y = 3.14, double z = 2.71828); 43120c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \endcode 43130c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43140c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * The code-completion string for this function would contain: 43150c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a TypedText chunk for "f". 43160c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a LeftParen chunk for "(". 43170c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a Placeholder chunk for "int x" 43180c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - an Optional chunk containing the remaining defaulted arguments, e.g., 43190c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a Comma chunk for "," 432071570182471d502a97f7f175aa527152544c75f2Daniel Dunbar * - a Placeholder chunk for "float y" 43210c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - an Optional chunk containing the last defaulted argument: 43220c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a Comma chunk for "," 43230c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a Placeholder chunk for "double z" 43240c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - a RightParen chunk for ")" 43250c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 432671570182471d502a97f7f175aa527152544c75f2Daniel Dunbar * There are many ways to handle Optional chunks. Two simple approaches are: 43270c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - Completely ignore optional chunks, in which case the template for the 43280c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * function "f" would only include the first parameter ("int x"). 43290c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * - Fully expand all optional chunks, in which case the template for the 43300c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * function "f" would have all of the parameters. 43310c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43320c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_Optional, 43330c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43340c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Text that a user would be expected to type to get this 43351efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * code-completion result. 43360c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43371efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * There will be exactly one "typed text" chunk in a semantic string, which 43381efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * will typically provide the spelling of a keyword or the name of a 43390c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * declaration that could be used at the current code point. Clients are 43400c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * expected to filter the code-completion results based on the text in this 43410c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * chunk. 43420c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43430c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_TypedText, 43440c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43450c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Text that should be inserted as part of a code-completion result. 43460c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43470c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * A "text" chunk represents text that is part of the template to be 43480c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * inserted into user code should this particular code-completion result 43490c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * be selected. 43500c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43510c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_Text, 43520c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43530c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Placeholder text that should be replaced by the user. 43540c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43550c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * A "placeholder" chunk marks a place where the user should insert text 43560c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * into the code-completion template. For example, placeholders might mark 43570c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * the function parameters for a function declaration, to indicate that the 43580c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * user should provide arguments for each of those parameters. The actual 43590c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * text in a placeholder is a suggestion for the text to display before 43600c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * the user replaces the placeholder with real code. 43610c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43620c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_Placeholder, 43630c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43640c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Informative text that should be displayed but never inserted as 43650c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * part of the template. 43661efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * 43670c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * An "informative" chunk contains annotations that can be displayed to 43680c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * help the user decide whether a particular code-completion result is the 43690c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * right option, but which is not part of the actual template to be inserted 43700c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * by code completion. 43710c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43720c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_Informative, 43730c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43740c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Text that describes the current parameter when code-completion is 43750c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * referring to function call, message send, or template specialization. 43760c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43770c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * A "current parameter" chunk occurs when code-completion is providing 43780c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * information about a parameter corresponding to the argument at the 43790c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * code-completion point. For example, given a function 43800c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43810c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \code 43820c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * int add(int x, int y); 43830c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \endcode 43840c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 43850c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * and the source code \c add(, where the code-completion point is after the 43860c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * "(", the code-completion string will contain a "current parameter" chunk 43870c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * for "int x", indicating that the current argument will initialize that 43880c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * parameter. After typing further, to \c add(17, (where the code-completion 43891efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * point is after the ","), the code-completion string will contain a 43900c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * "current paremeter" chunk to "int y". 43910c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43920c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_CurrentParameter, 43930c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43940c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A left parenthesis ('('), used to initiate a function call or 43950c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * signal the beginning of a function parameter list. 43960c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 43970c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_LeftParen, 43980c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 43990c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A right parenthesis (')'), used to finish a function call or 44000c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * signal the end of a function parameter list. 44010c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44020c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_RightParen, 44030c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44040c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A left bracket ('['). 44050c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44060c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_LeftBracket, 44070c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44080c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A right bracket (']'). 44090c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44100c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_RightBracket, 44110c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44120c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A left brace ('{'). 44130c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44140c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_LeftBrace, 44150c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44160c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A right brace ('}'). 44170c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44180c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_RightBrace, 44190c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44200c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A left angle bracket ('<'). 44210c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44220c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_LeftAngle, 44230c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44240c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A right angle bracket ('>'). 44250c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44260c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor CXCompletionChunk_RightAngle, 44270c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor /** 44280c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief A comma separator (','). 44290c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 4430ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor CXCompletionChunk_Comma, 4431ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor /** 44321efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Text that specifies the result type of a given result. 4433ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor * 4434ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor * This special kind of informative chunk is not meant to be inserted into 44351efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * the text buffer. Rather, it is meant to illustrate the type that an 4436ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor * expression using the given completion string would have. 4437ff5ce6eefc7c253ef6edf4d4bfc996fdd82d09aaDouglas Gregor */ 443801dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_ResultType, 443901dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor /** 444001dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * \brief A colon (':'). 444101dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor */ 444201dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_Colon, 444301dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor /** 444401dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * \brief A semicolon (';'). 444501dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor */ 444601dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_SemiColon, 444701dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor /** 444801dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * \brief An '=' sign. 444901dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor */ 445001dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_Equal, 445101dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor /** 445201dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * Horizontal space (' '). 445301dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor */ 445401dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_HorizontalSpace, 445501dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor /** 445601dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * Vertical space ('\n'), after which it is generally a good idea to 445701dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor * perform indentation. 445801dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor */ 445901dfea02d1da297e8b53db8eea3d3cc652acda8dDouglas Gregor CXCompletionChunk_VerticalSpace 44600c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor}; 44611efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 44620c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 44630c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Determine the kind of a particular chunk within a completion string. 44640c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44650c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param completion_string the completion string to query. 44660c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44670c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param chunk_number the 0-based index of the chunk in the completion string. 44680c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44690c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \returns the kind of the chunk at the index \c chunk_number. 44700c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44711efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel DunbarCINDEX_LINKAGE enum CXCompletionChunkKind 44720c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregorclang_getCompletionChunkKind(CXCompletionString completion_string, 44730c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor unsigned chunk_number); 44741efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 44750c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 44761efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Retrieve the text associated with a particular chunk within a 44770c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * completion string. 44780c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44790c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param completion_string the completion string to query. 44800c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44810c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param chunk_number the 0-based index of the chunk in the completion string. 44820c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44830c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \returns the text associated with the chunk at index \c chunk_number. 44840c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 44852ef6f8f5a35a60870594c5b04e0aa2bf22c6886fTed KremenekCINDEX_LINKAGE CXString 44860c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregorclang_getCompletionChunkText(CXCompletionString completion_string, 44870c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor unsigned chunk_number); 44880c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor 44890c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 44901efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar * \brief Retrieve the completion string associated with a particular chunk 44910c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * within a completion string. 44920c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44930c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param completion_string the completion string to query. 44940c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44950c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \param chunk_number the 0-based index of the chunk in the completion string. 44960c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * 44970c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \returns the completion string associated with the chunk at index 44986164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \c chunk_number. 44990c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 45000c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas GregorCINDEX_LINKAGE CXCompletionString 45010c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregorclang_getCompletionChunkCompletionString(CXCompletionString completion_string, 45020c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor unsigned chunk_number); 45031efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 45040c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 45050c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor * \brief Retrieve the number of chunks in the given code-completion string. 45060c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 45070c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas GregorCINDEX_LINKAGE unsigned 45080c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregorclang_getNumCompletionChunks(CXCompletionString completion_string); 45090c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor 45100c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor/** 451112e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * \brief Determine the priority of this code completion. 451212e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * 451312e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * The priority of a code completion indicates how likely it is that this 451412e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * particular completion is the completion that the user will select. The 451512e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * priority is selected by various internal heuristics. 451612e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * 451712e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * \param completion_string The completion string to query. 451812e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * 451912e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * \returns The priority of this completion string. Smaller values indicate 452012e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor * higher-priority (more likely) completions. 452112e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor */ 452212e131385e892e3723483a1081a89bcad29c8a84Douglas GregorCINDEX_LINKAGE unsigned 452312e131385e892e3723483a1081a89bcad29c8a84Douglas Gregorclang_getCompletionPriority(CXCompletionString completion_string); 452412e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor 452512e131385e892e3723483a1081a89bcad29c8a84Douglas Gregor/** 452658ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * \brief Determine the availability of the entity that this code-completion 452758ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * string refers to. 452858ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * 452958ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * \param completion_string The completion string to query. 453058ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * 453158ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor * \returns The availability of the completion string. 453258ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor */ 453358ddb60f409125eda5436c4a1f070f7fa4744295Douglas GregorCINDEX_LINKAGE enum CXAvailabilityKind 453458ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregorclang_getCompletionAvailability(CXCompletionString completion_string); 453558ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor 453658ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor/** 45376164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \brief Retrieve the number of annotations associated with the given 45386164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * completion string. 45396164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * 45406164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \param completion_string the completion string to query. 45416164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * 45426164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \returns the number of annotations associated with the given completion 45436164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * string. 45446164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen */ 45456164ea1d75385b6fc3c19e5ab9bb686298436a5aErik VerbruggenCINDEX_LINKAGE unsigned 45466164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggenclang_getCompletionNumAnnotations(CXCompletionString completion_string); 45476164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen 45486164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen/** 45496164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \brief Retrieve the annotation associated with the given completion string. 45506164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * 45516164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \param completion_string the completion string to query. 45526164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * 45536164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \param annotation_number the 0-based index of the annotation of the 45546164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * completion string. 45556164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * 45566164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \returns annotation string associated with the completion at index 45576164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen * \c annotation_number, or a NULL string if that annotation is not available. 45586164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen */ 45596164ea1d75385b6fc3c19e5ab9bb686298436a5aErik VerbruggenCINDEX_LINKAGE CXString 45606164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggenclang_getCompletionAnnotation(CXCompletionString completion_string, 45616164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen unsigned annotation_number); 45626164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen 45636164ea1d75385b6fc3c19e5ab9bb686298436a5aErik Verbruggen/** 4564ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * \brief Retrieve the parent context of the given completion string. 4565ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * 4566ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * The parent context of a completion string is the semantic parent of 4567ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * the declaration (if any) that the code completion represents. For example, 4568ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * a code completion for an Objective-C method would have the method's class 4569ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * or protocol as its context. 4570ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * 4571ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * \param completion_string The code completion string whose parent is 4572ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * being queried. 4573ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * 4574526d24444c91404dc4165b141e5ec095125c1bc8Argyrios Kyrtzidis * \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL. 4575ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * 45767eee0184570366285589d788bcd7f5dda8345915James Dennett * \returns The name of the completion parent, e.g., "NSObject" if 4577ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor * the completion string represents a method in the NSObject class. 4578ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor */ 4579ba1030698dbc276db86b11c5329a1edee8a1805eDouglas GregorCINDEX_LINKAGE CXString 4580ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregorclang_getCompletionParent(CXCompletionString completion_string, 4581ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor enum CXCursorKind *kind); 4582d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko 4583d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko/** 4584d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * \brief Retrieve the brief documentation comment attached to the declaration 4585d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * that corresponds to the given completion string. 4586d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko */ 4587d99ef536b241071b6f4c01db6525dc03242ac30bDmitri GribenkoCINDEX_LINKAGE CXString 4588d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenkoclang_getCompletionBriefComment(CXCompletionString completion_string); 4589d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko 4590ba1030698dbc276db86b11c5329a1edee8a1805eDouglas Gregor/** 45918fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * \brief Retrieve a completion string for an arbitrary declaration or macro 45928fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * definition cursor. 45938fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * 45948fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * \param cursor The cursor to query. 45958fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * 45968fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * \returns A non-context-sensitive completion string for declaration and macro 45978fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor * definition cursors, or NULL for other kinds of cursors. 45988fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor */ 45998fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas GregorCINDEX_LINKAGE CXCompletionString 46008fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregorclang_getCursorCompletionString(CXCursor cursor); 46018fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor 46028fa0a80b4482ad94e82c4a19e23de17fd69140b5Douglas Gregor/** 4603ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \brief Contains the results of code-completion. 4604ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * 4605ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * This data structure contains the results of code completion, as 4606e0cc52ef8afc8d1cba9c534191b5f0ddaff1d694Douglas Gregor * produced by \c clang_codeCompleteAt(). Its contents must be freed by 4607ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \c clang_disposeCodeCompleteResults. 4608ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor */ 4609ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregortypedef struct { 4610ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor /** 4611ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \brief The code-completion results. 4612ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor */ 4613ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor CXCompletionResult *Results; 4614ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor 4615ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor /** 4616ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \brief The number of code-completion results stored in the 4617ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \c Results array. 4618ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor */ 4619ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor unsigned NumResults; 4620ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor} CXCodeCompleteResults; 4621ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor 4622ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor/** 4623cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \brief Flags that can be passed to \c clang_codeCompleteAt() to 4624cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * modify its behavior. 4625cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * 4626cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * The enumerators in this enumeration can be bitwise-OR'd together to 4627cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * provide multiple options to \c clang_codeCompleteAt(). 4628cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor */ 4629cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregorenum CXCodeComplete_Flags { 4630cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor /** 4631cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \brief Whether to include macros within the set of code 4632cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * completions returned. 4633cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor */ 4634cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor CXCodeComplete_IncludeMacros = 0x01, 4635cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor 4636cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor /** 4637cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \brief Whether to include code patterns for language constructs 4638cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * within the set of code completions, e.g., for loops. 4639cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor */ 4640d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko CXCodeComplete_IncludeCodePatterns = 0x02, 4641d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko 4642d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko /** 4643d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * \brief Whether to include brief documentation within the set of code 4644d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko * completions returned. 4645d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko */ 4646d99ef536b241071b6f4c01db6525dc03242ac30bDmitri Gribenko CXCodeComplete_IncludeBriefComments = 0x04 4647cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor}; 4648cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor 4649cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor/** 46503da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Bits that represent the context under which completion is occurring. 46513da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * 46523da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * The enumerators in this enumeration may be bitwise-OR'd together if multiple 46533da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * contexts are occurring simultaneously. 46543da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46553da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregorenum CXCompletionContext { 46563da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46573da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief The context for completions is unexposed, as only Clang results 46583da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * should be included. (This is equivalent to having no context bits set.) 46593da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46603da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_Unexposed = 0, 46613da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 46623da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46633da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for any possible type should be included in the results. 46643da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46653da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_AnyType = 1 << 0, 46663da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 46673da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46683da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for any possible value (variables, function calls, etc.) 46693da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * should be included in the results. 46703da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46713da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_AnyValue = 1 << 1, 46723da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46733da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for values that resolve to an Objective-C object should 46743da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * be included in the results. 46753da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46763da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCObjectValue = 1 << 2, 46773da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46783da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for values that resolve to an Objective-C selector 46793da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * should be included in the results. 46803da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46813da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCSelectorValue = 1 << 3, 46823da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46833da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for values that resolve to a C++ class type should be 46843da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * included in the results. 46853da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46863da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_CXXClassTypeValue = 1 << 4, 46873da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 46883da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46893da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for fields of the member being accessed using the dot 46903da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * operator should be included in the results. 46913da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46923da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_DotMemberAccess = 1 << 5, 46933da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46943da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for fields of the member being accessed using the arrow 46953da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * operator should be included in the results. 46963da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 46973da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ArrowMemberAccess = 1 << 6, 46983da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 46993da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for properties of the Objective-C object being accessed 47003da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * using the dot operator should be included in the results. 47013da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47023da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCPropertyAccess = 1 << 7, 47033da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47043da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47053da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for enum tags should be included in the results. 47063da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47073da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_EnumTag = 1 << 8, 47083da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47093da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for union tags should be included in the results. 47103da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47113da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_UnionTag = 1 << 9, 47123da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47133da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for struct tags should be included in the results. 47143da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47153da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_StructTag = 1 << 10, 47163da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47173da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47183da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for C++ class names should be included in the results. 47193da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47203da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ClassTag = 1 << 11, 47213da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47223da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for C++ namespaces and namespace aliases should be 47233da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * included in the results. 47243da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47253da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_Namespace = 1 << 12, 47263da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47273da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for C++ nested name specifiers should be included in 47283da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47293da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47303da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_NestedNameSpecifier = 1 << 13, 47313da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47323da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47333da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C interfaces (classes) should be included 47343da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * in the results. 47353da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47363da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCInterface = 1 << 14, 47373da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47383da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C protocols should be included in 47393da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47403da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47413da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCProtocol = 1 << 15, 47423da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47433da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C categories should be included in 47443da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47453da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47463da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCCategory = 1 << 16, 47473da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47483da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C instance messages should be included 47493da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * in the results. 47503da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47513da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCInstanceMessage = 1 << 17, 47523da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47533da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C class messages should be included in 47543da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47553da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47563da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCClassMessage = 1 << 18, 47573da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47583da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for Objective-C selector names should be included in 47593da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47603da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47613da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_ObjCSelectorName = 1 << 19, 47623da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47633da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47643da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Completions for preprocessor macro names should be included in 47653da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the results. 47663da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47673da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_MacroName = 1 << 20, 47683da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47693da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47703da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Natural language completions should be included in the results. 47713da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47723da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_NaturalLanguage = 1 << 21, 47733da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47743da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor /** 47753da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief The current context is unknown, so set all contexts. 47763da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 47773da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCompletionContext_Unknown = ((1 << 22) - 1) 47783da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor}; 47793da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 47803da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor/** 4781cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \brief Returns a default set of code-completion options that can be 4782cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * passed to\c clang_codeCompleteAt(). 4783cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor */ 4784cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas GregorCINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void); 4785cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor 4786cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor/** 47871abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \brief Perform code completion at a given location in a translation unit. 47881abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 47891abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * This function performs code completion at a particular file, line, and 47901abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * column within source code, providing results that suggest potential 47911abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * code snippets based on the context of the completion. The basic model 47921abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * for code completion is that Clang will parse a complete source file, 47931abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * performing syntax checking up to the location where code-completion has 47941abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * been requested. At that point, a special code-completion token is passed 47951abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * to the parser, which recognizes this token and determines, based on the 47961abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * current location in the C/Objective-C/C++ grammar and the state of 47971abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * semantic analysis, what completions to provide. These completions are 47981abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * returned via a new \c CXCodeCompleteResults structure. 47991abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48001abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * Code completion itself is meant to be triggered by the client when the 48011abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * user types punctuation characters or whitespace, at which point the 48021abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * code-completion location will coincide with the cursor. For example, if \c p 48031abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * is a pointer, code-completion might be triggered after the "-" and then 48041abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * after the ">" in \c p->. When the code-completion location is afer the ">", 48051abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * the completion results will provide, e.g., the members of the struct that 48061abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * "p" points to. The client is responsible for placing the cursor at the 48071abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * beginning of the token currently being typed, then filtering the results 48081abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * based on the contents of the token. For example, when code-completing for 48091abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * the expression \c p->get, the client should provide the location just after 48101abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the 48111abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * client can filter the results based on the current token text ("get"), only 48121abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * showing those results that start with "get". The intent of this interface 48131abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * is to separate the relatively high-latency acquisition of code-completion 48141abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * results from the filtering of results on a per-character basis, which must 48151abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * have a lower latency. 48161abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48171abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param TU The translation unit in which code-completion should 48181abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * occur. The source files for this translation unit need not be 48191abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * completely up-to-date (and the contents of those source files may 48201abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * be overridden via \p unsaved_files). Cursors referring into the 48211abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * translation unit may be invalidated by this invocation. 48221abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48231abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param complete_filename The name of the source file where code 48241abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * completion should be performed. This filename may be any file 48251abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * included in the translation unit. 48261abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48271abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param complete_line The line at which code-completion should occur. 48281abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48291abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param complete_column The column at which code-completion should occur. 48301abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * Note that the column should point just after the syntactic construct that 48311abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * initiated code completion, and not in the middle of a lexical token. 48321abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48331abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param unsaved_files the Tiles that have not yet been saved to disk 48341abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * but may be required for parsing or code completion, including the 48351abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * contents of those files. The contents and name of these files (as 48361abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * specified by CXUnsavedFile) are copied when necessary, so the 48371abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * client only needs to guarantee their validity until the call to 48381abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * this function returns. 48391abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 48401abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \param num_unsaved_files The number of unsaved file entries in \p 48411abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * unsaved_files. 48421abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * 4843cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \param options Extra options that control the behavior of code 4844cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * completion, expressed as a bitwise OR of the enumerators of the 4845cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * CXCodeComplete_Flags enumeration. The 4846cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * \c clang_defaultCodeCompleteOptions() function returns a default set 4847cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * of code-completion options. 4848cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor * 48491abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * \returns If successful, a new \c CXCodeCompleteResults structure 48501abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * containing code-completion results, which should eventually be 48511abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * freed with \c clang_disposeCodeCompleteResults(). If code 48521abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor * completion fails, returns NULL. 48531abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor */ 48541abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas GregorCINDEX_LINKAGE 48551abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas GregorCXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, 48561abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor const char *complete_filename, 48571abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor unsigned complete_line, 48581abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor unsigned complete_column, 48591abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor struct CXUnsavedFile *unsaved_files, 4860cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor unsigned num_unsaved_files, 4861cee235cdf0b8047761ffac598c4c3a32ab7411a2Douglas Gregor unsigned options); 48621abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor 48631abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor/** 48641e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor * \brief Sort the code-completion results in case-insensitive alphabetical 48651e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor * order. 48661e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor * 48671e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor * \param Results The set of results to sort. 48681e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor * \param NumResults The number of results in \p Results. 48691e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor */ 48701e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas GregorCINDEX_LINKAGE 48711e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregorvoid clang_sortCodeCompletionResults(CXCompletionResult *Results, 48721e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor unsigned NumResults); 48731e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor 48741e5e6684b0f27701e6f7c65f8c6a32a10cbcc3edDouglas Gregor/** 4875ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregor * \brief Free the given set of code-completion results. 48760c8296dfb495f41d6f0de6fe1d03014ffd063674Douglas Gregor */ 48771efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel DunbarCINDEX_LINKAGE 4878ec6762c709726bf2ee5f76c21df81e71a56e6f81Douglas Gregorvoid clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results); 487958ddb60f409125eda5436c4a1f070f7fa4744295Douglas Gregor 488020d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor/** 4881a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \brief Determine the number of diagnostics produced prior to the 4882a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * location where code completion was performed. 4883a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor */ 4884896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE 4885a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregorunsigned clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *Results); 4886a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor 4887a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor/** 4888a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \brief Retrieve a diagnostic associated with the given code completion. 4889a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * 48907eee0184570366285589d788bcd7f5dda8345915James Dennett * \param Results the code completion results to query. 4891a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \param Index the zero-based diagnostic number to retrieve. 4892a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * 4893a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * \returns the requested diagnostic. This diagnostic must be freed 4894a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * via a call to \c clang_disposeDiagnostic(). 4895a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor */ 4896896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted KremenekCINDEX_LINKAGE 4897a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas GregorCXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results, 4898a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor unsigned Index); 4899a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor 4900a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor/** 49013da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \brief Determines what compeltions are appropriate for the context 49023da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * the given code completion. 49033da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * 49043da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \param Results the code completion results to query 49053da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * 49063da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * \returns the kinds of completions that are appropriate for use 49073da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor * along with the given code completion results. 49083da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor */ 49093da626b4f38eb0350de960d71271ca77af7a9cc8Douglas GregorCINDEX_LINKAGE 49103da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregorunsigned long long clang_codeCompleteGetContexts( 49113da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor CXCodeCompleteResults *Results); 4912e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor 4913e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor/** 4914e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \brief Returns the cursor kind for the container for the current code 4915e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * completion context. The container is only guaranteed to be set for 4916e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * contexts where a container exists (i.e. member accesses or Objective-C 4917e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * message sends); if there is not a container, this function will return 4918e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * CXCursor_InvalidCode. 4919e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * 4920e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \param Results the code completion results to query 4921e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * 4922e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \param IsIncomplete on return, this value will be false if Clang has complete 4923e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * information about the container. If Clang does not have complete 4924e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * information, this value will be true. 4925e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * 4926e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \returns the container kind, or CXCursor_InvalidCode if there is not a 4927e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * container 4928e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor */ 4929e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas GregorCINDEX_LINKAGE 4930e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregorenum CXCursorKind clang_codeCompleteGetContainerKind( 4931e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor CXCodeCompleteResults *Results, 4932e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor unsigned *IsIncomplete); 4933e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor 4934e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor/** 4935e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \brief Returns the USR for the container for the current code completion 4936e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * context. If there is not a container for the current context, this 4937e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * function will return the empty string. 4938e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * 4939e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \param Results the code completion results to query 4940e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * 4941e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor * \returns the USR for the container 4942e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas Gregor */ 4943e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas GregorCINDEX_LINKAGE 4944e081a61bb0dc546fd623bf259435d17c9a4ea0d5Douglas GregorCXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results); 49453da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor 49460a47d69af8bda945352997af3da4687a3356096aDouglas Gregor 49470a47d69af8bda945352997af3da4687a3356096aDouglas Gregor/** 49480a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * \brief Returns the currently-entered selector for an Objective-C message 49490a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * send, formatted like "initWithFoo:bar:". Only guaranteed to return a 49500a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * non-empty string for CXCompletionContext_ObjCInstanceMessage and 49510a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * CXCompletionContext_ObjCClassMessage. 49520a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * 49530a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * \param Results the code completion results to query 49540a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * 49550a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * \returns the selector (or partial selector) that has been entered thus far 49560a47d69af8bda945352997af3da4687a3356096aDouglas Gregor * for an Objective-C message send. 49570a47d69af8bda945352997af3da4687a3356096aDouglas Gregor */ 49580a47d69af8bda945352997af3da4687a3356096aDouglas GregorCINDEX_LINKAGE 49590a47d69af8bda945352997af3da4687a3356096aDouglas GregorCXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results); 49600a47d69af8bda945352997af3da4687a3356096aDouglas Gregor 49613da626b4f38eb0350de960d71271ca77af7a9cc8Douglas Gregor/** 496220d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor * @} 496320d416c36b46dd19ee0b1ea2d0266ae43be86e51Douglas Gregor */ 49641efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 49651efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 496604bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek/** 496704bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek * \defgroup CINDEX_MISC Miscellaneous utility functions 496804bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek * 496904bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek * @{ 497004bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek */ 497123e1ad09bb68f929212e0ff51206258d06e7f6cfTed Kremenek 497223e1ad09bb68f929212e0ff51206258d06e7f6cfTed Kremenek/** 497323e1ad09bb68f929212e0ff51206258d06e7f6cfTed Kremenek * \brief Return a version string, suitable for showing to a user, but not 497423e1ad09bb68f929212e0ff51206258d06e7f6cfTed Kremenek * intended to be parsed (the format is not guaranteed to be stable). 497523e1ad09bb68f929212e0ff51206258d06e7f6cfTed Kremenek */ 4976f9c21665faa7e4936d484396469ee7afc46e1f00NAKAMURA TakumiCINDEX_LINKAGE CXString clang_getClangVersion(void); 497704bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek 4978d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek 4979d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek/** 4980d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek * \brief Enable/disable crash recovery. 4981d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek * 49827eee0184570366285589d788bcd7f5dda8345915James Dennett * \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero 49837eee0184570366285589d788bcd7f5dda8345915James Dennett * value enables crash recovery, while 0 disables it. 4984d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek */ 4985d2427ddf00aacdc288c386f3882e0821ca9bd27bTed KremenekCINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled); 4986d2427ddf00aacdc288c386f3882e0821ca9bd27bTed Kremenek 498716b55a71695a33c094383295cc7b7a2080e098daTed Kremenek /** 4988896b70ffc348f6e2c680b5fb5841984d5785b7b5Ted Kremenek * \brief Visitor invoked for each file in a translation unit 498916b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * (used with clang_getInclusions()). 499016b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * 499116b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * This visitor function will be invoked by clang_getInclusions() for each 49927eee0184570366285589d788bcd7f5dda8345915James Dennett * file included (either at the top-level or by \#include directives) within 499316b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * a translation unit. The first argument is the file being included, and 499416b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * the second and third arguments provide the inclusion stack. The 499516b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * array is sorted in order of immediate inclusion. For example, 499616b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * the first element refers to the location that included 'included_file'. 499716b55a71695a33c094383295cc7b7a2080e098daTed Kremenek */ 499816b55a71695a33c094383295cc7b7a2080e098daTed Kremenektypedef void (*CXInclusionVisitor)(CXFile included_file, 499916b55a71695a33c094383295cc7b7a2080e098daTed Kremenek CXSourceLocation* inclusion_stack, 500016b55a71695a33c094383295cc7b7a2080e098daTed Kremenek unsigned include_len, 500116b55a71695a33c094383295cc7b7a2080e098daTed Kremenek CXClientData client_data); 500216b55a71695a33c094383295cc7b7a2080e098daTed Kremenek 500316b55a71695a33c094383295cc7b7a2080e098daTed Kremenek/** 500416b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * \brief Visit the set of preprocessor inclusions in a translation unit. 500516b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * The visitor function is called with the provided data for every included 500616b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * file. This does not include headers included by the PCH file (unless one 500716b55a71695a33c094383295cc7b7a2080e098daTed Kremenek * is inspecting the inclusions in the PCH file itself). 500816b55a71695a33c094383295cc7b7a2080e098daTed Kremenek */ 500916b55a71695a33c094383295cc7b7a2080e098daTed KremenekCINDEX_LINKAGE void clang_getInclusions(CXTranslationUnit tu, 501016b55a71695a33c094383295cc7b7a2080e098daTed Kremenek CXInclusionVisitor visitor, 501116b55a71695a33c094383295cc7b7a2080e098daTed Kremenek CXClientData client_data); 501216b55a71695a33c094383295cc7b7a2080e098daTed Kremenek 501316b55a71695a33c094383295cc7b7a2080e098daTed Kremenek/** 501404bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek * @} 501504bb716aea8fd2372ac10b0c640cabc5e5caa615Ted Kremenek */ 50161efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 501797c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** \defgroup CINDEX_REMAPPING Remapping functions 501897c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * 501997c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * @{ 502097c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 502197c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 502297c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 502397c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \brief A remapping of original source files and their translated files. 502497c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 502597c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidistypedef void *CXRemapping; 502697c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 502797c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 502897c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \brief Retrieve a remapping. 502997c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * 503097c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \param path the path that contains metadata about remappings. 503197c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * 503297c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \returns the requested remapping. This remapping must be freed 503397c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. 503497c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 503597c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios KyrtzidisCINDEX_LINKAGE CXRemapping clang_getRemappings(const char *path); 503697c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 503797c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 503830660a898545416f0fea2d717f16f75640001e38Ted Kremenek * \brief Retrieve a remapping. 503930660a898545416f0fea2d717f16f75640001e38Ted Kremenek * 504030660a898545416f0fea2d717f16f75640001e38Ted Kremenek * \param filePaths pointer to an array of file paths containing remapping info. 504130660a898545416f0fea2d717f16f75640001e38Ted Kremenek * 504230660a898545416f0fea2d717f16f75640001e38Ted Kremenek * \param numFiles number of file paths. 504330660a898545416f0fea2d717f16f75640001e38Ted Kremenek * 504430660a898545416f0fea2d717f16f75640001e38Ted Kremenek * \returns the requested remapping. This remapping must be freed 504530660a898545416f0fea2d717f16f75640001e38Ted Kremenek * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. 504630660a898545416f0fea2d717f16f75640001e38Ted Kremenek */ 504730660a898545416f0fea2d717f16f75640001e38Ted KremenekCINDEX_LINKAGE 504830660a898545416f0fea2d717f16f75640001e38Ted KremenekCXRemapping clang_getRemappingsFromFileList(const char **filePaths, 504930660a898545416f0fea2d717f16f75640001e38Ted Kremenek unsigned numFiles); 505030660a898545416f0fea2d717f16f75640001e38Ted Kremenek 505130660a898545416f0fea2d717f16f75640001e38Ted Kremenek/** 505297c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \brief Determine the number of remappings. 505397c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 505497c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios KyrtzidisCINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping); 505597c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 505697c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 505797c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \brief Get the original and the associated filename from the remapping. 505897c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * 505997c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \param original If non-NULL, will be set to the original filename. 506097c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * 506197c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \param transformed If non-NULL, will be set to the filename that the original 506297c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * is associated with. 506397c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 506497c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios KyrtzidisCINDEX_LINKAGE void clang_remap_getFilenames(CXRemapping, unsigned index, 506597c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis CXString *original, CXString *transformed); 506697c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 506797c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 506897c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * \brief Dispose the remapping. 506997c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 507097c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios KyrtzidisCINDEX_LINKAGE void clang_remap_dispose(CXRemapping); 507197c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 507297c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis/** 507397c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis * @} 507497c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis */ 507597c337c2bdf3ec53073c7e7dd656aa0dd37ee409Argyrios Kyrtzidis 5076aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis/** \defgroup CINDEX_HIGH Higher level API functions 5077aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * 5078aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * @{ 5079aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis */ 5080aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5081aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidisenum CXVisitorResult { 5082aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis CXVisit_Break, 5083aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis CXVisit_Continue 5084aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis}; 5085aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5086aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidistypedef struct { 5087aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis void *context; 5088aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange); 5089aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis} CXCursorAndRangeVisitor; 5090aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 50916f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidistypedef enum { 50926f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis /** 50936f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * \brief Function returned successfully. 50946f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis */ 50956f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXResult_Success = 0, 50966f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis /** 50976f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * \brief One of the parameters was invalid for the function. 50986f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis */ 50996f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXResult_Invalid = 1, 51006f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis /** 51016f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * \brief The function was terminated by a callback (e.g. it returned 51026f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * CXVisit_Break) 51036f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis */ 51046f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXResult_VisitBreak = 2 51056f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis 51066f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis} CXResult; 51076f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis 5108aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis/** 5109aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * \brief Find references of a declaration in a specific file. 5110aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * 5111aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * \param cursor pointing to a declaration or a reference of one. 5112aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * 5113aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * \param file to search for references. 5114aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * 5115aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for 5116aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * each reference found. 5117aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * The CXSourceRange will point inside the file; if the reference is inside 5118aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * a macro (and not a macro argument) the CXSourceRange will be invalid. 5119389dc5603fa10b508a38f668a7830c6d877b6542Argyrios Kyrtzidis * 51206f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * \returns one of the CXResult enumerators. 5121aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis */ 51226f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios KyrtzidisCINDEX_LINKAGE CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file, 51236f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXCursorAndRangeVisitor visitor); 5124aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5125ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis/** 5126ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * \brief Find #import/#include directives in a specific file. 5127ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * 5128ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * \param TU translation unit containing the file to query. 5129ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * 5130ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * \param file to search for #import/#include directives. 5131ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * 5132ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for 5133ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis * each directive found. 5134389dc5603fa10b508a38f668a7830c6d877b6542Argyrios Kyrtzidis * 51356f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis * \returns one of the CXResult enumerators. 5136ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis */ 51376f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios KyrtzidisCINDEX_LINKAGE CXResult clang_findIncludesInFile(CXTranslationUnit TU, 51386f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXFile file, 51396f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXCursorAndRangeVisitor visitor); 5140ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis 5141aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis#ifdef __has_feature 5142aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis# if __has_feature(blocks) 5143aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5144aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidistypedef enum CXVisitorResult 5145aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis (^CXCursorAndRangeVisitorBlock)(CXCursor, CXSourceRange); 5146aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5147aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios KyrtzidisCINDEX_LINKAGE 51486f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios KyrtzidisCXResult clang_findReferencesInFileWithBlock(CXCursor, CXFile, 51496f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXCursorAndRangeVisitorBlock); 5150aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5151ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios KyrtzidisCINDEX_LINKAGE 51526f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios KyrtzidisCXResult clang_findIncludesInFileWithBlock(CXTranslationUnit, CXFile, 51536f09c3d69f6272b101ff795562dffead1c0bd9deArgyrios Kyrtzidis CXCursorAndRangeVisitorBlock); 5154ee2d5fd7a3bd42bce387db094d27a479617c3e67Argyrios Kyrtzidis 5155aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis# endif 5156aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis#endif 5157aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5158bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 5159bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief The client's data object that is associated with a CXFile. 5160bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5161dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidistypedef void *CXIdxClientFile; 5162bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis 5163bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 51642957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief The client's data object that is associated with a semantic entity. 51652957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 51662957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidistypedef void *CXIdxClientEntity; 51672957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 51682957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 5169bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief The client's data object that is associated with a semantic container 5170bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * of entities. 5171bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5172dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidistypedef void *CXIdxClientContainer; 5173bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis 5174bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 5175bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief The client's data object that is associated with an AST file (PCH 5176bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * or module). 5177bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5178dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidistypedef void *CXIdxClientASTFile; 51794e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5180bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 5181dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis * \brief Source location passed to index callbacks. 5182bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 51834e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 51844e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis void *ptr_data[2]; 51854e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned int_data; 51864e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} CXIdxLoc; 51874e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5188bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 51897eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Data for ppIncludedFile callback. 5190bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 51914e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 5192bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 51937eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Location of '#' in the \#include/\#import directive. 5194bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 51954e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXIdxLoc hashLoc; 5196bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 51977eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Filename as written in the \#include/\#import directive. 5198bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 51994e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis const char *filename; 5200bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 52017eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief The actual file that the \#include/\#import directive resolved to. 5202bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5203dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXFile file; 52044e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis int isImport; 52054e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis int isAngled; 52068d7a24e94b58676e57fd3f47353cbdbc59917d81Argyrios Kyrtzidis /** 52078d7a24e94b58676e57fd3f47353cbdbc59917d81Argyrios Kyrtzidis * \brief Non-zero if the directive was automatically turned into a module 52088d7a24e94b58676e57fd3f47353cbdbc59917d81Argyrios Kyrtzidis * import. 52098d7a24e94b58676e57fd3f47353cbdbc59917d81Argyrios Kyrtzidis */ 52108d7a24e94b58676e57fd3f47353cbdbc59917d81Argyrios Kyrtzidis int isModuleImport; 52114e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} CXIdxIncludedFileInfo; 52124e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5213bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 52147eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Data for IndexerCallbacks#importedASTFile. 5215bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 52164e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 52172c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis /** 52182c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis * \brief Top level AST file containing the imported PCH, module or submodule. 52192c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis */ 52204e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXFile file; 5221bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5222134d1e8a0b463d929ffeac5eefeae761707bf5d3Argyrios Kyrtzidis * \brief The imported module or NULL if the AST file is a PCH. 5223bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5224134d1e8a0b463d929ffeac5eefeae761707bf5d3Argyrios Kyrtzidis CXModule module; 5225bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5226134d1e8a0b463d929ffeac5eefeae761707bf5d3Argyrios Kyrtzidis * \brief Location where the file is imported. Applicable only for modules. 5227bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5228134d1e8a0b463d929ffeac5eefeae761707bf5d3Argyrios Kyrtzidis CXIdxLoc loc; 52292c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis /** 52302c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis * \brief Non-zero if an inclusion directive was automatically turned into 5231134d1e8a0b463d929ffeac5eefeae761707bf5d3Argyrios Kyrtzidis * a module import. Applicable only for modules. 52322c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis */ 523337f2f52fbc16b0d426d4d86c7e1662e5c6b9e3b8Argyrios Kyrtzidis int isImplicit; 52342c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis 52354e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} CXIdxImportedASTFileInfo; 52364e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5237dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidistypedef enum { 5238dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_Unexposed = 0, 5239dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_Typedef = 1, 5240dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_Function = 2, 5241dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_Variable = 3, 5242dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_Field = 4, 5243dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_EnumConstant = 5, 52444e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5245dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_ObjCClass = 6, 5246dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_ObjCProtocol = 7, 5247dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxEntity_ObjCCategory = 8, 52484e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5249c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_ObjCInstanceMethod = 9, 5250c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_ObjCClassMethod = 10, 5251c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_ObjCProperty = 11, 5252c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_ObjCIvar = 12, 52534e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5254c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_Enum = 13, 5255c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_Struct = 14, 5256c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis CXIdxEntity_Union = 15, 52572957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 52582957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXClass = 16, 52592957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXNamespace = 17, 52602957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXNamespaceAlias = 18, 52612957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXStaticVariable = 19, 52622957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXStaticMethod = 20, 52632957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_CXXInstanceMethod = 21, 526417d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos CXIdxEntity_CXXConstructor = 22, 526517d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos CXIdxEntity_CXXDestructor = 23, 526617d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos CXIdxEntity_CXXConversionFunction = 24, 526717d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos CXIdxEntity_CXXTypeAlias = 25, 526817d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos CXIdxEntity_CXXInterface = 26 526917d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos 527017d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos} CXIdxEntityKind; 527117d35c36fbae764fcd68fa8b31624078a033aabcJoao Matos 5272838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidistypedef enum { 5273838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis CXIdxEntityLang_None = 0, 5274838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis CXIdxEntityLang_C = 1, 5275838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis CXIdxEntityLang_ObjC = 2, 5276838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis CXIdxEntityLang_CXX = 3 5277838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis} CXIdxEntityLanguage; 5278838d3c23204f52ae27a9f5e9a254238a7ac5d41bArgyrios Kyrtzidis 52792957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 52802957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief Extra C++ template information for an entity. This can apply to: 52812957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_Function 52822957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXClass 52832957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXStaticMethod 52842957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXInstanceMethod 52852957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXConstructor 52862957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXConversionFunction 52872957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * CXIdxEntity_CXXTypeAlias 52882957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 52892957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidistypedef enum { 52902957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_NonTemplate = 0, 52912957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_Template = 1, 52922957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_TemplatePartialSpecialization = 2, 52932957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXIdxEntity_TemplateSpecialization = 3 52942957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis} CXIdxEntityCXXTemplateKind; 52952957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 5296b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidistypedef enum { 5297b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxAttr_Unexposed = 0, 5298b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxAttr_IBAction = 1, 5299b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxAttr_IBOutlet = 2, 5300b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxAttr_IBOutletCollection = 3 5301b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis} CXIdxAttrKind; 5302b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis 5303b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidistypedef struct { 5304b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxAttrKind kind; 5305b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXCursor cursor; 5306b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxLoc loc; 5307b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis} CXIdxAttrInfo; 5308b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis 5309b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidistypedef struct { 5310643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis CXIdxEntityKind kind; 5311643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis CXIdxEntityCXXTemplateKind templateKind; 5312643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis CXIdxEntityLanguage lang; 5313643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis const char *name; 5314643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis const char *USR; 5315643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis CXCursor cursor; 5316643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis const CXIdxAttrInfo *const *attributes; 5317643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis unsigned numAttributes; 5318643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis} CXIdxEntityInfo; 5319643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis 5320643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidistypedef struct { 5321643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis CXCursor cursor; 5322643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis} CXIdxContainerInfo; 5323643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidis 5324643d3ce93c501d19353f2fa578fee3e97f1d1b4bArgyrios Kyrtzidistypedef struct { 5325b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis const CXIdxAttrInfo *attrInfo; 5326b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis const CXIdxEntityInfo *objcClass; 5327b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXCursor classCursor; 5328b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxLoc classLoc; 5329b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis} CXIdxIBOutletCollectionAttrInfo; 5330b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis 5331838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidistypedef enum { 5332838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis CXIdxDeclFlag_Skipped = 0x1 5333838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis} CXIdxDeclInfoFlags; 5334838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis 53354e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 53366ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityInfo *entityInfo; 5337dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXCursor cursor; 5338dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxLoc loc; 5339b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis const CXIdxContainerInfo *semanticContainer; 5340b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis /** 53417eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Generally same as #semanticContainer but can be different in 5342b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis * cases like out-of-line C++ member functions. 5343b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis */ 5344b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis const CXIdxContainerInfo *lexicalContainer; 5345dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis int isRedeclaration; 53464e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis int isDefinition; 5347c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis int isContainer; 53482957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis const CXIdxContainerInfo *declAsContainer; 5349c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis /** 5350c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis * \brief Whether the declaration exists in code or was created implicitly 5351c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis * by the compiler, e.g. implicit objc methods for properties. 5352c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis */ 5353c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis int isImplicit; 5354b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis const CXIdxAttrInfo *const *attributes; 5355b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis unsigned numAttributes; 5356838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis 5357838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis unsigned flags; 5358838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis 5359dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis} CXIdxDeclInfo; 53604e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5361dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidistypedef enum { 5362dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxObjCContainer_ForwardRef = 0, 5363dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxObjCContainer_Interface = 1, 5364dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxObjCContainer_Implementation = 2 5365dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis} CXIdxObjCContainerKind; 53664e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53674e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 53686ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxDeclInfo *declInfo; 5369dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxObjCContainerKind kind; 5370dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis} CXIdxObjCContainerDeclInfo; 53714e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53724e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 53736ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityInfo *base; 53746ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis CXCursor cursor; 53754e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXIdxLoc loc; 53766ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis} CXIdxBaseClassInfo; 53774e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53784e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 53796ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityInfo *protocol; 53806ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis CXCursor cursor; 53814e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXIdxLoc loc; 53824e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} CXIdxObjCProtocolRefInfo; 53834e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53844e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 53856ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxObjCProtocolRefInfo *const *protocols; 53864e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned numProtocols; 5387c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis} CXIdxObjCProtocolRefListInfo; 53884e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53894e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 5390c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis const CXIdxObjCContainerDeclInfo *containerInfo; 5391c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis const CXIdxBaseClassInfo *superInfo; 5392c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis const CXIdxObjCProtocolRefListInfo *protocols; 5393c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidis} CXIdxObjCInterfaceDeclInfo; 53944e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 53952957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidistypedef struct { 5396c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis const CXIdxObjCContainerDeclInfo *containerInfo; 5397c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis const CXIdxEntityInfo *objcClass; 5398c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis CXCursor classCursor; 5399c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis CXIdxLoc classLoc; 5400c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis const CXIdxObjCProtocolRefListInfo *protocols; 5401c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis} CXIdxObjCCategoryDeclInfo; 5402c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidis 5403c10a4c8baff3164bee9b7fc293679a5a5a90eb74Argyrios Kyrtzidistypedef struct { 54042957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis const CXIdxDeclInfo *declInfo; 5405792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis const CXIdxEntityInfo *getter; 5406792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis const CXIdxEntityInfo *setter; 5407792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis} CXIdxObjCPropertyDeclInfo; 5408792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis 5409792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidistypedef struct { 5410792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis const CXIdxDeclInfo *declInfo; 54112957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis const CXIdxBaseClassInfo *const *bases; 54122957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis unsigned numBases; 54132957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis} CXIdxCXXClassDeclInfo; 54142957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 5415bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 54167eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Data for IndexerCallbacks#indexEntityReference. 5417bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5418aca19be8731fc31cff68702de0dc7f30ce908979Argyrios Kyrtzidistypedef enum { 5419bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5420bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief The entity is referenced directly in user's code. 5421bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5422aca19be8731fc31cff68702de0dc7f30ce908979Argyrios Kyrtzidis CXIdxEntityRef_Direct = 1, 5423bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5424b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis * \brief An implicit reference, e.g. a reference of an ObjC method via the 5425b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis * dot syntax. 5426bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5427b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXIdxEntityRef_Implicit = 2 5428aca19be8731fc31cff68702de0dc7f30ce908979Argyrios Kyrtzidis} CXIdxEntityRefKind; 5429aca19be8731fc31cff68702de0dc7f30ce908979Argyrios Kyrtzidis 5430bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 54317eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Data for IndexerCallbacks#indexEntityReference. 5432bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54334e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 5434b1febb646bf7a2f319ad894c9833968c52d21711Argyrios Kyrtzidis CXIdxEntityRefKind kind; 5435bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5436bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Reference cursor. 5437bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54384e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXCursor cursor; 54394e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXIdxLoc loc; 5440bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5441bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief The entity that gets referenced. 5442bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54436ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityInfo *referencedEntity; 5444bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5445bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Immediate "parent" of the reference. For example: 5446bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5447bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \code 5448bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * Foo *var; 5449bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \endcode 5450bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5451bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * The parent of reference of type 'Foo' is the variable 'var'. 5452e422e45a6a89d450b8eca10f671b49874e87617aArgyrios Kyrtzidis * For references inside statement bodies of functions/methods, 5453e422e45a6a89d450b8eca10f671b49874e87617aArgyrios Kyrtzidis * the parentEntity will be the function/method. 5454bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54556ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityInfo *parentEntity; 5456bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5457e422e45a6a89d450b8eca10f671b49874e87617aArgyrios Kyrtzidis * \brief Lexical container context of the reference. 5458bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54592957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis const CXIdxContainerInfo *container; 54604e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} CXIdxEntityRefInfo; 54614e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 54627eee0184570366285589d788bcd7f5dda8345915James Dennett/** 54637eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief A group of callbacks used by #clang_indexSourceFile and 54647eee0184570366285589d788bcd7f5dda8345915James Dennett * #clang_indexTranslationUnit. 54657eee0184570366285589d788bcd7f5dda8345915James Dennett */ 54664e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidistypedef struct { 5467bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 54686ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis * \brief Called periodically to check whether indexing should be aborted. 54696ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis * Should return 0 to continue, and non-zero to abort. 54706ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis */ 54716ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis int (*abortQuery)(CXClientData client_data, void *reserved); 54726ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis 54736ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis /** 5474b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis * \brief Called at the end of indexing; passes the complete diagnostic set. 5475bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 54764e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis void (*diagnostic)(CXClientData client_data, 5477b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis CXDiagnosticSet, void *reserved); 54784e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5479dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxClientFile (*enteredMainFile)(CXClientData client_data, 54807eee0184570366285589d788bcd7f5dda8345915James Dennett CXFile mainFile, void *reserved); 5481dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis 5482bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 54837eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Called when a file gets \#included/\#imported. 5484bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5485dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxClientFile (*ppIncludedFile)(CXClientData client_data, 54866ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxIncludedFileInfo *); 54874e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5488bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5489bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Called when a AST file (PCH or module) gets imported. 5490bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5491bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * AST files will not get indexed (there will not be callbacks to index all 5492bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * the entities in an AST file). The recommended action is that, if the AST 54932c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis * file is not already indexed, to initiate a new indexing job specific to 54942c3e05c266de0d4c465b58ffd129bd0b31604368Argyrios Kyrtzidis * the AST file. 5495bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5496dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxClientASTFile (*importedASTFile)(CXClientData client_data, 54976ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxImportedASTFileInfo *); 54984e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5499bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5500bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Called at the beginning of indexing a translation unit. 5501bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 5502dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxClientContainer (*startedTranslationUnit)(CXClientData client_data, 55036ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis void *reserved); 55044e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 55056ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis void (*indexDeclaration)(CXClientData client_data, 55062957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis const CXIdxDeclInfo *); 55074e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5508bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis /** 5509bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Called to index a reference of an entity. 5510bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 55114e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis void (*indexEntityReference)(CXClientData client_data, 55126ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis const CXIdxEntityRefInfo *); 55134e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 55144e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis} IndexerCallbacks; 55154e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5516ab336c1adca7f6920fd886c132f199e469b63fb5NAKAMURA TakumiCINDEX_LINKAGE int clang_index_isEntityObjCContainerKind(CXIdxEntityKind); 55176ec43adc39006a7fce94188956d0239bd54c0363Argyrios KyrtzidisCINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * 55186ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidisclang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *); 55196ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis 55206ec43adc39006a7fce94188956d0239bd54c0363Argyrios KyrtzidisCINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfo * 55216ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidisclang_index_getObjCInterfaceDeclInfo(const CXIdxDeclInfo *); 5522dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis 5523ab336c1adca7f6920fd886c132f199e469b63fb5NAKAMURA TakumiCINDEX_LINKAGE 55246ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidisconst CXIdxObjCCategoryDeclInfo * 55256ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidisclang_index_getObjCCategoryDeclInfo(const CXIdxDeclInfo *); 55266ec43adc39006a7fce94188956d0239bd54c0363Argyrios Kyrtzidis 5527c71d55469e7d5f7b376a30620617a175a9442da9Argyrios KyrtzidisCINDEX_LINKAGE const CXIdxObjCProtocolRefListInfo * 5528c71d55469e7d5f7b376a30620617a175a9442da9Argyrios Kyrtzidisclang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *); 5529dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis 5530792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios KyrtzidisCINDEX_LINKAGE const CXIdxObjCPropertyDeclInfo * 5531792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidisclang_index_getObjCPropertyDeclInfo(const CXIdxDeclInfo *); 5532792db266f3d2f12a7a16bf37d90074f54bca1e6fArgyrios Kyrtzidis 5533b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios KyrtzidisCINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfo * 5534b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidisclang_index_getIBOutletCollectionAttrInfo(const CXIdxAttrInfo *); 5535b395c63b473bf1b3783bff371a993332e8c4c5e3Argyrios Kyrtzidis 55362957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE const CXIdxCXXClassDeclInfo * 55372957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidisclang_index_getCXXClassDeclInfo(const CXIdxDeclInfo *); 55382957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55392957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 55402957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief For retrieving a custom CXIdxClientContainer attached to a 55412957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * container. 55422957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55432957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE CXIdxClientContainer 55442957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidisclang_index_getClientContainer(const CXIdxContainerInfo *); 55452957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55462957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 55472957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief For setting a custom CXIdxClientContainer attached to a 55482957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * container. 55492957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55502957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE void 55512957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidisclang_index_setClientContainer(const CXIdxContainerInfo *,CXIdxClientContainer); 55522957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55532957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 55542957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief For retrieving a custom CXIdxClientEntity attached to an entity. 55552957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55562957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE CXIdxClientEntity 55572957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidisclang_index_getClientEntity(const CXIdxEntityInfo *); 55582957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55592957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 55602957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief For setting a custom CXIdxClientEntity attached to an entity. 55612957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55622957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE void 55632957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidisclang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity); 55642957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55652957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 5566838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * \brief An indexing action/session, to be applied to one or multiple 5567838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * translation units. 55682957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55692957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidistypedef void *CXIndexAction; 55702957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55712957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 5572838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * \brief An indexing action/session, to be applied to one or multiple 5573838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * translation units. 55742957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * 55752957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \param CIdx The index object with which the index action will be associated. 55762957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55772957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE CXIndexAction clang_IndexAction_create(CXIndex CIdx); 55782957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 55792957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis/** 55802957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * \brief Destroy the given index action. 55812957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * 55822957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * The index action must not be destroyed until all of the translation units 55832957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis * created within that index action have been destroyed. 55842957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis */ 55852957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE void clang_IndexAction_dispose(CXIndexAction); 55862957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis 558721ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidistypedef enum { 558821ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis /** 558921ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * \brief Used to indicate that no special indexing options are needed. 559021ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis */ 559121ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis CXIndexOpt_None = 0x0, 559221ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis 559321ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis /** 55947eee0184570366285589d788bcd7f5dda8345915James Dennett * \brief Used to indicate that IndexerCallbacks#indexEntityReference should 55957eee0184570366285589d788bcd7f5dda8345915James Dennett * be invoked for only one reference of an entity per source file that does 55967eee0184570366285589d788bcd7f5dda8345915James Dennett * not also include a declaration/definition of the entity. 559721ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis */ 559822490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis CXIndexOpt_SuppressRedundantRefs = 0x1, 559922490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis 560022490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis /** 560122490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis * \brief Function-local symbols should be indexed. If this is not set 560222490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis * function-local symbols will be ignored. 560322490747c123a78feec089539f30426084d348cfArgyrios Kyrtzidis */ 560458d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis CXIndexOpt_IndexFunctionLocalSymbols = 0x2, 560558d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis 560658d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis /** 560758d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis * \brief Implicit function/class template instantiations should be indexed. 560858d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis * If this is not set, implicit instantiations will be ignored. 560958d2dbea680a75de266c5eff77cc15c323cfd48aArgyrios Kyrtzidis */ 5610b49a29f7e4413a7a014a2b28c5c25fe54e005cf3Argyrios Kyrtzidis CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4, 5611b49a29f7e4413a7a014a2b28c5c25fe54e005cf3Argyrios Kyrtzidis 5612b49a29f7e4413a7a014a2b28c5c25fe54e005cf3Argyrios Kyrtzidis /** 5613b49a29f7e4413a7a014a2b28c5c25fe54e005cf3Argyrios Kyrtzidis * \brief Suppress all compiler warnings when parsing for indexing. 5614b49a29f7e4413a7a014a2b28c5c25fe54e005cf3Argyrios Kyrtzidis */ 5615838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis CXIndexOpt_SuppressWarnings = 0x8, 5616838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis 5617838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis /** 5618838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * \brief Skip a function/method body that was already parsed during an 5619838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * indexing session assosiated with a \c CXIndexAction object. 5620838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis * Bodies in system headers are always skipped. 5621838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis */ 5622838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis CXIndexOpt_SkipParsedBodiesInSession = 0x10 5623838eb7e8652e451d93494a4e583e4d11809bcb4aArgyrios Kyrtzidis 562421ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis} CXIndexOptFlags; 562521ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis 5626bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 5627bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Index the given source file and the translation unit corresponding 56287eee0184570366285589d788bcd7f5dda8345915James Dennett * to that file via callbacks implemented through #IndexerCallbacks. 5629bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5630bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \param client_data pointer data supplied by the client, which will 5631bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * be passed to the invoked callbacks. 5632bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5633bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \param index_callbacks Pointer to indexing callbacks that the client 5634bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * implements. 5635bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 56367eee0184570366285589d788bcd7f5dda8345915James Dennett * \param index_callbacks_size Size of #IndexerCallbacks structure that gets 5637bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * passed in index_callbacks. 5638bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 563921ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * \param index_options A bitmask of options that affects how indexing is 564021ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * performed. This should be a bitwise OR of the CXIndexOpt_XXX flags. 5641bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5642bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \param out_TU [out] pointer to store a CXTranslationUnit that can be reused 5643bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * after indexing is finished. Set to NULL if you do not require it. 5644bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 564521ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * \returns If there is a failure from which the there is no recovery, returns 5646bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * non-zero, otherwise returns 0. 564721ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * 56487eee0184570366285589d788bcd7f5dda8345915James Dennett * The rest of the parameters are the same as #clang_parseTranslationUnit. 5649bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 56502957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, 56514e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXClientData client_data, 56524e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis IndexerCallbacks *index_callbacks, 56534e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned index_callbacks_size, 56544e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned index_options, 56554e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis const char *source_filename, 56564e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis const char * const *command_line_args, 56574e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis int num_command_line_args, 56584e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis struct CXUnsavedFile *unsaved_files, 56594e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned num_unsaved_files, 56604e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXTranslationUnit *out_TU, 56614e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned TU_options); 56624e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5663bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 566421ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * \brief Index the given translation unit via callbacks implemented through 56657eee0184570366285589d788bcd7f5dda8345915James Dennett * #IndexerCallbacks. 566621ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * 566721ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * The order of callback invocations is not guaranteed to be the same as 566821ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * when indexing a source file. The high level order will be: 566921ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * 567021ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * -Preprocessor callbacks invocations 567121ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * -Declaration/reference callbacks invocations 567221ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * -Diagnostic callback invocations 567321ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * 56747eee0184570366285589d788bcd7f5dda8345915James Dennett * The parameters are the same as #clang_indexSourceFile. 567521ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * 567621ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * \returns If there is a failure from which the there is no recovery, returns 567721ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis * non-zero, otherwise returns 0. 567821ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis */ 56792957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios KyrtzidisCINDEX_LINKAGE int clang_indexTranslationUnit(CXIndexAction, 568021ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis CXClientData client_data, 568121ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis IndexerCallbacks *index_callbacks, 568221ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis unsigned index_callbacks_size, 56832957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis unsigned index_options, 56842957e6f8c4c2e58a4b9cb639949fea801970fe36Argyrios Kyrtzidis CXTranslationUnit); 568521ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis 568621ee5707e6e59d982d2f2ae28e079c7ff46dc519Argyrios Kyrtzidis/** 5687bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Retrieve the CXIdxFile, file, line, column, and offset represented by 5688bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * the given CXIdxLoc. 5689bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * 5690bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * If the location refers into a macro expansion, retrieves the 5691bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * location of the macro expansion and if it refers into a macro argument 5692bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * retrieves the location of the argument. 5693bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 56944e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios KyrtzidisCINDEX_LINKAGE void clang_indexLoc_getFileLocation(CXIdxLoc loc, 5695dd93c596cd95e1b96031ff47efe0a5095ff3d7f1Argyrios Kyrtzidis CXIdxClientFile *indexFile, 56964e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis CXFile *file, 56974e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned *line, 56984e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned *column, 56994e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis unsigned *offset); 57004e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5701bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis/** 5702bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis * \brief Retrieve the CXSourceLocation represented by the given CXIdxLoc. 5703bd0ddf88415441d3b5741a7bd40a3d56adcd4d66Argyrios Kyrtzidis */ 57044e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios KyrtzidisCINDEX_LINKAGE 57054e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios KyrtzidisCXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc); 57064e7064fa7e344e8f87a5b8457e96dfdd252c4a9eArgyrios Kyrtzidis 5707aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis/** 5708aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis * @} 5709aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis */ 5710aed123ec3cc37e457fe20a6158fdadf8849ad916Argyrios Kyrtzidis 5711c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor/** 5712c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor * @} 5713c42fefa51f7555bb3644a7cde2ca4bfd0d848d74Douglas Gregor */ 57141efcf3d137c11fb6b21c385911e0d2ca59ca94c3Daniel Dunbar 5715d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#ifdef __cplusplus 5716d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek} 5717d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#endif 5718d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek#endif 5719d2fa56687f8bd5ac6ebf9d9468d0efd714986a54Ted Kremenek 5720