Home | History | Annotate | Download | only in c-index-test

Lines Matching defs:File

110 static void PrintExtent(FILE *out, unsigned begin_line, unsigned begin_column,
116 static unsigned CreateTranslationUnit(CXIndex Idx, const char *file,
118 enum CXErrorCode Err = clang_createTranslationUnit2(Idx, file, TU);
120 fprintf(stderr, "Unable to load translation unit from '%s'!\n", file);
172 FILE *to_file;
183 /* Open the file that we're remapping to. */
186 fprintf(stderr, "error: cannot open file %s that we are remapping to\n",
194 /* Determine the length of the file we're remapping to. */
199 /* Read the contents of the file we're remapping to. */
202 fprintf(stderr, "error: unexpected %s reading 'to' file %s\n",
214 /* Close the file. */
217 /* Copy the file name that we're remapping from. */
231 return parse_remapped_files_with_opt("-remap-file=", argc, argv, start_arg,
252 sprintf(opt_name, "-remap-file-%d=", try_idx);
834 CXFile File = clang_getIncludedFile(Cursor);
835 CXString Included = clang_getFileName(File);
839 if (clang_isFileMultipleIncludeGuarded(TU, File))
908 CXFile file;
909 clang_getExpansionLocation(Loc, &file, 0, 0, 0);
910 source = clang_getFileName(file);
929 FILE *out = stderr;
930 CXFile file;
945 &file, 0, 0, 0);
946 if (!file)
963 if (start_file == file)
968 if (start_file == file && end_file == file) {
1093 CXFile file;
1104 clang_getSpellingLocation(Loc, &file, 0, 0, 0);
1106 source = clang_getFileName(file);
1109 = clang_getLocation(Data->TU, file, curLine, curColumn);
1164 printf("file: %s\nincluded by:\n", clang_getCString(fname));
1440 int perform_test_load_tu(const char *file, const char *filter,
1450 if (!CreateTranslationUnit(Idx, file, &TU)) {
1615 FILE *fp;
1617 CXFile file;
1635 file = clang_getFile(TU, source_file);
1649 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
1673 /* Parse file:line:column from the input string. Returns 0 on success, non-zero
1675 memory (that will be owned by the caller) to store the file name. */
1729 /* Copy the file name. */
1791 FILE *file) {
1802 fprintf(file, "{Optional ");
1805 file);
1806 fprintf(file, "}");
1811 fprintf(file, "{VerticalSpace }");
1817 fprintf(file, "{%s %s}",
1826 FILE *file) {
1834 fprintf(file, "%s:", clang_getCString(ks));
1837 print_completion_string(completion_result->CompletionString, file);
1838 fprintf(file, " (%u)",
1845 fprintf(file, " (deprecated)");
1849 fprintf(file, " (unavailable)");
1853 fprintf(file, " (inaccessible)");
1861 fprintf(file, " (");
1864 fprintf(file, ", ");
1865 fprintf(file, "\"%s\"",
1869 fprintf(file, ")");
1877 fprintf(file, " (parent: %s '%s')",
1889 fprintf(file, "(brief comment: %s)", BriefCommentCString);
1893 fprintf(file, "\n");
1896 void print_completion_contexts(unsigned long long contexts, FILE *file) {
1897 fprintf(file, "Completion contexts:\n");
1899 fprintf(file, "Unknown\n");
1902 fprintf(file, "Any type\n");
1905 fprintf(file, "Any value\n");
1908 fprintf(file, "Objective-C object value\n");
1911 fprintf(file, "Objective-C selector value\n");
1914 fprintf(file, "C++ class type value\n");
1917 fprintf(file, "Dot member access\n");
1920 fprintf(file, "Arrow member access\n");
1923 fprintf(file, "Objective-C property access\n");
1926 fprintf(file, "Enum tag\n");
1929 fprintf(file, "Union tag\n");
1932 fprintf(file, "Struct tag\n");
1935 fprintf(file, "Class name\n");
1938 fprintf(file, "Namespace or namespace alias\n");
1941 fprintf(file, "Nested name specifier\n");
1944 fprintf(file, "Objective-C interface\n");
1947 fprintf(file, "Objective-C protocol\n");
1950 fprintf(file, "Objective-C category\n");
1953 fprintf(file, "Objective-C instance method\n");
1956 fprintf(file, "Objective-C class method\n");
1959 fprintf(file, "Objective-C selector name\n");
1962 fprintf(file, "Macro name\n");
1965 fprintf(file, "Natural language\n");
2195 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2196 if (!file)
2200 clang_getLocation(TU, file, Locations[Loc].line,
2260 CXFile file = clang_Module_getTopLevelHeader(TU, mod, i);
2261 CXString filename = clang_getFileName(file);
2311 while (strstr(argv[NumLocations+1], "-file-refs-at=") == argv[NumLocations+1])
2319 const char *input = argv[Loc + 1] + strlen("-file-refs-at=");
2367 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2368 if (!file)
2372 clang_getLocation(TU, file, Locations[Loc].line,
2382 clang_findReferencesInFile(Cursor, file, visitor);
2419 while (strstr(argv[NumFilenames+1], "-file-includes-in=") == argv[NumFilenames+1])
2426 const char *input = argv[I + 1] + strlen("-file-includes-in=");
2427 /* Copy the file name. */
2473 CXFile file = clang_getFile(TU, Filenames[FI]);
2474 if (!file)
2482 clang_findIncludesInFile(TU, file, visitor);
2524 static void importedASTS_insert(ImportedASTFilesData *p, const char *file) {
2526 assert(p && file);
2528 if (strcmp(file, p->filenames[i]) == 0)
2531 p->filenames[p->num_files++] = strdup(file);
2571 static void printCXIndexFile(CXIdxClientFile file) {
2572 CXString filename = clang_getFileName((CXFile)file);
2581 CXIdxClientFile file;
2586 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
2591 if (!file) {
2595 filename = clang_getFileName((CXFile)file);
2604 printCXIndexFile(file);
2627 CXIdxClientFile file;
2634 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
2796 CXFile file, void *reserved) {
2803 filename = clang_getFileName(file);
2808 printCXIndexFile((CXIdxClientFile)file);
2811 return (CXIdxClientFile)file;
2822 printCXIndexFile((CXIdxClientFile)info->file);
2829 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file);
2839 return (CXIdxClientFile)info->file;
2849 CXString filename = clang_getFileName(info->file);
2855 printCXIndexFile((CXIdxClientFile)info->file);
2864 /* PCH file, the rest are not relevant. */
2868 return (CXIdxClientFile)info->file;
3310 CXFile file = 0;
3366 file = clang_getFile(TU, filename);
3367 if (!file) {
3368 fprintf(stderr, "file %s is not in this translation unit\n", filename);
3373 startLoc = clang_getLocation(TU, file, line, column);
3381 endLoc = clang_getLocation(TU, file, second_line, second_column);
3405 skipped_ranges = clang_getSkippedRanges(TU, file);
3490 printf("file %s not found in compilation db\n", argv[i+1]);
3498 fprintf(stderr, "should not get an empty compileCommand set for file"
3671 FILE *fp = fopen(file_name, "r");
3750 fprintf(stderr, "Unable to write PCH file %s: translation errors\n",
3756 fprintf(stderr, "Unable to write PCH file %s: invalid translation unit\n",
3763 fprintf(stderr, "Unable to write PCH file %s: unknown error \n", filename);
3780 case CXLoadDiag_CannotLoad: return "Cannot Load File";
3783 case CXLoadDiag_InvalidFile: return "Invalid File";
3811 CXFile File;
3815 clang_getExpansionLocation(L, &File, &line, &column, &offset);
3816 FileName = clang_getFileName(File);
3868 CXFile File;
3875 clang_getExpansionLocation(DiagLoc, &File, &line, &column, &offset);
3876 FileName = clang_getFileName(File);
3922 fprintf(stderr, "Trouble deserializing file (%s): %s\n",
3960 " c-index-test -file-refs-at=<site> <compiler arguments>\n"
3961 " c-index-test -file-includes-in=<filename> <compiler arguments>\n");
3963 " c-index-test -index-file [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
3964 " c-index-test -index-file-full [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
3965 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
3967 " c-index-test -test-file-scan <AST file> <source file> "
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");
3992 " c-index-test -print-usr-file <file>\n"
3993 " c-index-test -write-pch <file> <compiler arguments>\n");
3999 " c-index-test -read-diagnostics <file>\n\n");
4024 if (argc > 2 && strstr(argv[1], "-file-refs-at=") == argv[1])
4026 if (argc > 2 && strstr(argv[1], "-file-includes-in=") == argv[1])
4028 if (argc > 2 && strcmp(argv[1], "-index-file") == 0)
4030 if (argc > 2 && strcmp(argv[1], "-index-file-full") == 0)
4061 else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
4092 else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0)