aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-25 00:45:27 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-25 00:45:27 +0000
commitf575d6e7c3b887ea4c5394d2c7e322c7a929a57e (patch)
tree325c8ea980071f606958a9412bb41b0bdcaa3678 /include/clang
parente169807aaea2464cbe68305f013ec7b41625af30 (diff)
Rename the -cc1 option "-generate-module-index" to
"-fmodules-global-index" and expand its behavior to include both the use and generation of the global module index. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Driver/CC1Options.td2
-rw-r--r--include/clang/Frontend/CompilerInstance.h10
-rw-r--r--include/clang/Frontend/FrontendOptions.h11
-rw-r--r--include/clang/Serialization/ASTReader.h12
4 files changed, 26 insertions, 9 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index 77fa82a35d..f9a255869b 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -289,7 +289,7 @@ 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 generate_module_index : Flag<["-"], "generate-module-index">,
+def fmodules_global_index : Flag<["-"], "fmodules-global-index">,
HelpText<"Automatically generate or update the global module index">;
let Group = Action_Group in {
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index d6b3afad8c..a17e1c8f5b 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -117,6 +117,9 @@ class CompilerInstance : public ModuleLoader {
/// have finished with this translation unit.
bool BuildGlobalModuleIndex;
+ /// \brief One or more modules failed to build.
+ bool ModuleBuildFailed;
+
/// \brief Holds information about the output file.
///
/// If TempFilename is not empty we must rename it to Filename at the end.
@@ -191,8 +194,8 @@ public:
void setInvocation(CompilerInvocation *Value);
/// \brief Indicates whether we should (re)build the global module index.
- bool getBuildGlobalModuleIndex() const { return BuildGlobalModuleIndex; }
-
+ bool shouldBuildGlobalModuleIndex() const;
+
/// \brief Set the flag indicating whether we should (re)build the global
/// module index.
void setBuildGlobalModuleIndex(bool Build) {
@@ -549,7 +552,8 @@ public:
bool DisablePCHValidation,
bool AllowPCHWithCompilerErrors,
Preprocessor &PP, ASTContext &Context,
- void *DeserializationListener, bool Preamble);
+ void *DeserializationListener, bool Preamble,
+ bool UseGlobalModuleIndex);
/// Create a code completion consumer using the invocation; note that this
/// will cause the source manager to truncate the input source file at the
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h
index bb6da349ba..38162110f3 100644
--- a/include/clang/Frontend/FrontendOptions.h
+++ b/include/clang/Frontend/FrontendOptions.h
@@ -137,9 +137,11 @@ public:
/// speed up parsing in cases you do
/// not need them (e.g. with code
/// completion).
- unsigned GenerateModuleIndex : 1; ///< Whether to auto-generate a
- ///< global module index when a new
- ///< module has been built.
+ unsigned UseGlobalModuleIndex : 1; ///< Whether we can use the
+ ///< global module index if available.
+ unsigned GenerateGlobalModuleIndex : 1; ///< Whether we can generate the
+ ///< global module index if needed.
+
CodeCompleteOptions CodeCompleteOpts;
enum {
@@ -211,7 +213,8 @@ public:
ShowStats(false), ShowTimers(false), ShowVersion(false),
FixWhatYouCan(false), FixOnlyWarnings(false), FixAndRecompile(false),
FixToTemporaries(false), ARCMTMigrateEmitARCErrors(false),
- SkipFunctionBodies(false), GenerateModuleIndex(false),
+ SkipFunctionBodies(false), UseGlobalModuleIndex(false),
+ GenerateGlobalModuleIndex(false),
ARCMTAction(ARCMT_None), ObjCMTAction(ObjCMT_None),
ProgramAction(frontend::ParseSyntaxOnly)
{}
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index cbd523b671..5d80e0d730 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -692,6 +692,12 @@ private:
/// \brief Whether to accept an AST file with compiler errors.
bool AllowASTWithCompilerErrors;
+ /// \brief Whether we are allowed to use the global module index.
+ bool UseGlobalIndex;
+
+ /// \brief Whether we have tried loading the global module index yet.
+ bool TriedLoadingGlobalIndex;
+
/// \brief The current "generation" of the module file import stack, which
/// indicates how many separate module file load operations have occurred.
unsigned CurrentGeneration;
@@ -1081,9 +1087,13 @@ public:
/// \param AllowASTWithCompilerErrors If true, the AST reader will accept an
/// AST file the was created out of an AST with compiler errors,
/// otherwise it will reject it.
+ ///
+ /// \param UseGlobalIndex If true, the AST reader will try to load and use
+ /// the global module index.
ASTReader(Preprocessor &PP, ASTContext &Context, StringRef isysroot = "",
bool DisableValidation = false,
- bool AllowASTWithCompilerErrors = false);
+ bool AllowASTWithCompilerErrors = false,
+ bool UseGlobalIndex = true);
~ASTReader();