aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-12 23:31:24 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-12 23:31:24 +0000
commit21cae2059a06f7d89eee169409c9266def1b1aca (patch)
tree4e73722923a65113a110c7b3003ce0d27b731b42 /include
parent41bdde9e961c4d96a94148f20f0b18397f4358dd (diff)
When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/DiagnosticCommonKinds.td1
-rw-r--r--include/clang/Basic/FileManager.h4
-rw-r--r--include/clang/Lex/HeaderSearch.h8
3 files changed, 12 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index 29bf270d11..25df8c9bd0 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -60,6 +60,7 @@ def err_friends_define_only_namespace_scope : Error<
def err_deleted_non_function : Error<
"only functions can have deleted definitions">;
def err_module_not_found : Error<"module '%0' not found">, DefaultFatal;
+def err_module_not_built : Error<"could not build module '%0'">, DefaultFatal;
// Sema && Lex
def ext_longlong : Extension<
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index 83fb4e0c5a..826859fb50 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -187,6 +187,10 @@ public:
/// \param openFile if true and the file exists, it will be opened.
const FileEntry *getFile(StringRef Filename, bool openFile = false);
+ /// \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/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index f6552a4014..74c1080df8 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -319,9 +319,15 @@ public:
/// \brief Search in the module cache path for a module with the given
/// name.
///
+ /// \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
+ /// will be set to the path of the umbrella header.
+ ///
/// \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);
+ const FileEntry *lookupModule(StringRef ModuleName,
+ std::string *UmbrellaHeader = 0);
void IncrementFrameworkLookupCount() { ++NumFrameworkLookups; }