diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-15 22:00:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-15 22:00:41 +0000 |
commit | fba18aa8f2cd1994dc65e8cb9f4be201c560dc0b (patch) | |
tree | 7d8906cda58e7645cc60254e4ed7bc34f28247f3 /include/clang/Lex/HeaderSearch.h | |
parent | dd22509c82eb7681a0f46b41d61cb2e25a4d8fa1 (diff) |
Add an experimental flag -fauto-module-import that automatically turns
#include or #import direcctives of framework headers into module
imports of the corresponding framework module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/HeaderSearch.h')
-rw-r--r-- | include/clang/Lex/HeaderSearch.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 86aa7c974a..84d59f793b 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -132,6 +132,9 @@ class HeaderSearch { /// \brief The path to the module cache. std::string ModuleCachePath; + /// \brief The name of the module we're building. + std::string BuildingModule; + /// FileInfo - This contains all of the preprocessor-specific data about files /// that are included. The vector is indexed by the FileEntry's UID. /// @@ -196,9 +199,11 @@ public: //LookupFileCache.clear(); } - /// \brief Set the path to the module cache. - void setModuleCachePath(StringRef Path) { - ModuleCachePath = Path; + /// \brief Set the path to the module cache and the name of the module + /// we're building + void configureModules(StringRef CachePath, StringRef BuildingModule) { + ModuleCachePath = CachePath; + this->BuildingModule = BuildingModule; } /// ClearFileInfo - Forget everything we know about headers so far. @@ -240,12 +245,17 @@ public: /// \param RelativePath If non-null, will be set to the path relative to /// SearchPath at which the file was found. This only differs from the /// Filename for framework includes. + /// + /// \param SuggestedModule If non-null, and the file found is semantically + /// part of a known module, this will be set to the name of the module that + /// could be imported instead of preprocessing/parsing the file found. const FileEntry *LookupFile(StringRef Filename, bool isAngled, const DirectoryLookup *FromDir, const DirectoryLookup *&CurDir, const FileEntry *CurFileEnt, SmallVectorImpl<char> *SearchPath, - SmallVectorImpl<char> *RelativePath); + SmallVectorImpl<char> *RelativePath, + StringRef *SuggestedModule); /// LookupSubframeworkHeader - Look up a subframework for the specified /// #include file. For example, if #include'ing <HIToolbox/HIToolbox.h> from |