]> granicus.if.org Git - clang/commitdiff
Enable the global module index by default. Introduce the
authorDouglas Gregor <dgregor@apple.com>
Mon, 28 Jan 2013 18:38:02 +0000 (18:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 28 Jan 2013 18:38:02 +0000 (18:38 +0000)
-fno-modules-global-index -cc1 option to allow one to disable the
index for performance testing purposes, but with a 10% win in
-fsyntax-only time, there is no reason a user would do this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173707 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Frontend/FrontendOptions.h
lib/Frontend/CompilerInvocation.cpp
test/Modules/global_index.m

index f9a255869b66cb821c2776fc32326d3e0a9c3297..25097e5978281448e78e2910d6d11863554dd8cf 100644 (file)
@@ -289,8 +289,8 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
   HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
            " nodes having a certain substring in a qualified name. Use"
            " -ast-list to list all filterable declaration node names.">;
-def fmodules_global_index : Flag<["-"], "fmodules-global-index">,
-  HelpText<"Automatically generate or update the global module index">;
+def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
+  HelpText<"Do not automatically generate or update the global module index">;
 
 let Group = Action_Group in {
 
index 38162110f35073ee83144b97250eb59b999f4962..c39c1908a74b17356d863b5465f436b18731e650 100644 (file)
@@ -213,8 +213,8 @@ public:
     ShowStats(false), ShowTimers(false), ShowVersion(false),
     FixWhatYouCan(false), FixOnlyWarnings(false), FixAndRecompile(false),
     FixToTemporaries(false), ARCMTMigrateEmitARCErrors(false),
-    SkipFunctionBodies(false), UseGlobalModuleIndex(false),
-    GenerateGlobalModuleIndex(false),
+    SkipFunctionBodies(false), UseGlobalModuleIndex(true),
+    GenerateGlobalModuleIndex(true),
     ARCMTAction(ARCMT_None), ObjCMTAction(ObjCMT_None),
     ProgramAction(frontend::ParseSyntaxOnly)
   {}
index 9c965c05e5ec4fc44bebdff47bdaa454be8df4cb..b200637cb57f7cc62d5f39d67c5f26d914b9c9e8 100644 (file)
@@ -689,7 +689,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
   Opts.FixAndRecompile = Args.hasArg(OPT_fixit_recompile);
   Opts.FixToTemporaries = Args.hasArg(OPT_fixit_to_temp);
   Opts.ASTDumpFilter = Args.getLastArgValue(OPT_ast_dump_filter);
-  Opts.UseGlobalModuleIndex = Args.hasArg(OPT_fmodules_global_index);
+  Opts.UseGlobalModuleIndex = !Args.hasArg(OPT_fno_modules_global_index);
   Opts.GenerateGlobalModuleIndex = Opts.UseGlobalModuleIndex;
   
   Opts.CodeCompleteOpts.IncludeMacros
index 53bee03c41e3967f868167b3f7cd94207f021bdf..51a007f7469f18ebc7839749293b55bedeb76bc2 100644 (file)
@@ -1,12 +1,12 @@
 // RUN: rm -rf %t
 // Run without global module index
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -fno-modules-global-index -F %S/Inputs %s -verify
 // RUN: ls %t|not grep modules.idx
 // Run and create the global module index
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -fmodules-global-index -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -F %S/Inputs %s -verify
 // RUN: ls %t|grep modules.idx
 // Run and use the global module index
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -fmodules-global-index -F %S/Inputs %s -verify -print-stats 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fdisable-module-hash -fmodules -F %S/Inputs %s -verify -print-stats 2>&1 | FileCheck %s
 
 // expected-no-diagnostics
 @import DependsOnModule;