diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-03-20 18:17:52 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-03-20 18:17:52 +0000 |
commit | e762020bb98d6d48166b737c47f6252b7521857c (patch) | |
tree | 48144e5aee9fd48818fb1e9f2f011cac61e4ac4e | |
parent | ee6bc70d2f1c2434ca9ca8092216bdeab322c7e5 (diff) | |
download | bcm5719-llvm-e762020bb98d6d48166b737c47f6252b7521857c.tar.gz bcm5719-llvm-e762020bb98d6d48166b737c47f6252b7521857c.zip |
In clang_parseTranslationUnit_Impl,p ut the source file after command_line_args otherwise
if '-x' flag is present it will be unused.
llvm-svn: 127971
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 502ee9958d6..500b1a51af5 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -2404,12 +2404,6 @@ static void clang_parseTranslationUnit_Impl(void *UserData) { } llvm::SmallVector<const char *, 16> Args; - - // The 'source_filename' argument is optional. If the caller does not - // specify it then it is assumed that the source file is specified - // in the actual argument list. - if (source_filename) - Args.push_back(source_filename); // Since the Clang C library is primarily used by batch tools dealing with // (often very broken) source code, where spell-checking can have a @@ -2430,6 +2424,14 @@ static void clang_parseTranslationUnit_Impl(void *UserData) { Args.insert(Args.end(), command_line_args, command_line_args + num_command_line_args); + // The 'source_filename' argument is optional. If the caller does not + // specify it then it is assumed that the source file is specified + // in the actual argument list. + // Put the source file after command_line_args otherwise if '-x' flag is + // present it will be unused. + if (source_filename) + Args.push_back(source_filename); + // Do we need the detailed preprocessing record? if (options & CXTranslationUnit_DetailedPreprocessingRecord) { Args.push_back("-Xclang"); |