Lines Matching defs:TU
84 static int checkForErrors(CXTranslationUnit TU);
117 CXTranslationUnit *TU) {
118 enum CXErrorCode Err = clang_createTranslationUnit2(Idx, file, TU);
122 *TU = 0;
643 CXTranslationUnit TU = clang_Cursor_getTranslationUnit(Cursor);
839 if (clang_isFileMultipleIncludeGuarded(TU, File))
996 void PrintDiagnostics(CXTranslationUnit TU) {
997 TU);
1002 void PrintMemoryUsage(CXTranslationUnit TU) {
1005 CXTUResourceUsage usage = clang_getCXTUResourceUsage(TU);
1030 CXTranslationUnit TU;
1109 = clang_getLocation(Data->TU, file, curLine, curColumn);
1110 Ref = clang_getCursor(Data->TU, RefLoc);
1179 void PrintInclusionStack(CXTranslationUnit TU) {
1180 clang_getInclusions(TU, InclusionVisitor, NULL);
1388 static int perform_test_load(CXIndex Idx, CXTranslationUnit TU,
1417 fprintf(stderr, "Unknown filter for -test-load-tu: %s\n", filter);
1421 Data.TU = TU;
1424 clang_visitChildren(clang_getTranslationUnitCursor(TU), Visitor, &Data);
1428 PV(TU);
1430 PrintDiagnostics(TU);
1431 if (checkForErrors(TU) != 0) {
1432 clang_disposeTranslationUnit(TU);
1436 clang_disposeTranslationUnit(TU);
1444 CXTranslationUnit TU;
1450 if (!CreateTranslationUnit(Idx, file, &TU)) {
1455 result = perform_test_load(Idx, TU, filter, prefix, Visitor, PV, NULL);
1464 CXTranslationUnit TU;
1490 getDefaultParsingOptions(), &TU);
1499 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV,
1510 CXTranslationUnit TU;
1543 0, 0, getDefaultParsingOptions(), &TU);
1552 if (checkForErrors(TU) != 0)
1564 clang_disposeTranslationUnit(TU);
1570 TU,
1573 clang_defaultReparseOptions(TU));
1577 clang_disposeTranslationUnit(TU);
1583 if (checkForErrors(TU) != 0)
1587 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV, NULL);
1598 static void print_cursor_file_scan(CXTranslationUnit TU, CXCursor cursor,
1614 CXTranslationUnit TU;
1627 if (!CreateTranslationUnit(Idx, ast_file, &TU))
1635 file = clang_getFile(TU, source_file);
1649 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
1652 print_cursor_file_scan(TU, prevCursor, start_line, start_col,
1664 clang_disposeTranslationUnit(TU);
1765 static int checkForErrors(CXTranslationUnit TU) {
1773 Num = clang_getNumDiagnostics(TU);
1775 Diag = clang_getDiagnostic(TU, i);
1999 CXTranslationUnit TU;
2028 0, 0, getDefaultParsingOptions(), &TU);
2035 Err = clang_reparseTranslationUnit(TU, 0, 0,
2036 clang_defaultReparseOptions(TU));
2041 clang_disposeTranslationUnit(TU);
2046 results = clang_codeCompleteAt(TU, filename, line, column,
2111 clang_disposeTranslationUnit(TU);
2132 CXTranslationUnit TU;
2170 getDefaultParsingOptions(), &TU);
2177 if (checkForErrors(TU) != 0)
2182 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2183 clang_defaultReparseOptions(TU));
2186 clang_disposeTranslationUnit(TU);
2191 if (checkForErrors(TU) != 0)
2195 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2199 Cursor = clang_getCursor(TU,
2200 clang_getLocation(TU, file, Locations[Loc].line,
2203 if (checkForErrors(TU) != 0)
2253 numHeaders = clang_Module_getNumTopLevelHeaders(TU, mod);
2260 CXFile file = clang_Module_getTopLevelHeader(TU, mod, i);
2278 PrintDiagnostics(TU);
2279 clang_disposeTranslationUnit(TU);
2303 CXTranslationUnit TU;
2341 getDefaultParsingOptions(), &TU);
2345 clang_disposeTranslationUnit(TU);
2349 if (checkForErrors(TU) != 0)
2354 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2355 clang_defaultReparseOptions(TU));
2358 clang_disposeTranslationUnit(TU);
2363 if (checkForErrors(TU) != 0)
2367 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2371 Cursor = clang_getCursor(TU,
2372 clang_getLocation(TU, file, Locations[Loc].line,
2375 if (checkForErrors(TU) != 0)
2385 if (checkForErrors(TU) != 0)
2391 PrintDiagnostics(TU);
2392 clang_disposeTranslationUnit(TU);
2412 CXTranslationUnit TU;
2446 Repeats > 1 ? 0 : num_unsaved_files, getDefaultParsingOptions(), &TU);
2451 clang_disposeTranslationUnit(TU);
2455 if (checkForErrors(TU) != 0)
2460 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2461 clang_defaultReparseOptions(TU));
2464 clang_disposeTranslationUnit(TU);
2469 if (checkForErrors(TU) != 0)
2473 CXFile file = clang_getFile(TU, Filenames[FI]);
2477 if (checkForErrors(TU) != 0)
2482 clang_findIncludesInFile(TU, file, visitor);
2484 if (checkForErrors(TU) != 0)
2490 PrintDiagnostics(TU);
2491 clang_disposeTranslationUnit(TU);
2547 CXTranslationUnit TU;
2829 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file);
2878 return (CXIdxClientContainer)"TU";
3047 index_data.TU = NULL;
3069 CXTranslationUnit TU;
3074 if (!CreateTranslationUnit(Idx, ast_file, &TU))
3084 index_data.TU = TU;
3089 index_opts, TU);
3093 clang_disposeTranslationUnit(TU);
3302 CXTranslationUnit TU = 0;
3332 getDefaultParsingOptions(), &TU);
3343 if (checkForErrors(TU) != 0) {
3350 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
3351 clang_defaultReparseOptions(TU));
3361 if (checkForErrors(TU) != 0) {
3366 file = clang_getFile(TU, filename);
3373 startLoc = clang_getLocation(TU, file, line, column);
3381 endLoc = clang_getLocation(TU, file, second_line, second_column);
3390 clang_tokenize(TU, range, &tokens, &num_tokens);
3392 if (checkForErrors(TU) != 0) {
3398 clang_annotateTokens(TU, tokens, num_tokens, cursors);
3400 if (checkForErrors(TU) != 0) {
3405 skipped_ranges = clang_getSkippedRanges(TU, file);
3420 CXString spelling = clang_getTokenSpelling(TU, tokens[i]);
3421 CXSourceRange extent = clang_getTokenExtent(TU, tokens[i]);
3445 clang_disposeTokens(TU, tokens, num_tokens);
3448 PrintDiagnostics(TU);
3449 clang_disposeTranslationUnit(TU);
3715 CXTranslationUnit TU;
3734 &TU);
3739 clang_disposeTranslationUnit(TU);
3744 switch (clang_saveTranslationUnit(TU, filename,
3745 clang_defaultSaveOptions(TU))) {
3768 clang_disposeTranslationUnit(TU);
3965 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
3970 " c-index-test -test-load-tu <AST file> <symbol filter> "
3972 " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
3985 " c-index-test -test-inclusion-stack-tu <AST file>\n");
4032 if (argc > 2 && strcmp(argv[1], "-index-tu") == 0)
4036 else if (argc >= 4 && strncmp(argv[1], "-test-load-tu", 13) == 0) {
4069 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-tu") == 0)