Lines Matching refs:TU

84 static int checkForErrors(CXTranslationUnit TU);
117 CXTranslationUnit *TU) { in CreateTranslationUnit() argument
118 enum CXErrorCode Err = clang_createTranslationUnit2(Idx, file, TU); in CreateTranslationUnit()
122 *TU = 0; in CreateTranslationUnit()
643 CXTranslationUnit TU = clang_Cursor_getTranslationUnit(Cursor); in PrintCursor() local
866 if (clang_isFileMultipleIncludeGuarded(TU, File)) in PrintCursor()
1023 void PrintDiagnostics(CXTranslationUnit TU) { in PrintDiagnostics() argument
1024 CXDiagnosticSet TUSet = clang_getDiagnosticSetFromTU(TU); in PrintDiagnostics()
1029 void PrintMemoryUsage(CXTranslationUnit TU) { in PrintMemoryUsage() argument
1032 CXTUResourceUsage usage = clang_getCXTUResourceUsage(TU); in PrintMemoryUsage()
1057 CXTranslationUnit TU; member
1136 = clang_getLocation(Data->TU, file, curLine, curColumn); in FunctionScanVisitor()
1137 Ref = clang_getCursor(Data->TU, RefLoc); in FunctionScanVisitor()
1206 void PrintInclusionStack(CXTranslationUnit TU) { in PrintInclusionStack() argument
1207 clang_getInclusions(TU, InclusionVisitor, NULL); in PrintInclusionStack()
1452 static int perform_test_load(CXIndex Idx, CXTranslationUnit TU, in perform_test_load() argument
1485 Data.TU = TU; in perform_test_load()
1488 clang_visitChildren(clang_getTranslationUnitCursor(TU), Visitor, &Data); in perform_test_load()
1492 PV(TU); in perform_test_load()
1494 PrintDiagnostics(TU); in perform_test_load()
1495 if (checkForErrors(TU) != 0) { in perform_test_load()
1496 clang_disposeTranslationUnit(TU); in perform_test_load()
1500 clang_disposeTranslationUnit(TU); in perform_test_load()
1508 CXTranslationUnit TU; in perform_test_load_tu() local
1514 if (!CreateTranslationUnit(Idx, file, &TU)) { in perform_test_load_tu()
1519 result = perform_test_load(Idx, TU, filter, prefix, Visitor, PV, NULL); in perform_test_load_tu()
1528 CXTranslationUnit TU; in perform_test_load_source() local
1554 getDefaultParsingOptions(), &TU); in perform_test_load_source()
1563 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV, in perform_test_load_source()
1574 CXTranslationUnit TU; in perform_test_reparse_source() local
1607 0, 0, getDefaultParsingOptions(), &TU); in perform_test_reparse_source()
1616 if (checkForErrors(TU) != 0) in perform_test_reparse_source()
1628 clang_disposeTranslationUnit(TU); in perform_test_reparse_source()
1634 TU, in perform_test_reparse_source()
1637 clang_defaultReparseOptions(TU)); in perform_test_reparse_source()
1641 clang_disposeTranslationUnit(TU); in perform_test_reparse_source()
1647 if (checkForErrors(TU) != 0) in perform_test_reparse_source()
1651 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV, NULL); in perform_test_reparse_source()
1662 static void print_cursor_file_scan(CXTranslationUnit TU, CXCursor cursor, in print_cursor_file_scan() argument
1678 CXTranslationUnit TU; in perform_file_scan() local
1691 if (!CreateTranslationUnit(Idx, ast_file, &TU)) in perform_file_scan()
1696 clang_disposeTranslationUnit(TU); in perform_file_scan()
1700 file = clang_getFile(TU, source_file); in perform_file_scan()
1714 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col)); in perform_file_scan()
1717 print_cursor_file_scan(TU, prevCursor, start_line, start_col, in perform_file_scan()
1729 clang_disposeTranslationUnit(TU); in perform_file_scan()
1830 static int checkForErrors(CXTranslationUnit TU) { in checkForErrors() argument
1838 Num = clang_getNumDiagnostics(TU); in checkForErrors()
1840 Diag = clang_getDiagnostic(TU, i); in checkForErrors()
2064 CXTranslationUnit TU; in perform_code_completion() local
2093 0, 0, getDefaultParsingOptions(), &TU); in perform_code_completion()
2100 Err = clang_reparseTranslationUnit(TU, 0, 0, in perform_code_completion()
2101 clang_defaultReparseOptions(TU)); in perform_code_completion()
2106 clang_disposeTranslationUnit(TU); in perform_code_completion()
2111 results = clang_codeCompleteAt(TU, filename, line, column, in perform_code_completion()
2176 clang_disposeTranslationUnit(TU); in perform_code_completion()
2197 CXTranslationUnit TU; in inspect_cursor_at() local
2235 getDefaultParsingOptions(), &TU); in inspect_cursor_at()
2242 if (checkForErrors(TU) != 0) in inspect_cursor_at()
2247 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, in inspect_cursor_at()
2248 clang_defaultReparseOptions(TU)); in inspect_cursor_at()
2251 clang_disposeTranslationUnit(TU); in inspect_cursor_at()
2256 if (checkForErrors(TU) != 0) in inspect_cursor_at()
2260 CXFile file = clang_getFile(TU, Locations[Loc].filename); in inspect_cursor_at()
2264 Cursor = clang_getCursor(TU, in inspect_cursor_at()
2265 clang_getLocation(TU, file, Locations[Loc].line, in inspect_cursor_at()
2268 if (checkForErrors(TU) != 0) in inspect_cursor_at()
2318 numHeaders = clang_Module_getNumTopLevelHeaders(TU, mod); in inspect_cursor_at()
2325 CXFile file = clang_Module_getTopLevelHeader(TU, mod, i); in inspect_cursor_at()
2343 PrintDiagnostics(TU); in inspect_cursor_at()
2344 clang_disposeTranslationUnit(TU); in inspect_cursor_at()
2368 CXTranslationUnit TU; in find_file_refs_at() local
2406 getDefaultParsingOptions(), &TU); in find_file_refs_at()
2410 clang_disposeTranslationUnit(TU); in find_file_refs_at()
2414 if (checkForErrors(TU) != 0) in find_file_refs_at()
2419 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, in find_file_refs_at()
2420 clang_defaultReparseOptions(TU)); in find_file_refs_at()
2423 clang_disposeTranslationUnit(TU); in find_file_refs_at()
2428 if (checkForErrors(TU) != 0) in find_file_refs_at()
2432 CXFile file = clang_getFile(TU, Locations[Loc].filename); in find_file_refs_at()
2436 Cursor = clang_getCursor(TU, in find_file_refs_at()
2437 clang_getLocation(TU, file, Locations[Loc].line, in find_file_refs_at()
2440 if (checkForErrors(TU) != 0) in find_file_refs_at()
2450 if (checkForErrors(TU) != 0) in find_file_refs_at()
2456 PrintDiagnostics(TU); in find_file_refs_at()
2457 clang_disposeTranslationUnit(TU); in find_file_refs_at()
2477 CXTranslationUnit TU; in find_file_includes_in() local
2511 Repeats > 1 ? 0 : num_unsaved_files, getDefaultParsingOptions(), &TU); in find_file_includes_in()
2516 clang_disposeTranslationUnit(TU); in find_file_includes_in()
2520 if (checkForErrors(TU) != 0) in find_file_includes_in()
2525 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, in find_file_includes_in()
2526 clang_defaultReparseOptions(TU)); in find_file_includes_in()
2529 clang_disposeTranslationUnit(TU); in find_file_includes_in()
2534 if (checkForErrors(TU) != 0) in find_file_includes_in()
2538 CXFile file = clang_getFile(TU, Filenames[FI]); in find_file_includes_in()
2542 if (checkForErrors(TU) != 0) in find_file_includes_in()
2547 clang_findIncludesInFile(TU, file, visitor); in find_file_includes_in()
2549 if (checkForErrors(TU) != 0) in find_file_includes_in()
2555 PrintDiagnostics(TU); in find_file_includes_in()
2556 clang_disposeTranslationUnit(TU); in find_file_includes_in()
2612 CXTranslationUnit TU; member
2894 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file); in index_ppIncludedFile()
3112 index_data.TU = NULL; in index_compile_args()
3134 CXTranslationUnit TU; in index_ast_file() local
3139 if (!CreateTranslationUnit(Idx, ast_file, &TU)) in index_ast_file()
3149 index_data.TU = TU; in index_ast_file()
3154 index_opts, TU); in index_ast_file()
3158 clang_disposeTranslationUnit(TU); in index_ast_file()
3367 CXTranslationUnit TU = 0; in perform_token_annotation() local
3397 getDefaultParsingOptions(), &TU); in perform_token_annotation()
3408 if (checkForErrors(TU) != 0) { in perform_token_annotation()
3415 Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, in perform_token_annotation()
3416 clang_defaultReparseOptions(TU)); in perform_token_annotation()
3426 if (checkForErrors(TU) != 0) { in perform_token_annotation()
3431 file = clang_getFile(TU, filename); in perform_token_annotation()
3438 startLoc = clang_getLocation(TU, file, line, column); in perform_token_annotation()
3446 endLoc = clang_getLocation(TU, file, second_line, second_column); in perform_token_annotation()
3455 clang_tokenize(TU, range, &tokens, &num_tokens); in perform_token_annotation()
3457 if (checkForErrors(TU) != 0) { in perform_token_annotation()
3463 clang_annotateTokens(TU, tokens, num_tokens, cursors); in perform_token_annotation()
3465 if (checkForErrors(TU) != 0) { in perform_token_annotation()
3470 skipped_ranges = clang_getSkippedRanges(TU, file); in perform_token_annotation()
3485 CXString spelling = clang_getTokenSpelling(TU, tokens[i]); in perform_token_annotation()
3486 CXSourceRange extent = clang_getTokenExtent(TU, tokens[i]); in perform_token_annotation()
3510 clang_disposeTokens(TU, tokens, num_tokens); in perform_token_annotation()
3513 PrintDiagnostics(TU); in perform_token_annotation()
3514 clang_disposeTranslationUnit(TU); in perform_token_annotation()
3780 CXTranslationUnit TU; in write_pch_file() local
3799 &TU); in write_pch_file()
3804 clang_disposeTranslationUnit(TU); in write_pch_file()
3809 switch (clang_saveTranslationUnit(TU, filename, in write_pch_file()
3810 clang_defaultSaveOptions(TU))) { in write_pch_file()
3833 clang_disposeTranslationUnit(TU); in write_pch_file()