Lines Matching defs:argv
110 int parse_remapped_files(int argc, const char **argv, int start_arg,
121 if (strncmp(argv[arg], "-remap-file=", prefix_len))
135 const char *arg_string = argv[arg] + prefix_len;
195 static const char *parse_comments_schema(int argc, const char **argv) {
202 if (!strncmp(argv[0], CommentsSchemaArg, strlen(CommentsSchemaArg)))
203 CommentSchemaFile = argv[0] + strlen(CommentsSchemaArg);
1362 int perform_test_load_source(int argc, const char **argv,
1377 if ((CommentSchemaFile = parse_comments_schema(argc, argv))) {
1379 argv++;
1382 if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) {
1388 argv + num_unsaved_files,
1406 int perform_test_reparse_source(int argc, const char **argv, int trials,
1422 if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) {
1430 argv + num_unsaved_files,
1865 int perform_code_completion(int argc, const char **argv, int timing_only) {
1866 const char *input = argv[1];
1893 if (parse_remapped_files(argc, argv, 2, &unsaved_files, &num_unsaved_files))
1902 argv + num_unsaved_files + 2,
1996 argv) {
2009 while (strstr(argv[NumLocations+1], "-cursor-at=") == argv[NumLocations+1])
2017 const char *input = argv[Loc + 1] + strlen("-cursor-at=");
2024 if (parse_remapped_files(argc, argv, NumLocations + 1, &unsaved_files,
2034 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2035 argv + num_unsaved_files + 1 + NumLocations,
2162 static int find_file_refs_at(int argc, const char **argv) {
2175 while (strstr(argv[NumLocations+1], "-file-refs-at=") == argv[NumLocations+1])
2183 const char *input = argv[Loc + 1] + strlen("-file-refs-at=");
2190 if (parse_remapped_files(argc, argv, NumLocations + 1, &unsaved_files,
2200 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2201 argv + num_unsaved_files + 1 + NumLocations,
2267 static int find_file_includes_in(int argc, const char **argv) {
2278 while (strstr(argv[NumFilenames+1], "-file-includes-in=") == argv[NumFilenames+1])
2285 const char *input = argv[I + 1] + strlen("-file-includes-in=");
2290 if (parse_remapped_files(argc, argv, NumFilenames + 1, &unsaved_files,
2300 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
2301 argv + num_unsaved_files + 1 + NumFilenames,
2902 static int index_file(int argc, const char **argv, int full) {
2911 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
2912 check_prefix = argv[0] + strlen("-check-prefix=");
2913 ++argv;
2928 result = index_compile_args(argc, argv, idxAction, importedASTs, check_prefix);
2947 static int index_tu(int argc, const char **argv) {
2955 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
2956 check_prefix = argv[0] + strlen("-check-prefix=");
2957 ++argv;
2969 result = index_ast_file(argv[0], Idx, idxAction,
2977 static int index_compile_db(int argc, const char **argv) {
2985 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
2986 check_prefix = argv[0] + strlen("-check-prefix=");
2987 ++argv;
3005 const char *database = argv[0];
3100 int perform_token_annotation(int argc, const char **argv) {
3101 const char *input = argv[1];
3123 if (parse_remapped_files(argc, argv, 2, &unsaved_files, &num_unsaved_files)) {
3129 TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
3130 argv + num_unsaved_files + 2,
3243 perform_test_compilation_db(const char *database, int argc, const char **argv) {
3272 if (strcmp(argv[i],"lookup")==0){
3273 CCmds = clang_CompilationDatabase_getCompileCommands(db, argv[i+1]);
3276 printf("file %s not found in compilation db\n", argv[i+1]);
3285 " '%s'\n", argv[i+1]);
3499 int write_pch_file(const char *filename, int argc, const char *argv[]) {
3508 if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) {
3514 argv + num_unsaved_files,
3790 int cindextest_main(int argc, const char **argv) {
3792 if (argc > 2 && strcmp(argv[1], "-read-diagnostics") == 0)
3793 return read_diagnostics(argv[2]);
3794 if (argc > 2 && strstr(argv[1], "-code-completion-at=") == argv[1])
3795 return perform_code_completion(argc, argv, 0);
3796 if (argc > 2 && strstr(argv[1], "-code-completion-timing=") == argv[1])
3797 return perform_code_completion(argc, argv, 1);
3798 if (argc > 2 && strstr(argv[1], "-cursor-at=") == argv[1])
3799 return inspect_cursor_at(argc, argv);
3800 if (argc > 2 && strstr(argv[1], "-file-refs-at=") == argv[1])
3801 return find_file_refs_at(argc, argv);
3802 if (argc > 2 && strstr(argv[1], "-file-includes-in=") == argv[1])
3803 return find_file_includes_in(argc, argv);
3804 if (argc > 2 && strcmp(argv[1], "-index-file") == 0)
3805 return index_file(argc - 2, argv + 2, /*full=*/0);
3806 if (argc > 2 && strcmp(argv[1], "-index-file-full") == 0)
3807 return index_file(argc - 2, argv + 2, /*full=*/1);
3808 if (argc > 2 && strcmp(argv[1], "-index-tu") == 0)
3809 return index_tu(argc - 2, argv + 2);
3810 if (argc > 2 && strcmp(argv[1], "-index-compile-db") == 0)
3811 return index_compile_db(argc - 2, argv + 2);
3812 else if (argc >= 4 && strncmp(argv[1], "-test-load-tu", 13) == 0) {
3813 CXCursorVisitor I = GetVisitor(argv[1] + 13);
3815 return perform_test_load_tu(argv[2], argv[3], argc >= 5 ? argv[4] : 0, I,
3818 else if (argc >= 5 && strncmp(argv[1], "-test-load-source-reparse", 25) == 0){
3819 CXCursorVisitor I = GetVisitor(argv[1] + 25);
3821 int trials = atoi(argv[2]);
3822 return perform_test_reparse_source(argc - 4, argv + 4, trials, argv[3], I,
3826 else if (argc >= 4 && strncmp(argv[1], "-test-load-source", 17) == 0) {
3827 CXCursorVisitor I = GetVisitor(argv[1] + 17);
3830 if (strstr(argv[1], "-memory-usage"))
3834 return perform_test_load_source(argc - 3, argv + 3, argv[2], I,
3837 else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
3838 return perform_file_scan(argv[2], argv[3],
3839 argc >= 5 ? argv[4] : 0);
3840 else if (argc > 2 && strstr(argv[1], "-test-annotate-tokens=") == argv[1])
3841 return perform_token_annotation(argc, argv);
3842 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-source") == 0)
3843 return perform_test_load_source(argc - 2, argv + 2, "all", NULL,
3845 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-tu") == 0)
3846 return perform_test_load_tu(argv[2], "all", NULL, NULL,
3848 else if (argc > 2 && strcmp(argv[1], "-test-print-linkage-source") == 0)
3849 return perform_test_load_source(argc - 2, argv + 2, "all", PrintLinkage,
3851 else if (argc > 2 && strcmp(argv[1], "-test-print-type") == 0)
3852 return perform_test_load_source(argc - 2, argv + 2, "all",
3854 else if (argc > 2 && strcmp(argv[1], "-test-print-type-size") == 0)
3855 return perform_test_load_source(argc - 2, argv + 2, "all",
3857 else if (argc > 2 && strcmp(argv[1], "-test-print-bitwidth") == 0)
3858 return perform_test_load_source(argc - 2, argv + 2, "all",
3860 else if (argc > 1 && strcmp(argv[1], "-print-usr") == 0) {
3862 return print_usrs(argv + 2, argv + argc);
3868 else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0)
3869 return print_usrs_file(argv[2]);
3870 else if (argc > 2 && strcmp(argv[1], "-write-pch") == 0)
3871 return write_pch_file(argv[2], argc - 3, argv + 3);
3872 else if (argc > 2 && strcmp(argv[1], "-compilation-db") == 0)
3873 return perform_test_compilation_db(argv[argc-1], argc - 3, argv + 2);
3887 const char **argv;
3892 client_data->result = cindextest_main(client_data->argc, client_data->argv);
3898 int main(int argc, const char **argv) {
3906 return cindextest_main(argc, argv);
3909 client_data.argv = argv;