aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-09 18:39:07 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-09 18:39:07 +0000
commit52ddc5df59a26570fbca47d269f82954ae3397d1 (patch)
tree0dd7f1c0976712dadbd201f1ed6af9c81d8aea40
parent27f46ee38d9a6a28cf0438218a198a9da1cee5d6 (diff)
Document my otherwise-inexplicable change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107998 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/libclang/CIndex.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index ee2e45f557..7f32a1c148 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1184,7 +1184,15 @@ clang_createTranslationUnitFromSourceFile(CXIndex CIdx,
// 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 @@ clang_createTranslationUnitFromSourceFile(CXIndex CIdx,
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.