Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 1 | /*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\ |
| 2 | |* *| |
| 3 | |* The LLVM Compiler Infrastructure *| |
| 4 | |* *| |
| 5 | |* This file is distributed under the University of Illinois Open Source *| |
| 6 | |* License. See LICENSE.TXT for details. *| |
| 7 | |* *| |
| 8 | |*===----------------------------------------------------------------------===*| |
| 9 | |* *| |
| 10 | |* This header provides a public inferface to a Clang library for extracting *| |
| 11 | |* high-level symbol information from source files without exposing the full *| |
| 12 | |* Clang C++ API. *| |
| 13 | |* *| |
| 14 | \*===----------------------------------------------------------------------===*/ |
| 15 | |
| 16 | #ifndef CLANG_C_INDEX_H |
| 17 | #define CLANG_C_INDEX_H |
| 18 | |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 19 | #include <sys/stat.h> |
Chandler Carruth | 3d31560 | 2009-12-17 09:27:29 +0000 | [diff] [blame] | 20 | #include <time.h> |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 21 | |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 22 | #ifdef __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 26 | /* MSVC DLL import/export. */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 27 | #ifdef _MSC_VER |
| 28 | #ifdef _CINDEX_LIB_ |
| 29 | #define CINDEX_LINKAGE __declspec(dllexport) |
| 30 | #else |
| 31 | #define CINDEX_LINKAGE __declspec(dllimport) |
| 32 | #endif |
| 33 | #else |
| 34 | #define CINDEX_LINKAGE |
| 35 | #endif |
| 36 | |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 37 | /* |
| 38 | Clang indeX abstractions. The backing store for the following API's will be |
Steve Naroff | b7cd17c | 2009-09-01 17:13:31 +0000 | [diff] [blame] | 39 | clangs AST file (currently based on PCH). AST files are created as follows: |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 40 | |
Steve Naroff | b7cd17c | 2009-09-01 17:13:31 +0000 | [diff] [blame] | 41 | "clang -emit-ast <sourcefile.langsuffix> -o <sourcefile.ast>". |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 42 | |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 43 | Naming Conventions: To avoid namespace pollution, data types are prefixed |
| 44 | with "CX" and functions are prefixed with "clang_". |
| 45 | */ |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 46 | typedef void *CXIndex; /* An indexing instance. */ |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 47 | |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 48 | typedef void *CXTranslationUnit; /* A translation unit instance. */ |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 49 | |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 50 | typedef void *CXFile; /* A source file */ |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 51 | typedef void *CXDecl; /* A specific declaration within a translation unit. */ |
Steve Naroff | fb57042 | 2009-09-22 19:25:29 +0000 | [diff] [blame] | 52 | typedef void *CXStmt; /* A specific statement within a function/method */ |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 53 | |
Steve Naroff | c857ea4 | 2009-09-02 13:28:54 +0000 | [diff] [blame] | 54 | /* Cursors represent declarations, definitions, and references. */ |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 55 | enum CXCursorKind { |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 56 | /* Declarations */ |
| 57 | CXCursor_FirstDecl = 1, |
Steve Naroff | c857ea4 | 2009-09-02 13:28:54 +0000 | [diff] [blame] | 58 | CXCursor_TypedefDecl = 2, |
| 59 | CXCursor_StructDecl = 3, |
| 60 | CXCursor_UnionDecl = 4, |
| 61 | CXCursor_ClassDecl = 5, |
| 62 | CXCursor_EnumDecl = 6, |
| 63 | CXCursor_FieldDecl = 7, |
| 64 | CXCursor_EnumConstantDecl = 8, |
| 65 | CXCursor_FunctionDecl = 9, |
| 66 | CXCursor_VarDecl = 10, |
| 67 | CXCursor_ParmDecl = 11, |
| 68 | CXCursor_ObjCInterfaceDecl = 12, |
| 69 | CXCursor_ObjCCategoryDecl = 13, |
| 70 | CXCursor_ObjCProtocolDecl = 14, |
| 71 | CXCursor_ObjCPropertyDecl = 15, |
| 72 | CXCursor_ObjCIvarDecl = 16, |
| 73 | CXCursor_ObjCInstanceMethodDecl = 17, |
| 74 | CXCursor_ObjCClassMethodDecl = 18, |
| 75 | CXCursor_LastDecl = 18, |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 76 | |
Steve Naroff | c857ea4 | 2009-09-02 13:28:54 +0000 | [diff] [blame] | 77 | /* Definitions */ |
| 78 | CXCursor_FirstDefn = 32, |
| 79 | CXCursor_FunctionDefn = 32, |
| 80 | CXCursor_ObjCClassDefn = 33, |
| 81 | CXCursor_ObjCCategoryDefn = 34, |
| 82 | CXCursor_ObjCInstanceMethodDefn = 35, |
| 83 | CXCursor_ObjCClassMethodDefn = 36, |
| 84 | CXCursor_LastDefn = 36, |
| 85 | |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 86 | /* References */ |
Steve Naroff | fb57042 | 2009-09-22 19:25:29 +0000 | [diff] [blame] | 87 | CXCursor_FirstRef = 40, /* Decl references */ |
Steve Naroff | f334b4e | 2009-09-02 18:26:48 +0000 | [diff] [blame] | 88 | CXCursor_ObjCSuperClassRef = 40, |
| 89 | CXCursor_ObjCProtocolRef = 41, |
Steve Naroff | fb57042 | 2009-09-22 19:25:29 +0000 | [diff] [blame] | 90 | CXCursor_ObjCClassRef = 42, |
| 91 | |
| 92 | CXCursor_ObjCSelectorRef = 43, /* Expression references */ |
| 93 | CXCursor_ObjCIvarRef = 44, |
| 94 | CXCursor_VarRef = 45, |
| 95 | CXCursor_FunctionRef = 46, |
| 96 | CXCursor_EnumConstantRef = 47, |
| 97 | CXCursor_MemberRef = 48, |
| 98 | CXCursor_LastRef = 48, |
Steve Naroff | 77128dd | 2009-09-15 20:25:34 +0000 | [diff] [blame] | 99 | |
| 100 | /* Error conditions */ |
| 101 | CXCursor_FirstInvalid = 70, |
| 102 | CXCursor_InvalidFile = 70, |
| 103 | CXCursor_NoDeclFound = 71, |
| 104 | CXCursor_NotImplemented = 72, |
| 105 | CXCursor_LastInvalid = 72 |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 106 | }; |
| 107 | |
Douglas Gregor | 735df88 | 2009-12-02 09:21:34 +0000 | [diff] [blame] | 108 | /** |
| 109 | * \brief Provides the contents of a file that has not yet been saved to disk. |
| 110 | * |
| 111 | * Each CXUnsavedFile instance provides the name of a file on the |
| 112 | * system along with the current contents of that file that have not |
| 113 | * yet been saved to disk. |
| 114 | */ |
| 115 | struct CXUnsavedFile { |
| 116 | /** |
| 117 | * \brief The file whose contents have not yet been saved. |
| 118 | * |
| 119 | * This file must already exist in the file system. |
| 120 | */ |
| 121 | const char *Filename; |
| 122 | |
| 123 | /** |
| 124 | * \brief A null-terminated buffer containing the unsaved contents |
| 125 | * of this file. |
| 126 | */ |
| 127 | const char *Contents; |
| 128 | |
| 129 | /** |
| 130 | * \brief The length of the unsaved contents of this buffer, not |
| 131 | * counting the NULL at the end of the buffer. |
| 132 | */ |
| 133 | unsigned long Length; |
| 134 | }; |
| 135 | |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 136 | /* A cursor into the CXTranslationUnit. */ |
Steve Naroff | fb57042 | 2009-09-22 19:25:29 +0000 | [diff] [blame] | 137 | |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 138 | typedef struct { |
| 139 | enum CXCursorKind kind; |
| 140 | CXDecl decl; |
Steve Naroff | fb57042 | 2009-09-22 19:25:29 +0000 | [diff] [blame] | 141 | CXStmt stmt; /* expression reference */ |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 142 | } CXCursor; |
| 143 | |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 144 | /* A unique token for looking up "visible" CXDecls from a CXTranslationUnit. */ |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 145 | typedef void *CXEntity; |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 146 | |
Steve Naroff | ef0cef6 | 2009-11-09 17:45:52 +0000 | [diff] [blame] | 147 | /** |
| 148 | * For functions returning a string that might or might not need |
| 149 | * to be internally allocated and freed. |
| 150 | * Use clang_getCString to access the C string value. |
| 151 | * Use clang_disposeString to free the value. |
| 152 | * Treat it as an opaque type. |
| 153 | */ |
| 154 | typedef struct { |
| 155 | const char *Spelling; |
| 156 | /* A 1 value indicates the clang_ indexing API needed to allocate the string |
| 157 | (and it must be freed by clang_disposeString()). */ |
| 158 | int MustFreeString; |
| 159 | } CXString; |
| 160 | |
| 161 | /* Get C string pointer from a CXString. */ |
| 162 | CINDEX_LINKAGE const char *clang_getCString(CXString string); |
| 163 | |
| 164 | /* Free CXString. */ |
| 165 | CINDEX_LINKAGE void clang_disposeString(CXString string); |
| 166 | |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 167 | /** |
| 168 | * \brief clang_createIndex() provides a shared context for creating |
| 169 | * translation units. It provides two options: |
| 170 | * |
| 171 | * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" |
| 172 | * declarations (when loading any new translation units). A "local" declaration |
| 173 | * is one that belongs in the translation unit itself and not in a precompiled |
| 174 | * header that was used by the translation unit. If zero, all declarations |
| 175 | * will be enumerated. |
| 176 | * |
| 177 | * - displayDiagnostics: when non-zero, diagnostics will be output. If zero, |
| 178 | * diagnostics will be ignored. |
Steve Naroff | b4ece63 | 2009-10-20 16:36:34 +0000 | [diff] [blame] | 179 | * |
| 180 | * Here is an example: |
| 181 | * |
| 182 | * // excludeDeclsFromPCH = 1, displayDiagnostics = 1 |
| 183 | * Idx = clang_createIndex(1, 1); |
| 184 | * |
| 185 | * // IndexTest.pch was produced with the following command: |
| 186 | * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" |
| 187 | * TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); |
| 188 | * |
| 189 | * // This will load all the symbols from 'IndexTest.pch' |
| 190 | * clang_loadTranslationUnit(TU, TranslationUnitVisitor, 0); |
| 191 | * clang_disposeTranslationUnit(TU); |
| 192 | * |
| 193 | * // This will load all the symbols from 'IndexTest.c', excluding symbols |
| 194 | * // from 'IndexTest.pch'. |
| 195 | * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch", 0 }; |
| 196 | * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args); |
| 197 | * clang_loadTranslationUnit(TU, TranslationUnitVisitor, 0); |
| 198 | * clang_disposeTranslationUnit(TU); |
| 199 | * |
| 200 | * This process of creating the 'pch', loading it separately, and using it (via |
| 201 | * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks |
| 202 | * (which gives the indexer the same performance benefit as the compiler). |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 203 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 204 | CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 205 | int displayDiagnostics); |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 206 | CINDEX_LINKAGE void clang_disposeIndex(CXIndex index); |
| 207 | CINDEX_LINKAGE CXString |
| 208 | clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); |
| 209 | |
| 210 | /* |
| 211 | * \brief Request that AST's be generated external for API calls which parse |
| 212 | * source code on the fly, e.g. \see createTranslationUnitFromSourceFile. |
| 213 | * |
| 214 | * Note: This is for debugging purposes only, and may be removed at a later |
| 215 | * date. |
| 216 | * |
| 217 | * \param index - The index to update. |
| 218 | * \param value - The new flag value. |
| 219 | */ |
| 220 | CINDEX_LINKAGE void clang_setUseExternalASTGeneration(CXIndex index, |
| 221 | int value); |
Steve Naroff | af08ddc | 2009-09-03 15:49:00 +0000 | [diff] [blame] | 222 | |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 223 | /* |
| 224 | * \brief Create a translation unit from an AST file (-emit-ast). |
| 225 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 226 | CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit( |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 227 | CXIndex, const char *ast_filename |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 228 | ); |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 229 | |
Ted Kremenek | 1374598 | 2009-10-19 22:15:09 +0000 | [diff] [blame] | 230 | /** |
| 231 | * \brief Destroy the specified CXTranslationUnit object. |
| 232 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 233 | CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit); |
Ted Kremenek | 1374598 | 2009-10-19 22:15:09 +0000 | [diff] [blame] | 234 | |
| 235 | /** |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 236 | * \brief Return the CXTranslationUnit for a given source file and the provided |
| 237 | * command line arguments one would pass to the compiler. |
| 238 | * |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 239 | * Note: The 'source_filename' argument is optional. If the caller provides a |
| 240 | * NULL pointer, the name of the source file is expected to reside in the |
| 241 | * specified command line arguments. |
Ted Kremenek | 139ba86 | 2009-10-22 00:03:57 +0000 | [diff] [blame] | 242 | * |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 243 | * Note: When encountered in 'clang_command_line_args', the following options |
| 244 | * are ignored: |
Ted Kremenek | 139ba86 | 2009-10-22 00:03:57 +0000 | [diff] [blame] | 245 | * |
| 246 | * '-c' |
| 247 | * '-emit-ast' |
| 248 | * '-fsyntax-only' |
| 249 | * '-o <output file>' (both '-o' and '<output file>' are ignored) |
| 250 | * |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 251 | * |
| 252 | * \param source_filename - The name of the source file to load, or NULL if the |
| 253 | * source file is included in clang_command_line_args. |
Ted Kremenek | 1374598 | 2009-10-19 22:15:09 +0000 | [diff] [blame] | 254 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 255 | CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile( |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 256 | CXIndex CIdx, |
| 257 | const char *source_filename, |
Steve Naroff | 5b7d8e2 | 2009-10-15 20:04:39 +0000 | [diff] [blame] | 258 | int num_clang_command_line_args, |
Steve Naroff | e56b4ba | 2009-10-20 14:46:24 +0000 | [diff] [blame] | 259 | const char **clang_command_line_args |
Steve Naroff | 5b7d8e2 | 2009-10-15 20:04:39 +0000 | [diff] [blame] | 260 | ); |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 261 | |
| 262 | /* |
| 263 | Usage: clang_loadTranslationUnit(). Will load the toplevel declarations |
| 264 | within a translation unit, issuing a 'callback' for each one. |
| 265 | |
| 266 | void printObjCInterfaceNames(CXTranslationUnit X, CXCursor C) { |
| 267 | if (clang_getCursorKind(C) == Cursor_Declaration) { |
| 268 | CXDecl D = clang_getCursorDecl(C); |
| 269 | if (clang_getDeclKind(D) == CXDecl_ObjC_interface) |
| 270 | printf("@interface %s in file %s on line %d column %d\n", |
| 271 | clang_getDeclSpelling(D), clang_getCursorSource(C), |
| 272 | clang_getCursorLine(C), clang_getCursorColumn(C)); |
| 273 | } |
| 274 | } |
| 275 | static void usage { |
| 276 | clang_loadTranslationUnit(CXTranslationUnit, printObjCInterfaceNames); |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 277 | } |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 278 | */ |
Steve Naroff | 2b8ee6c | 2009-09-01 15:55:40 +0000 | [diff] [blame] | 279 | typedef void *CXClientData; |
| 280 | typedef void (*CXTranslationUnitIterator)(CXTranslationUnit, CXCursor, |
| 281 | CXClientData); |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 282 | CINDEX_LINKAGE void clang_loadTranslationUnit(CXTranslationUnit, |
| 283 | CXTranslationUnitIterator, |
| 284 | CXClientData); |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 285 | |
| 286 | /* |
| 287 | Usage: clang_loadDeclaration(). Will load the declaration, issuing a |
| 288 | 'callback' for each declaration/reference within the respective declaration. |
| 289 | |
| 290 | For interface declarations, this will index the super class, protocols, |
| 291 | ivars, methods, etc. For structure declarations, this will index the fields. |
| 292 | For functions, this will index the parameters (and body, for function |
| 293 | definitions), local declarations/references. |
| 294 | |
| 295 | void getInterfaceDetails(CXDecl X, CXCursor C) { |
| 296 | switch (clang_getCursorKind(C)) { |
| 297 | case Cursor_ObjC_ClassRef: |
| 298 | CXDecl SuperClass = clang_getCursorDecl(C); |
| 299 | case Cursor_ObjC_ProtocolRef: |
| 300 | CXDecl AdoptsProtocol = clang_getCursorDecl(C); |
| 301 | case Cursor_Declaration: |
| 302 | CXDecl AnIvarOrMethod = clang_getCursorDecl(C); |
| 303 | } |
| 304 | } |
| 305 | static void usage() { |
| 306 | if (clang_getDeclKind(D) == CXDecl_ObjC_interface) { |
| 307 | clang_loadDeclaration(D, getInterfaceDetails); |
| 308 | } |
| 309 | } |
| 310 | */ |
Steve Naroff | c857ea4 | 2009-09-02 13:28:54 +0000 | [diff] [blame] | 311 | typedef void (*CXDeclIterator)(CXDecl, CXCursor, CXClientData); |
Steve Naroff | 89922f8 | 2009-08-31 00:59:03 +0000 | [diff] [blame] | 312 | |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 313 | CINDEX_LINKAGE void clang_loadDeclaration(CXDecl, CXDeclIterator, CXClientData); |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 314 | |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 315 | /* |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 316 | * CXFile Operations. |
| 317 | */ |
Douglas Gregor | 08b0e8d | 2009-10-31 15:48:08 +0000 | [diff] [blame] | 318 | CINDEX_LINKAGE const char *clang_getFileName(CXFile SFile); |
| 319 | CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 320 | |
| 321 | /* |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 322 | * CXEntity Operations. |
| 323 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 324 | CINDEX_LINKAGE const char *clang_getDeclarationName(CXEntity); |
Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 325 | CINDEX_LINKAGE const char *clang_getUSR(CXEntity); |
| 326 | CINDEX_LINKAGE CXEntity clang_getEntity(const char *USR); |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 327 | /* |
| 328 | * CXDecl Operations. |
| 329 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 330 | CINDEX_LINKAGE CXCursor clang_getCursorFromDecl(CXDecl); |
| 331 | CINDEX_LINKAGE CXEntity clang_getEntityFromDecl(CXDecl); |
Steve Naroff | ef0cef6 | 2009-11-09 17:45:52 +0000 | [diff] [blame] | 332 | CINDEX_LINKAGE CXString clang_getDeclSpelling(CXDecl); |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 333 | CINDEX_LINKAGE unsigned clang_getDeclLine(CXDecl); |
| 334 | CINDEX_LINKAGE unsigned clang_getDeclColumn(CXDecl); |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 335 | CINDEX_LINKAGE const char *clang_getDeclSource(CXDecl); /* deprecate */ |
| 336 | CINDEX_LINKAGE CXFile clang_getDeclSourceFile(CXDecl); |
Steve Naroff | 699a07d | 2009-09-25 21:32:34 +0000 | [diff] [blame] | 337 | |
Ted Kremenek | fe6fd3d | 2010-01-05 23:18:49 +0000 | [diff] [blame^] | 338 | typedef struct CXSourceLineColumn { |
| 339 | unsigned line; |
| 340 | unsigned column; |
| 341 | } CXSourceLineColumn; |
| 342 | |
| 343 | typedef struct CXDeclExtent { |
| 344 | CXSourceLineColumn begin; |
| 345 | CXSourceLineColumn end; |
| 346 | } CXSourceExtent; |
| 347 | |
| 348 | /* clang_getDeclExtent() returns the physical extent of a declaration. The beginning |
| 349 | * line/column pair points to the start of the first token in the declaration, and the |
| 350 | * ending line/column pair points the start of the last token in the declaration. |
| 351 | */ |
| 352 | CXSourceExtent clang_getDeclExtent(CXDecl); |
| 353 | |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 354 | /* |
| 355 | * CXCursor Operations. |
| 356 | */ |
Steve Naroff | 6a6de8b | 2009-10-21 13:56:23 +0000 | [diff] [blame] | 357 | /** |
| 358 | Usage: clang_getCursor() will translate a source/line/column position |
| 359 | into an AST cursor (to derive semantic information from the source code). |
Steve Naroff | 6a6de8b | 2009-10-21 13:56:23 +0000 | [diff] [blame] | 360 | */ |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 361 | CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, |
| 362 | const char *source_name, |
| 363 | unsigned line, unsigned column); |
Ted Kremenek | 7388555 | 2009-11-17 19:28:59 +0000 | [diff] [blame] | 364 | |
| 365 | CINDEX_LINKAGE CXCursor clang_getNullCursor(void); |
Ted Kremenek | fbcb2b7 | 2009-10-22 17:22:53 +0000 | [diff] [blame] | 366 | |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 367 | CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor); |
| 368 | CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); |
| 369 | CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind); |
| 370 | CINDEX_LINKAGE unsigned clang_isDefinition(enum CXCursorKind); |
| 371 | CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind); |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 372 | |
Ted Kremenek | 7388555 | 2009-11-17 19:28:59 +0000 | [diff] [blame] | 373 | CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); |
| 374 | |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 375 | CINDEX_LINKAGE unsigned clang_getCursorLine(CXCursor); |
| 376 | CINDEX_LINKAGE unsigned clang_getCursorColumn(CXCursor); |
Steve Naroff | ef0cef6 | 2009-11-09 17:45:52 +0000 | [diff] [blame] | 377 | CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor); |
Steve Naroff | 8814503 | 2009-10-27 14:35:18 +0000 | [diff] [blame] | 378 | CINDEX_LINKAGE const char *clang_getCursorSource(CXCursor); /* deprecate */ |
| 379 | CINDEX_LINKAGE CXFile clang_getCursorSourceFile(CXCursor); |
Steve Naroff | f334b4e | 2009-09-02 18:26:48 +0000 | [diff] [blame] | 380 | |
Steve Naroff | 4ade6d6 | 2009-09-23 17:52:52 +0000 | [diff] [blame] | 381 | /* for debug/testing */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 382 | CINDEX_LINKAGE const char *clang_getCursorKindSpelling(enum CXCursorKind Kind); |
| 383 | CINDEX_LINKAGE void clang_getDefinitionSpellingAndExtent(CXCursor, |
Steve Naroff | 4ade6d6 | 2009-09-23 17:52:52 +0000 | [diff] [blame] | 384 | const char **startBuf, |
| 385 | const char **endBuf, |
| 386 | unsigned *startLine, |
| 387 | unsigned *startColumn, |
| 388 | unsigned *endLine, |
| 389 | unsigned *endColumn); |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame] | 390 | |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 391 | /* |
Chris Lattner | 459789b | 2009-09-16 20:18:54 +0000 | [diff] [blame] | 392 | * If CXCursorKind == Cursor_Reference, then this will return the referenced |
| 393 | * declaration. |
Steve Naroff | 5039819 | 2009-08-28 15:28:48 +0000 | [diff] [blame] | 394 | * If CXCursorKind == Cursor_Declaration, then this will return the declaration. |
| 395 | */ |
John Thompson | 2e06fc8 | 2009-10-27 13:42:56 +0000 | [diff] [blame] | 396 | CINDEX_LINKAGE CXDecl clang_getCursorDecl(CXCursor); |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 397 | |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 398 | /** |
| 399 | * \brief A semantic string that describes a code-completion result. |
| 400 | * |
| 401 | * A semantic string that describes the formatting of a code-completion |
| 402 | * result as a single "template" of text that should be inserted into the |
| 403 | * source buffer when a particular code-completion result is selected. |
| 404 | * Each semantic string is made up of some number of "chunks", each of which |
| 405 | * contains some text along with a description of what that text means, e.g., |
| 406 | * the name of the entity being referenced, whether the text chunk is part of |
| 407 | * the template, or whether it is a "placeholder" that the user should replace |
| 408 | * with actual code,of a specific kind. See \c CXCompletionChunkKind for a |
| 409 | * description of the different kinds of chunks. |
| 410 | */ |
| 411 | typedef void *CXCompletionString; |
| 412 | |
| 413 | /** |
| 414 | * \brief A single result of code completion. |
| 415 | */ |
| 416 | typedef struct { |
| 417 | /** |
| 418 | * \brief The kind of entity that this completion refers to. |
| 419 | * |
| 420 | * The cursor kind will be a macro, keyword, or a declaration (one of the |
| 421 | * *Decl cursor kinds), describing the entity that the completion is |
| 422 | * referring to. |
| 423 | * |
| 424 | * \todo In the future, we would like to provide a full cursor, to allow |
| 425 | * the client to extract additional information from declaration. |
| 426 | */ |
| 427 | enum CXCursorKind CursorKind; |
| 428 | |
| 429 | /** |
| 430 | * \brief The code-completion string that describes how to insert this |
| 431 | * code-completion result into the editing buffer. |
| 432 | */ |
| 433 | CXCompletionString CompletionString; |
| 434 | } CXCompletionResult; |
| 435 | |
| 436 | /** |
| 437 | * \brief Describes a single piece of text within a code-completion string. |
| 438 | * |
| 439 | * Each "chunk" within a code-completion string (\c CXCompletionString) is |
| 440 | * either a piece of text with a specific "kind" that describes how that text |
| 441 | * should be interpreted by the client or is another completion string. |
| 442 | */ |
| 443 | enum CXCompletionChunkKind { |
| 444 | /** |
| 445 | * \brief A code-completion string that describes "optional" text that |
| 446 | * could be a part of the template (but is not required). |
| 447 | * |
| 448 | * The Optional chunk is the only kind of chunk that has a code-completion |
| 449 | * string for its representation, which is accessible via |
| 450 | * \c clang_getCompletionChunkCompletionString(). The code-completion string |
| 451 | * describes an additional part of the template that is completely optional. |
| 452 | * For example, optional chunks can be used to describe the placeholders for |
| 453 | * arguments that match up with defaulted function parameters, e.g. given: |
| 454 | * |
| 455 | * \code |
| 456 | * void f(int x, float y = 3.14, double z = 2.71828); |
| 457 | * \endcode |
| 458 | * |
| 459 | * The code-completion string for this function would contain: |
| 460 | * - a TypedText chunk for "f". |
| 461 | * - a LeftParen chunk for "(". |
| 462 | * - a Placeholder chunk for "int x" |
| 463 | * - an Optional chunk containing the remaining defaulted arguments, e.g., |
| 464 | * - a Comma chunk for "," |
| 465 | * - a Placeholder chunk for "float x" |
| 466 | * - an Optional chunk containing the last defaulted argument: |
| 467 | * - a Comma chunk for "," |
| 468 | * - a Placeholder chunk for "double z" |
| 469 | * - a RightParen chunk for ")" |
| 470 | * |
| 471 | * There are many ways two handle Optional chunks. Two simple approaches are: |
| 472 | * - Completely ignore optional chunks, in which case the template for the |
| 473 | * function "f" would only include the first parameter ("int x"). |
| 474 | * - Fully expand all optional chunks, in which case the template for the |
| 475 | * function "f" would have all of the parameters. |
| 476 | */ |
| 477 | CXCompletionChunk_Optional, |
| 478 | /** |
| 479 | * \brief Text that a user would be expected to type to get this |
| 480 | * code-completion result. |
| 481 | * |
| 482 | * There will be exactly one "typed text" chunk in a semantic string, which |
| 483 | * will typically provide the spelling of a keyword or the name of a |
| 484 | * declaration that could be used at the current code point. Clients are |
| 485 | * expected to filter the code-completion results based on the text in this |
| 486 | * chunk. |
| 487 | */ |
| 488 | CXCompletionChunk_TypedText, |
| 489 | /** |
| 490 | * \brief Text that should be inserted as part of a code-completion result. |
| 491 | * |
| 492 | * A "text" chunk represents text that is part of the template to be |
| 493 | * inserted into user code should this particular code-completion result |
| 494 | * be selected. |
| 495 | */ |
| 496 | CXCompletionChunk_Text, |
| 497 | /** |
| 498 | * \brief Placeholder text that should be replaced by the user. |
| 499 | * |
| 500 | * A "placeholder" chunk marks a place where the user should insert text |
| 501 | * into the code-completion template. For example, placeholders might mark |
| 502 | * the function parameters for a function declaration, to indicate that the |
| 503 | * user should provide arguments for each of those parameters. The actual |
| 504 | * text in a placeholder is a suggestion for the text to display before |
| 505 | * the user replaces the placeholder with real code. |
| 506 | */ |
| 507 | CXCompletionChunk_Placeholder, |
| 508 | /** |
| 509 | * \brief Informative text that should be displayed but never inserted as |
| 510 | * part of the template. |
| 511 | * |
| 512 | * An "informative" chunk contains annotations that can be displayed to |
| 513 | * help the user decide whether a particular code-completion result is the |
| 514 | * right option, but which is not part of the actual template to be inserted |
| 515 | * by code completion. |
| 516 | */ |
| 517 | CXCompletionChunk_Informative, |
| 518 | /** |
| 519 | * \brief Text that describes the current parameter when code-completion is |
| 520 | * referring to function call, message send, or template specialization. |
| 521 | * |
| 522 | * A "current parameter" chunk occurs when code-completion is providing |
| 523 | * information about a parameter corresponding to the argument at the |
| 524 | * code-completion point. For example, given a function |
| 525 | * |
| 526 | * \code |
| 527 | * int add(int x, int y); |
| 528 | * \endcode |
| 529 | * |
| 530 | * and the source code \c add(, where the code-completion point is after the |
| 531 | * "(", the code-completion string will contain a "current parameter" chunk |
| 532 | * for "int x", indicating that the current argument will initialize that |
| 533 | * parameter. After typing further, to \c add(17, (where the code-completion |
| 534 | * point is after the ","), the code-completion string will contain a |
| 535 | * "current paremeter" chunk to "int y". |
| 536 | */ |
| 537 | CXCompletionChunk_CurrentParameter, |
| 538 | /** |
| 539 | * \brief A left parenthesis ('('), used to initiate a function call or |
| 540 | * signal the beginning of a function parameter list. |
| 541 | */ |
| 542 | CXCompletionChunk_LeftParen, |
| 543 | /** |
| 544 | * \brief A right parenthesis (')'), used to finish a function call or |
| 545 | * signal the end of a function parameter list. |
| 546 | */ |
| 547 | CXCompletionChunk_RightParen, |
| 548 | /** |
| 549 | * \brief A left bracket ('['). |
| 550 | */ |
| 551 | CXCompletionChunk_LeftBracket, |
| 552 | /** |
| 553 | * \brief A right bracket (']'). |
| 554 | */ |
| 555 | CXCompletionChunk_RightBracket, |
| 556 | /** |
| 557 | * \brief A left brace ('{'). |
| 558 | */ |
| 559 | CXCompletionChunk_LeftBrace, |
| 560 | /** |
| 561 | * \brief A right brace ('}'). |
| 562 | */ |
| 563 | CXCompletionChunk_RightBrace, |
| 564 | /** |
| 565 | * \brief A left angle bracket ('<'). |
| 566 | */ |
| 567 | CXCompletionChunk_LeftAngle, |
| 568 | /** |
| 569 | * \brief A right angle bracket ('>'). |
| 570 | */ |
| 571 | CXCompletionChunk_RightAngle, |
| 572 | /** |
| 573 | * \brief A comma separator (','). |
| 574 | */ |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 575 | CXCompletionChunk_Comma, |
| 576 | /** |
| 577 | * \brief Text that specifies the result type of a given result. |
| 578 | * |
| 579 | * This special kind of informative chunk is not meant to be inserted into |
| 580 | * the text buffer. Rather, it is meant to illustrate the type that an |
| 581 | * expression using the given completion string would have. |
| 582 | */ |
| 583 | CXCompletionChunk_ResultType |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 584 | }; |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 585 | |
| 586 | /** |
| 587 | * \brief Determine the kind of a particular chunk within a completion string. |
| 588 | * |
| 589 | * \param completion_string the completion string to query. |
| 590 | * |
| 591 | * \param chunk_number the 0-based index of the chunk in the completion string. |
| 592 | * |
| 593 | * \returns the kind of the chunk at the index \c chunk_number. |
| 594 | */ |
| 595 | CINDEX_LINKAGE enum CXCompletionChunkKind |
| 596 | clang_getCompletionChunkKind(CXCompletionString completion_string, |
| 597 | unsigned chunk_number); |
| 598 | |
| 599 | /** |
| 600 | * \brief Retrieve the text associated with a particular chunk within a |
| 601 | * completion string. |
| 602 | * |
| 603 | * \param completion_string the completion string to query. |
| 604 | * |
| 605 | * \param chunk_number the 0-based index of the chunk in the completion string. |
| 606 | * |
| 607 | * \returns the text associated with the chunk at index \c chunk_number. |
| 608 | */ |
| 609 | CINDEX_LINKAGE const char * |
| 610 | clang_getCompletionChunkText(CXCompletionString completion_string, |
| 611 | unsigned chunk_number); |
| 612 | |
| 613 | /** |
| 614 | * \brief Retrieve the completion string associated with a particular chunk |
| 615 | * within a completion string. |
| 616 | * |
| 617 | * \param completion_string the completion string to query. |
| 618 | * |
| 619 | * \param chunk_number the 0-based index of the chunk in the completion string. |
| 620 | * |
| 621 | * \returns the completion string associated with the chunk at index |
| 622 | * \c chunk_number, or NULL if that chunk is not represented by a completion |
| 623 | * string. |
| 624 | */ |
| 625 | CINDEX_LINKAGE CXCompletionString |
| 626 | clang_getCompletionChunkCompletionString(CXCompletionString completion_string, |
| 627 | unsigned chunk_number); |
| 628 | |
| 629 | /** |
| 630 | * \brief Retrieve the number of chunks in the given code-completion string. |
| 631 | */ |
| 632 | CINDEX_LINKAGE unsigned |
| 633 | clang_getNumCompletionChunks(CXCompletionString completion_string); |
| 634 | |
| 635 | /** |
Douglas Gregor | ec6762c | 2009-12-18 16:20:58 +0000 | [diff] [blame] | 636 | * \brief Contains the results of code-completion. |
| 637 | * |
| 638 | * This data structure contains the results of code completion, as |
| 639 | * produced by \c clang_codeComplete. Its contents must be freed by |
| 640 | * \c clang_disposeCodeCompleteResults. |
| 641 | */ |
| 642 | typedef struct { |
| 643 | /** |
| 644 | * \brief The code-completion results. |
| 645 | */ |
| 646 | CXCompletionResult *Results; |
| 647 | |
| 648 | /** |
| 649 | * \brief The number of code-completion results stored in the |
| 650 | * \c Results array. |
| 651 | */ |
| 652 | unsigned NumResults; |
| 653 | } CXCodeCompleteResults; |
| 654 | |
| 655 | /** |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 656 | * \brief Perform code completion at a given location in a source file. |
| 657 | * |
| 658 | * This function performs code completion at a particular file, line, and |
| 659 | * column within source code, providing results that suggest potential |
| 660 | * code snippets based on the context of the completion. The basic model |
| 661 | * for code completion is that Clang will parse a complete source file, |
| 662 | * performing syntax checking up to the location where code-completion has |
| 663 | * been requested. At that point, a special code-completion token is passed |
| 664 | * to the parser, which recognizes this token and determines, based on the |
| 665 | * current location in the C/Objective-C/C++ grammar and the state of |
| 666 | * semantic analysis, what completions to provide. These completions are |
Douglas Gregor | ec6762c | 2009-12-18 16:20:58 +0000 | [diff] [blame] | 667 | * returned via a new \c CXCodeCompleteResults structure. |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 668 | * |
| 669 | * Code completion itself is meant to be triggered by the client when the |
| 670 | * user types punctuation characters or whitespace, at which point the |
| 671 | * code-completion location will coincide with the cursor. For example, if \c p |
| 672 | * is a pointer, code-completion might be triggered after the "-" and then |
| 673 | * after the ">" in \c p->. When the code-completion location is afer the ">", |
| 674 | * the completion results will provide, e.g., the members of the struct that |
| 675 | * "p" points to. The client is responsible for placing the cursor at the |
| 676 | * beginning of the token currently being typed, then filtering the results |
| 677 | * based on the contents of the token. For example, when code-completing for |
| 678 | * the expression \c p->get, the client should provide the location just after |
| 679 | * the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the |
| 680 | * client can filter the results based on the current token text ("get"), only |
| 681 | * showing those results that start with "get". The intent of this interface |
Douglas Gregor | ec6762c | 2009-12-18 16:20:58 +0000 | [diff] [blame] | 682 | * is to separate the relatively high-latency acquisition of code-completion |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 683 | * results from the filtering of results on a per-character basis, which must |
| 684 | * have a lower latency. |
| 685 | * |
| 686 | * \param CIdx the \c CXIndex instance that will be used to perform code |
| 687 | * completion. |
| 688 | * |
Daniel Dunbar | 8506dde | 2009-12-03 01:54:28 +0000 | [diff] [blame] | 689 | * \param source_filename the name of the source file that should be parsed to |
| 690 | * perform code-completion. This source file must be the same as or include the |
| 691 | * filename described by \p complete_filename, or no code-completion results |
| 692 | * will be produced. NOTE: One can also specify NULL for this argument if the |
| 693 | * source file is included in command_line_args. |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 694 | * |
| 695 | * \param num_command_line_args the number of command-line arguments stored in |
| 696 | * \p command_line_args. |
| 697 | * |
| 698 | * \param command_line_args the command-line arguments to pass to the Clang |
| 699 | * compiler to build the given source file. This should include all of the |
| 700 | * necessary include paths, language-dialect switches, precompiled header |
| 701 | * includes, etc., but should not include any information specific to |
| 702 | * code completion. |
| 703 | * |
Douglas Gregor | 735df88 | 2009-12-02 09:21:34 +0000 | [diff] [blame] | 704 | * \param num_unsaved_files the number of unsaved file entries in \p |
| 705 | * unsaved_files. |
| 706 | * |
| 707 | * \param unsaved_files the files that have not yet been saved to disk |
| 708 | * but may be required for code completion, including the contents of |
| 709 | * those files. |
| 710 | * |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 711 | * \param complete_filename the name of the source file where code completion |
| 712 | * should be performed. In many cases, this name will be the same as the |
| 713 | * source filename. However, the completion filename may also be a file |
| 714 | * included by the source file, which is required when producing |
| 715 | * code-completion results for a header. |
| 716 | * |
| 717 | * \param complete_line the line at which code-completion should occur. |
| 718 | * |
| 719 | * \param complete_column the column at which code-completion should occur. |
| 720 | * Note that the column should point just after the syntactic construct that |
| 721 | * initiated code completion, and not in the middle of a lexical token. |
| 722 | * |
Douglas Gregor | ec6762c | 2009-12-18 16:20:58 +0000 | [diff] [blame] | 723 | * \returns if successful, a new CXCodeCompleteResults structure |
| 724 | * containing code-completion results, which should eventually be |
| 725 | * freed with \c clang_disposeCodeCompleteResults(). If code |
| 726 | * completion fails, returns NULL. |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 727 | */ |
Douglas Gregor | ec6762c | 2009-12-18 16:20:58 +0000 | [diff] [blame] | 728 | CINDEX_LINKAGE |
| 729 | CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx, |
| 730 | const char *source_filename, |
| 731 | int num_command_line_args, |
| 732 | const char **command_line_args, |
| 733 | unsigned num_unsaved_files, |
| 734 | struct CXUnsavedFile *unsaved_files, |
| 735 | const char *complete_filename, |
| 736 | unsigned complete_line, |
| 737 | unsigned complete_column); |
| 738 | |
| 739 | /** |
| 740 | * \brief Free the given set of code-completion results. |
| 741 | */ |
| 742 | CINDEX_LINKAGE |
| 743 | void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results); |
Douglas Gregor | 0c8296d | 2009-11-07 00:00:49 +0000 | [diff] [blame] | 744 | |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 745 | #ifdef __cplusplus |
| 746 | } |
| 747 | #endif |
| 748 | #endif |
| 749 | |