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

Douglas Gregor dgregor at apple.com
Fri Jul 9 11:39:08 PDT 2010


Author: dgregor
Date: Fri Jul  9 13:39:07 2010
New Revision: 107998

URL: http://llvm.org/viewvc/llvm-project?rev=107998&view=rev
Log:
Document my otherwise-inexplicable change

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=107998&r1=107997&r2=107998&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Fri Jul  9 13:39:07 2010
@@ -1184,7 +1184,15 @@
     // 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
+    // significant negative impact on performance (particularly when 
+    // precompiled headers are involved), we disable it by default.
+    // Note that we place this argument early in the list, so that it can be
+    // overridden by the caller with "-fspell-checking".
     Args.push_back("-fno-spell-checking");
+    
     Args.insert(Args.end(), command_line_args,
                 command_line_args + num_command_line_args);
     Args.push_back("-Xclang");
@@ -1248,6 +1256,13 @@
   argv.push_back("-o");
   char astTmpFile[L_tmpnam];
   argv.push_back(tmpnam(astTmpFile));
+  
+  // Since the Clang C library is primarily used by batch tools dealing with
+  // (often very broken) source code, where spell-checking can have a
+  // significant negative impact on performance (particularly when 
+  // precompiled headers are involved), we disable it by default.
+  // Note that we place this argument early in the list, so that it can be
+  // overridden by the caller with "-fspell-checking".
   argv.push_back("-fno-spell-checking");
 
   // Remap any unsaved files to temporary files.





More information about the cfe-commits mailing list