aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-29 18:15:03 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-29 18:15:03 +0000
commitc5b2e58840748145d1706c1d1481369d1863fabf (patch)
treef970f0dfb900028f9910896fb7cc9371d3186bf5 /include/clang/Lex
parente434ec71fccfe078906403affd641f709702d598 (diff)
Implement code completion support for module import declarations, e.g.,
@import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex')
-rw-r--r--include/clang/Lex/HeaderSearch.h6
-rw-r--r--include/clang/Lex/ModuleLoader.h3
-rw-r--r--include/clang/Lex/ModuleMap.h4
3 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index d1cd8af49a..c5969489f5 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -391,7 +391,6 @@ public:
/// \param File The header that we wish to map to a module.
Module *findModuleForHeader(const FileEntry *File);
-
/// \brief Read the contents of the given module map file.
///
/// \param File The module map file.
@@ -401,6 +400,11 @@ public:
/// \returns true if an error occurred, false otherwise.
bool loadModuleMapFile(const FileEntry *File);
+ /// \brief Collect the set of all known, top-level modules.
+ ///
+ /// \param Modules Will be filled with the set of known, top-level modules.
+ void collectAllModules(llvm::SmallVectorImpl<Module *> &Modules);
+
private:
/// \brief Retrieve a module with the given name, which may be part of the
/// given framework.
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h
index b2fb722b94..36d03c0aa2 100644
--- a/include/clang/Lex/ModuleLoader.h
+++ b/include/clang/Lex/ModuleLoader.h
@@ -24,7 +24,8 @@ class IdentifierInfo;
/// \brief A sequence of identifier/location pairs used to describe a particular
/// module or submodule, e.g., std.vector.
-typedef llvm::ArrayRef<std::pair<IdentifierInfo*, SourceLocation> > ModuleIdPath;
+typedef llvm::ArrayRef<std::pair<IdentifierInfo*, SourceLocation> >
+ ModuleIdPath;
/// \brief Abstract interface for a module loader.
///
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index 64358c83e5..3e794f5c00 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -211,6 +211,10 @@ public:
/// \brief Dump the contents of the module map, for debugging purposes.
void dump();
+
+ typedef llvm::StringMap<Module *>::const_iterator module_iterator;
+ module_iterator module_begin() const { return Modules.begin(); }
+ module_iterator module_end() const { return Modules.end(); }
};
}