[cfe-commits] r127971 - /cfe/trunk/tools/libclang/CIndex.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Sun Mar 20 11:17:53 PDT 2011


Author: akirtzidis
Date: Sun Mar 20 13:17:52 2011
New Revision: 127971

URL: http://llvm.org/viewvc/llvm-project?rev=127971&view=rev
Log:
In clang_parseTranslationUnit_Impl,p ut the source file after command_line_args otherwise
if '-x' flag is present it will be unused.

Modified:
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=127971&r1=127970&r2=127971&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Sun Mar 20 13:17:52 2011
@@ -2404,12 +2404,6 @@
   }
 
   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 @@
   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");





More information about the cfe-commits mailing list