Lines Matching +defs:file +defs:start

226 static unsigned CreateTranslationUnit(CXIndex Idx, const char *file,
228 enum CXErrorCode Err = clang_createTranslationUnit2(Idx, file, TU);
230 fprintf(stderr, "Unable to load translation unit from '%s'!\n", file);
306 /* Open the file that we're remapping to. */
309 fprintf(stderr, "error: cannot open file %s that we are remapping to\n",
317 /* Determine the length of the file we're remapping to. */
322 /* Read the contents of the file we're remapping to. */
326 fprintf(stderr, "error: unexpected %s reading 'to' file %s\n",
338 /* Close the file. */
341 /* Copy the file name that we're remapping from. */
356 return parse_remapped_files_with_opt("-remap-file=", argc, argv, start_arg,
377 sprintf(opt_name, "-remap-file-%d=", try_idx);
1217 CXFile file;
1218 clang_getExpansionLocation(Loc, &file, 0, 0, 0);
1219 source = clang_getFileName(file);
1246 CXFile file;
1260 clang_getFileLocation(clang_getDiagnosticLocation(Diagnostic), &file, 0, 0,
1262 if (!file)
1270 CXSourceLocation start = clang_getRangeStart(range);
1274 clang_getFileLocation(start, &start_file, &start_line, &start_column, 0);
1276 if (clang_equalLocations(start, end)) {
1278 if (start_file == file)
1283 if (start_file == file && end_file == file) {
1408 CXFile file;
1419 clang_getFileLocation(Loc, &file, 0, 0, 0);
1421 source = clang_getFileName(file);
1424 = clang_getLocation(Data->TU, file, curLine, curColumn);
1479 printf("file: %s\nincluded by:\n", clang_getCString(fname));
2077 int perform_test_load_tu(const char *file, const char *filter,
2087 if (!CreateTranslationUnit(Idx, file, &TU)) {
2355 CXFile file;
2374 file = clang_getFile(TU, source_file);
2388 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
2412 /* Parse file:line:column from the input string. Returns 0 on success, non-zero
2414 memory (that will be owned by the caller) to store the file name. */
2468 /* Copy the file name. */
2531 FILE *file) {
2542 fprintf(file, "{Optional ");
2545 file);
2546 fprintf(file, "}");
2551 fprintf(file, "{VerticalSpace }");
2557 fprintf(file, "{%s %s}",
2565 static void print_line_column(CXSourceLocation location, FILE *file) {
2568 fprintf(file, "%d:%d", line, column);
2572 CXSourceLocation start, FILE *file) {
2573 CXToken *token = clang_getToken(translation_unit, start);
2575 fprintf(file, "{");
2578 print_line_column(clang_getRangeStart(token_range), file);
2579 fprintf(file, "-");
2580 print_line_column(clang_getRangeEnd(token_range), file);
2584 fprintf(file, "}");
2590 FILE *file) {
2601 fprintf(file, "%s:", clang_getCString(ks));
2604 print_completion_string(completion_result->CompletionString, file);
2605 fprintf(file, " (%u)",
2612 fprintf(file, " (deprecated)");
2616 fprintf(file, " (unavailable)");
2620 fprintf(file, " (inaccessible)");
2628 fprintf(file, " (");
2631 fprintf(file, ", ");
2634 fprintf(file, "\"%s\"", clang_getCString(Annotation));
2637 fprintf(file, ")");
2645 fprintf(file, " (parent: %s '%s')",
2657 fprintf(file, "(brief comment: %s)", BriefCommentCString);
2666 fprintf(file, " (requires fix-it: ");
2668 file);
2669 fprintf(file, " to \"%s\")", clang_getCString(FixIt));
2673 fprintf(file, "\n");
2676 void print_completion_contexts(unsigned long long contexts, FILE *file) {
2677 fprintf(file, "Completion contexts:\n");
2679 fprintf(file, "Unknown\n");
2682 fprintf(file, "Any type\n");
2685 fprintf(file, "Any value\n");
2688 fprintf(file, "Objective-C object value\n");
2691 fprintf(file, "Objective-C selector value\n");
2694 fprintf(file, "C++ class type value\n");
2697 fprintf(file, "Dot member access\n");
2700 fprintf(file, "Arrow member access\n");
2703 fprintf(file, "Objective-C property access\n");
2706 fprintf(file, "Enum tag\n");
2709 fprintf(file, "Union tag\n");
2712 fprintf(file, "Struct tag\n");
2715 fprintf(file, "Class name\n");
2718 fprintf(file, "Namespace or namespace alias\n");
2721 fprintf(file, "Nested name specifier\n");
2724 fprintf(file, "Objective-C interface\n");
2727 fprintf(file, "Objective-C protocol\n");
2730 fprintf(file, "Objective-C category\n");
2733 fprintf(file, "Objective-C instance method\n");
2736 fprintf(file, "Objective-C class method\n");
2739 fprintf(file, "Objective-C selector name\n");
2742 fprintf(file, "Macro name\n");
2745 fprintf(file, "Natural language\n");
2967 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2968 if (!file)
2972 clang_getLocation(TU, file, Locations[Loc].line,
3051 CXFile file = clang_Module_getTopLevelHeader(TU, mod, i);
3052 CXString filename = clang_getFileName(file);
3205 while (strstr(argv[NumLocations+1], "-file-refs-at=") == argv[NumLocations+1])
3214 const char *input = argv[Loc + 1] + strlen("-file-refs-at=");
3262 CXFile file = clang_getFile(TU, Locations[Loc].filename);
3263 if (!file)
3267 clang_getLocation(TU, file, Locations[Loc].line,
3277 clang_findReferencesInFile(Cursor, file, visitor);
3314 while (strstr(argv[NumFilenames+1], "-file-includes-in=") == argv[NumFilenames+1])
3322 const char *input = argv[I + 1] + strlen("-file-includes-in=");
3323 /* Copy the file name. */
3369 CXFile file = clang_getFile(TU, Filenames[FI]);
3370 if (!file)
3378 clang_findIncludesInFile(TU, file, visitor);
3422 static void importedASTS_insert(ImportedASTFilesData *p, const char *file) {
3424 assert(p && file);
3426 if (strcmp(file, p->filenames[i]) == 0)
3429 p->filenames[p->num_files++] = strdup(file);
3469 static void printCXIndexFile(CXIdxClientFile file) {
3470 CXString filename = clang_getFileName((CXFile)file);
3479 CXIdxClientFile file;
3485 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
3490 if (!file) {
3494 filename = clang_getFileName((CXFile)file);
3504 printCXIndexFile(file);
3527 CXIdxClientFile file;
3534 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
3721 CXFile file, void *reserved) {
3727 index_data->main_filename = clang_getFileName(file);
3730 printCXIndexFile((CXIdxClientFile)file);
3733 return (CXIdxClientFile)file;
3744 printCXIndexFile((CXIdxClientFile)info->file);
3751 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file);
3761 return (CXIdxClientFile)info->file;
3771 CXString filename = clang_getFileName(info->file);
3777 printCXIndexFile((CXIdxClientFile)info->file);
3786 /* PCH file, the rest are not relevant. */
3790 return (CXIdxClientFile)info->file;
4246 CXFile file = 0;
4302 file = clang_getFile(TU, filename);
4303 if (!file) {
4304 fprintf(stderr, "file %s is not in this translation unit\n", filename);
4309 startLoc = clang_getLocation(TU, file, line, column);
4317 endLoc = clang_getLocation(TU, file, second_line, second_column);
4342 skipped_ranges = clang_getSkippedRanges(TU, file);
4428 printf("file %s not found in compilation db\n", argv[i+1]);
4436 fprintf(stderr, "should not get an empty compileCommand set for file"
4682 fprintf(stderr, "Unable to write PCH file %s: translation errors\n",
4688 fprintf(stderr, "Unable to write PCH file %s: invalid translation unit\n",
4695 fprintf(stderr, "Unable to write PCH file %s: unknown error \n", filename);
4855 fprintf(stderr, "Trouble deserializing file (%s): %s\n",
4967 " c-index-test -file-refs-at=<site> <compiler arguments>\n"
4968 " c-index-test -file-includes-in=<filename> <compiler arguments>\n");
4970 " c-index-test -index-file [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4971 " c-index-test -index-file-full [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4972 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
4974 " c-index-test -test-file-scan <AST file> <source file> "
4977 " c-index-test -test-load-tu <AST file> <symbol filter> "
4979 " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
4992 " c-index-test -test-inclusion-stack-tu <AST file>\n");
5002 " c-index-test -print-usr-file <file>\n");
5008 " c-index-test -write-pch <file> <compiler arguments>\n"
5013 " c-index-test -read-diagnostics <file>\n\n");
5044 if (argc > 2 && strstr(argv[1], "-file-refs-at=") == argv[1])
5046 if (argc > 2 && strstr(argv[1], "-file-includes-in=") == argv[1])
5048 if (argc > 2 && strcmp(argv[1], "-index-file") == 0)
5050 if (argc > 2 && strcmp(argv[1], "-index-file-full") == 0)
5081 else if (argc >= 3 && strcmp(argv[1], "-single-file-parse") == 0)
5085 else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
5133 else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0)