aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Basic/FileManager.h17
-rw-r--r--include/clang/Driver/CC1Options.td4
-rw-r--r--include/clang/Frontend/CompilerInvocation.h4
-rw-r--r--include/clang/Frontend/HeaderSearchOptions.h8
-rw-r--r--include/clang/Frontend/PreprocessorOptions.h7
-rw-r--r--include/clang/Lex/HeaderSearch.h4
6 files changed, 35 insertions, 9 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index 826859fb50..ea8ed9f02f 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -179,18 +179,21 @@ public:
/// getDirectory - Lookup, cache, and verify the specified directory
/// (real or virtual). This returns NULL if the directory doesn't exist.
///
- const DirectoryEntry *getDirectory(StringRef DirName);
+ /// \param CacheFailure If true and the file does not exist, we'll cache
+ /// the failure to find this file.
+ const DirectoryEntry *getDirectory(StringRef DirName,
+ bool CacheFailure = true);
/// \brief Lookup, cache, and verify the specified file (real or
/// virtual). This returns NULL if the file doesn't exist.
///
- /// \param openFile if true and the file exists, it will be opened.
- const FileEntry *getFile(StringRef Filename, bool openFile = false);
+ /// \param OpenFile if true and the file exists, it will be opened.
+ ///
+ /// \param CacheFailure If true and the file does not exist, we'll cache
+ /// the failure to find this file.
+ const FileEntry *getFile(StringRef Filename, bool OpenFile = false,
+ bool CacheFailure = true);
- /// \brief Forget any information about the given file name, because (for
- /// example) something within this process has changed the file in some way.
- void forgetFile(StringRef Filename);
-
/// \brief Returns the current file system options
const FileSystemOptions &getFileSystemOptions() { return FileSystemOpts; }
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index e3d79ac385..9969abb600 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -608,7 +608,9 @@ def nobuiltininc : Flag<"-nobuiltininc">,
def fmodule_cache_path : JoinedOrSeparate<"-fmodule-cache-path">,
MetaVarName<"<directory>">,
HelpText<"Specify the module cache path">;
-
+def fdisable_module_hash : Flag<"-fdisable-module-hash">,
+ HelpText<"Disable the module hash">;
+
def F : JoinedOrSeparate<"-F">, MetaVarName<"<directory>">,
HelpText<"Add directory to framework include search path">;
def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">,
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h
index 23ddc84304..f09c97ec3f 100644
--- a/include/clang/Frontend/CompilerInvocation.h
+++ b/include/clang/Frontend/CompilerInvocation.h
@@ -123,6 +123,10 @@ public:
static void setLangDefaults(LangOptions &Opts, InputKind IK,
LangStandard::Kind LangStd = LangStandard::lang_unspecified);
+ /// \brief Retrieve a module hash string that is suitable for uniquely
+ /// identifying the conditions under which the module was built.
+ std::string getModuleHash() const;
+
/// @}
/// @name Option Subgroups
/// @{
diff --git a/include/clang/Frontend/HeaderSearchOptions.h b/include/clang/Frontend/HeaderSearchOptions.h
index a81a0cb992..e0f80e3bdf 100644
--- a/include/clang/Frontend/HeaderSearchOptions.h
+++ b/include/clang/Frontend/HeaderSearchOptions.h
@@ -78,6 +78,12 @@ public:
/// \brief The directory used for the module cache.
std::string ModuleCachePath;
+ /// \brief Whether we should disable the use of the hash string within the
+ /// module cache.
+ ///
+ /// Note: Only used for testing!
+ unsigned DisableModuleHash : 1;
+
/// Include the compiler builtin includes.
unsigned UseBuiltinIncludes : 1;
@@ -95,7 +101,7 @@ public:
public:
HeaderSearchOptions(StringRef _Sysroot = "/")
- : Sysroot(_Sysroot), UseBuiltinIncludes(true),
+ : Sysroot(_Sysroot), DisableModuleHash(0), UseBuiltinIncludes(true),
UseStandardIncludes(true), UseStandardCXXIncludes(true), UseLibcxx(false),
Verbose(false) {}
diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h
index 3df6512600..4065ae6ff6 100644
--- a/include/clang/Frontend/PreprocessorOptions.h
+++ b/include/clang/Frontend/PreprocessorOptions.h
@@ -195,10 +195,17 @@ public:
/// module.
void resetNonModularOptions() {
Macros.clear();
+ Includes.clear();
+ Modules.clear();
MacroIncludes.clear();
+ ChainedIncludes.clear();
DumpDeserializedPCHDecls = false;
+ ImplicitPCHInclude.clear();
+ ImplicitPTHInclude.clear();
TokenCache.clear();
RetainRemappedFileBuffers = true;
+ PrecompiledPreambleBytes.first = 0;
+ PrecompiledPreambleBytes.second = 0;
}
};
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 74c1080df8..86aa7c974a 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -319,6 +319,9 @@ public:
/// \brief Search in the module cache path for a module with the given
/// name.
///
+ /// \param If non-NULL, will be set to the module file name we expected to
+ /// find (regardless of whether it was actually found or not).
+ ///
/// \param UmbrellaHeader If non-NULL, and no module was found in the module
/// cache, this routine will search in the framework paths to determine
/// whether a module can be built from an umbrella header. If so, the pointee
@@ -327,6 +330,7 @@ public:
/// \returns A file describing the named module, if available, or NULL to
/// indicate that the module could not be found.
const FileEntry *lookupModule(StringRef ModuleName,
+ std::string *ModuleFileName = 0,
std::string *UmbrellaHeader = 0);
void IncrementFrameworkLookupCount() { ++NumFrameworkLookups; }