[llvm-branch-commits] [cfe-branch] r115433 - /cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp

Daniel Dunbar daniel at zuster.org
Sat Oct 2 16:23:52 PDT 2010


Author: ddunbar
Date: Sat Oct  2 18:23:52 2010
New Revision: 115433

URL: http://llvm.org/viewvc/llvm-project?rev=115433&view=rev
Log:
Merge r115420:
--
Author: Douglas Gregor <dgregor at apple.com>
Date:   Sat Oct 2 20:06:51 2010 +0000

    Don't add -fno-spell-checking in libclang if a spell-checking-related argument is already in the command-line arguments

Modified:
    cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp

Modified: cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp?rev=115433&r1=115432&r2=115433&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp Sat Oct  2 18:23:52 2010
@@ -2042,9 +2042,17 @@
     // (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");
+    // Only do this if we haven't found a spell-checking-related argument.
+    bool FoundSpellCheckingArgument = false;
+    for (int I = 0; I != num_command_line_args; ++I) {
+      if (strcmp(command_line_args[I], "-fno-spell-checking") == 0 ||
+          strcmp(command_line_args[I], "-fspell-checking") == 0) {
+        FoundSpellCheckingArgument = true;
+        break;
+      }
+    }
+    if (!FoundSpellCheckingArgument)
+      Args.push_back("-fno-spell-checking");
     
     Args.insert(Args.end(), command_line_args,
                 command_line_args + num_command_line_args);





More information about the llvm-branch-commits mailing list