Lines Matching defs:TU
81 static int checkForErrors(CXTranslationUnit TU);
90 CXTranslationUnit *TU) {
92 *TU = clang_createTranslationUnit(Idx, file);
93 if (!*TU) {
577 CXTranslationUnit TU = clang_Cursor_getTranslationUnit(Cursor);
771 if (clang_isFileMultipleIncludeGuarded(TU, File))
929 void PrintDiagnostics(CXTranslationUnit TU) {
930 CXDiagnosticSet TUSet = clang_getDiagnosticSetFromTU(TU);
935 void PrintMemoryUsage(CXTranslationUnit TU) {
938 CXTUResourceUsage usage = clang_getCXTUResourceUsage(TU);
963 CXTranslationUnit TU;
1042 = clang_getLocation(Data->TU, file, curLine, curColumn);
1043 Ref = clang_getCursor(Data->TU, RefLoc);
1112 void PrintInclusionStack(CXTranslationUnit TU) {
1113 clang_getInclusions(TU, InclusionVisitor, NULL);
1286 static int perform_test_load(CXIndex Idx, CXTranslationUnit TU,
1315 fprintf(stderr, "Unknown filter for -test-load-tu: %s\n", filter);
1319 Data.TU = TU;
1326 clang_visitChildren(clang_getTranslationUnitCursor(TU), Visitor, &Data);
1330 PV(TU);
1332 PrintDiagnostics(TU);
1333 if (checkForErrors(TU) != 0) {
1334 clang_disposeTranslationUnit(TU);
1338 clang_disposeTranslationUnit(TU);
1346 CXTranslationUnit TU;
1352 if (!CreateTranslationUnit(Idx, file, &TU)) {
1357 result = perform_test_load(Idx, TU, filter, prefix, Visitor, PV, NULL);
1366 CXTranslationUnit TU;
1387 TU = clang_parseTranslationUnit(Idx, 0,
1392 if (!TU) {
1399 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV,
1410 CXTranslationUnit TU;
1429 TU = clang_parseTranslationUnit(Idx, 0,
1433 if (!TU) {
1440 if (checkForErrors(TU) != 0)
1449 if (clang_reparseTranslationUnit(TU,
1452 clang_defaultReparseOptions(TU))) {
1454 clang_disposeTranslationUnit(TU);
1460 if (checkForErrors(TU) != 0)
1464 result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV, NULL);
1475 static void print_cursor_file_scan(CXTranslationUnit TU, CXCursor cursor,
1491 CXTranslationUnit TU;
1504 if (!CreateTranslationUnit(Idx, ast_file, &TU))
1512 file = clang_getFile(TU, source_file);
1526 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
1529 print_cursor_file_scan(TU, prevCursor, start_line, start_col,
1541 clang_disposeTranslationUnit(TU);
1642 static int checkForErrors(CXTranslationUnit TU) {
1650 Num = clang_getNumDiagnostics(TU);
1652 Diag = clang_getDiagnostic(TU, i);
1875 CXTranslationUnit TU = 0;
1901 TU = clang_parseTranslationUnit(CIdx, 0,
1905 if (!TU) {
1910 if (clang_reparseTranslationUnit(TU, 0, 0, clang_defaultReparseOptions(TU))) {
1916 results = clang_codeCompleteAt(TU, filename, line, column,
1981 clang_disposeTranslationUnit(TU);
2001 CXTranslationUnit TU;
2034 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2041 if (!TU) {
2046 if (checkForErrors(TU) != 0)
2051 clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2052 clang_defaultReparseOptions(TU))) {
2053 clang_disposeTranslationUnit(TU);
2057 if (checkForErrors(TU) != 0)
2061 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2065 Cursor = clang_getCursor(TU,
2066 clang_getLocation(TU, file, Locations[Loc].line,
2069 if (checkForErrors(TU) != 0)
2118 numHeaders = clang_Module_getNumTopLevelHeaders(TU, mod);
2125 CXFile file = clang_Module_getTopLevelHeader(TU, mod, i);
2143 PrintDiagnostics(TU);
2144 clang_disposeTranslationUnit(TU);
2167 CXTranslationUnit TU;
2200 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2207 if (!TU) {
2212 if (checkForErrors(TU) != 0)
2217 clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2218 clang_defaultReparseOptions(TU))) {
2219 clang_disposeTranslationUnit(TU);
2223 if (checkForErrors(TU) != 0)
2227 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2231 Cursor = clang_getCursor(TU,
2232 clang_getLocation(TU, file, Locations[Loc].line,
2235 if (checkForErrors(TU) != 0)
2245 if (checkForErrors(TU) != 0)
2251 PrintDiagnostics(TU);
2252 clang_disposeTranslationUnit(TU);
2271 CXTranslationUnit TU;
2300 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2307 if (!TU) {
2312 if (checkForErrors(TU) != 0)
2317 clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
2318 clang_defaultReparseOptions(TU))) {
2319 clang_disposeTranslationUnit(TU);
2323 if (checkForErrors(TU) != 0)
2327 CXFile file = clang_getFile(TU, Filenames[FI]);
2331 if (checkForErrors(TU) != 0)
2336 clang_findIncludesInFile(TU, file, visitor);
2338 if (checkForErrors(TU) != 0)
2344 PrintDiagnostics(TU);
2345 clang_disposeTranslationUnit(TU);
2693 return (CXIdxClientContainer)"TU";
2876 CXTranslationUnit TU;
2881 if (!CreateTranslationUnit(Idx, ast_file, &TU))
2894 index_opts, TU);
2898 clang_disposeTranslationUnit(TU);
3106 CXTranslationUnit TU = 0;
3129 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
3135 if (!TU) {
3144 if (checkForErrors(TU) != 0) {
3151 if (clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
3152 clang_defaultReparseOptions(TU))) {
3160 if (checkForErrors(TU) != 0) {
3165 file = clang_getFile(TU, filename);
3172 startLoc = clang_getLocation(TU, file, line, column);
3180 endLoc = clang_getLocation(TU, file, second_line, second_column);
3189 clang_tokenize(TU, range, &tokens, &num_tokens);
3191 if (checkForErrors(TU) != 0) {
3197 clang_annotateTokens(TU, tokens, num_tokens, cursors);
3199 if (checkForErrors(TU) != 0) {
3206 CXString spelling = clang_getTokenSpelling(TU, tokens[i]);
3207 CXSourceRange extent = clang_getTokenExtent(TU, tokens[i]);
3231 clang_disposeTokens(TU, tokens, num_tokens);
3234 PrintDiagnostics(TU);
3235 clang_disposeTranslationUnit(TU);
3501 CXTranslationUnit TU;
3513 TU = clang_parseTranslationUnit(Idx, 0,
3521 if (!TU) {
3528 switch (clang_saveTranslationUnit(TU, filename,
3529 clang_defaultSaveOptions(TU))) {
3552 clang_disposeTranslationUnit(TU);
3743 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
3748 " c-index-test -test-load-tu <AST file> <symbol filter> "
3750 " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
3763 " c-index-test -test-inclusion-stack-tu <AST file>\n");
3808 if (argc > 2 && strcmp(argv[1], "-index-tu") == 0)
3812 else if (argc >= 4 && strncmp(argv[1], "-test-load-tu", 13) == 0) {
3845 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-tu") == 0)