Lines Matching defs:File
116 static void PrintExtent(FILE *out, unsigned begin_line, unsigned begin_column,
122 static unsigned CreateTranslationUnit(CXIndex Idx, const char *file,
124 enum CXErrorCode Err = clang_createTranslationUnit2(Idx, file, TU);
126 fprintf(stderr, "Unable to load translation unit from '%s'!\n", file);
178 FILE *to_file;
189 /* Open the file that we're remapping to. */
192 fprintf(stderr, "error: cannot open file %s that we are remapping to\n",
200 /* Determine the length of the file we're remapping to. */
205 /* Read the contents of the file we're remapping to. */
208 fprintf(stderr, "error: unexpected %s reading 'to' file %s\n",
220 /* Close the file. */
223 /* Copy the file name that we're remapping from. */
237 return parse_remapped_files_with_opt("-remap-file=", argc, argv, start_arg,
258 sprintf(opt_name, "-remap-file-%d=", try_idx);
891 CXFile File = clang_getIncludedFile(Cursor);
892 CXString Included = clang_getFileName(File);
896 if (clang_isFileMultipleIncludeGuarded(TU, File))
966 CXFile file;
967 clang_getExpansionLocation(Loc, &file, 0, 0, 0);
968 source = clang_getFileName(file);
987 FILE *out = stderr;
988 CXFile file;
1003 &file, 0, 0, 0);
1004 if (!file)
1021 if (start_file == file)
1026 if (start_file == file && end_file == file) {
1151 CXFile file;
1162 clang_getSpellingLocation(Loc, &file, 0, 0, 0);
1164 source = clang_getFileName(file);
1167 = clang_getLocation(Data->TU, file, curLine, curColumn);
1222 printf("file: %s\nincluded by:\n", clang_getCString(fname));
1598 int perform_test_load_tu(const char *file, const char *filter,
1608 if (!CreateTranslationUnit(Idx, file, &TU)) {
1794 FILE *fp;
1796 CXFile file;
1815 file = clang_getFile(TU, source_file);
1829 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
1853 /* Parse file:line:column from the input string. Returns 0 on success, non-zero
1855 memory (that will be owned by the caller) to store the file name. */
1909 /* Copy the file name. */
1971 FILE *file) {
1982 fprintf(file, "{Optional ");
1985 file);
1986 fprintf(file, "}");
1991 fprintf(file, "{VerticalSpace }");
1997 fprintf(file, "{%s %s}",
2006 FILE *file) {
2015 fprintf(file, "%s:", clang_getCString(ks));
2018 print_completion_string(completion_result->CompletionString, file);
2019 fprintf(file, " (%u)",
2026 fprintf(file, " (deprecated)");
2030 fprintf(file, " (unavailable)");
2034 fprintf(file, " (inaccessible)");
2042 fprintf(file, " (");
2045 fprintf(file, ", ");
2048 fprintf(file, "\"%s\"", clang_getCString(Annotation));
2051 fprintf(file, ")");
2059 fprintf(file, " (parent: %s '%s')",
2071 fprintf(file, "(brief comment: %s)", BriefCommentCString);
2075 fprintf(file, "\n");
2078 void print_completion_contexts(unsigned long long contexts, FILE *file) {
2079 fprintf(file, "Completion contexts:\n");
2081 fprintf(file, "Unknown\n");
2084 fprintf(file, "Any type\n");
2087 fprintf(file, "Any value\n");
2090 fprintf(file, "Objective-C object value\n");
2093 fprintf(file, "Objective-C selector value\n");
2096 fprintf(file, "C++ class type value\n");
2099 fprintf(file, "Dot member access\n");
2102 fprintf(file, "Arrow member access\n");
2105 fprintf(file, "Objective-C property access\n");
2108 fprintf(file, "Enum tag\n");
2111 fprintf(file, "Union tag\n");
2114 fprintf(file, "Struct tag\n");
2117 fprintf(file, "Class name\n");
2120 fprintf(file, "Namespace or namespace alias\n");
2123 fprintf(file, "Nested name specifier\n");
2126 fprintf(file, "Objective-C interface\n");
2129 fprintf(file, "Objective-C protocol\n");
2132 fprintf(file, "Objective-C category\n");
2135 fprintf(file, "Objective-C instance method\n");
2138 fprintf(file, "Objective-C class method\n");
2141 fprintf(file, "Objective-C selector name\n");
2144 fprintf(file, "Macro name\n");
2147 fprintf(file, "Natural language\n");
2362 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2363 if (!file)
2367 clang_getLocation(TU, file, Locations[Loc].line,
2443 CXFile file
2444 CXString filename = clang_getFileName(file);
2591 while (strstr(argv[NumLocations+1], "-file-refs-at=") == argv[NumLocations+1])
2599 const char *input = argv[Loc + 1] + strlen("-file-refs-at=");
2647 CXFile file = clang_getFile(TU, Locations[Loc].filename);
2648 if (!file)
2652 clang_getLocation(TU, file, Locations[Loc].line,
2662 clang_findReferencesInFile(Cursor, file, visitor);
2699 while (strstr(argv[NumFilenames+1], "-file-includes-in=") == argv[NumFilenames+1])
2706 const char *input = argv[I + 1] + strlen("-file-includes-in=");
2707 /* Copy the file name. */
2753 CXFile file = clang_getFile(TU, Filenames[FI]);
2754 if (!file)
2762 clang_findIncludesInFile(TU, file, visitor);
2804 static void importedASTS_insert(ImportedASTFilesData *p, const char *file) {
2806 assert(p && file);
2808 if (strcmp(file, p->filenames[i]) == 0)
2811 p->filenames[p->num_files++] = strdup(file);
2851 static void printCXIndexFile(CXIdxClientFile file) {
2852 CXString filename = clang_getFileName((CXFile)file);
2861 CXIdxClientFile file;
2866 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
2871 if (!file) {
2875 filename = clang_getFileName((CXFile)file);
2884 printCXIndexFile(file);
2907 CXIdxClientFile file;
2914 clang_indexLoc_getFileLocation(loc, &file, 0, &line, &column, 0);
3076 CXFile file, void *reserved) {
3083 filename = clang_getFileName(file);
3088 printCXIndexFile((CXIdxClientFile)file);
3091 return (CXIdxClientFile)file;
3102 printCXIndexFile((CXIdxClientFile)info->file);
3109 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file);
3119 return (CXIdxClientFile)info->file;
3129 CXString filename = clang_getFileName(info->file);
3135 printCXIndexFile((CXIdxClientFile)info->file);
3144 /* PCH file, the rest are not relevant. */
3148 return (CXIdxClientFile)info->file;
3590 CXFile file = 0;
3646 file = clang_getFile(TU, filename);
3647 if (!file) {
3648 fprintf(stderr, "file %s is not in this translation unit\n", filename);
3653 startLoc = clang_getLocation(TU, file, line, column);
3661 endLoc = clang_getLocation(TU, file, second_line, second_column);
3685 skipped_ranges = clang_getSkippedRanges(TU, file);
3770 printf("file %s not found in compilation db\n", argv[i+1]);
3778 fprintf(stderr, "should not get an empty compileCommand set for file"
3951 FILE *fp = fopen(file_name, "r");
4030 fprintf(stderr, "Unable to write PCH file %s: translation errors\n",
4036 fprintf(stderr, "Unable to write PCH file %s: invalid translation unit\n",
4043 fprintf(stderr, "Unable to write PCH file %s: unknown error \n", filename);
4060 case CXLoadDiag_CannotLoad: return "Cannot Load File";
4063 case CXLoadDiag_InvalidFile: return "Invalid File";
4091 CXFile File;
4095 clang_getExpansionLocation(L, &File, &line, &column, &offset);
4096 FileName = clang_getFileName(File);
4148 CXFile File;
4155 clang_getExpansionLocation(DiagLoc, &File, &line, &column, &offset);
4156 FileName = clang_getFileName(File);
4202 fprintf(stderr, "Trouble deserializing file (%s): %s\n",
4242 " c-index-test -file-refs-at=<site> <compiler arguments>\n"
4243 " c-index-test -file-includes-in=<filename> <compiler arguments>\n");
4245 " c-index-test -index-file [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4246 " c-index-test -index-file-full [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4247 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
4249 " c-index-test -test-file-scan <AST file> <source file> "
4252 " c-index-test -test-load-tu <AST file> <symbol filter> "
4254 " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
4267 " c-index-test -test-inclusion-stack-tu <AST file>\n");
4276 " c-index-test -print-usr-file <file>\n"
4277 " c-index-test -write-pch <file> <compiler arguments>\n");
4283 " c-index-test -read-diagnostics <file>\n\n");
4314 if (argc > 2 && strstr(argv[1], "-file-refs-at=") == argv[1])
4316 if (argc > 2 && strstr(argv[1], "-file-includes-in=") == argv[1])
4318 if (argc > 2 && strcmp(argv[1], "-index-file") == 0)
4320 if (argc > 2 && strcmp(argv[1], "-index-file-full") == 0)
4351 else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
4392 else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0)