Permalink
Browse files

Pass through -x to clang

  • Loading branch information...
1 parent a5fdebd commit 852dc4cbc003916a9595d9a6049a9e6c59985263 @nickg committed Mar 13, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 clang-tags.c
View
@@ -276,14 +276,15 @@ static void visit_path(const char *path, regex_t *preg,
printf("%d", nfiles);
fflush(stdout);
+ unsigned flags = CXTranslationUnit_Incomplete;
CXTranslationUnit tu = clang_parseTranslationUnit(
index, // Index
path, // Source file name
clang_argv, // Command line arguments
clang_argc, // Number of arguments
NULL, // Unsaved files
0, // Number of unsaved files
- 0); // Flags
+ flags); // Flags
process_file(tu, path);
clang_disposeTranslationUnit(tu);
@@ -305,7 +306,7 @@ int main(int argc, char **argv)
char **clang_argv = malloc(sizeof(char*) * max_clang_args);
assert(clang_argv != NULL);
- const char *spec = "I:";
+ const char *spec = "I:x:";
int c, failure = 0;
while ((c = getopt_long(argc, argv, spec, long_options, NULL)) != -1) {
switch (c) {
@@ -317,6 +318,12 @@ int main(int argc, char **argv)
clang_argv[clang_argc++] = optarg;
}
break;
+ case 'x':
+ if (clang_argc < max_clang_args - 1) {
+ clang_argv[clang_argc++] = "-x";
+ clang_argv[clang_argc++] = optarg;
+ }
+ break;
case '?':
failure = 1;
break;

0 comments on commit 852dc4c

Please sign in to comment.