aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/ModuleLoader.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-01 17:11:21 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-01 17:11:21 +0000
commit5e35693721364673f8196e4f5a370f56b92e6053 (patch)
tree7de6955b4b607db6fb559ced4e3c710c2318ef75 /include/clang/Lex/ModuleLoader.h
parentee5a21fda5efce750c21db5a1d635c9742f5859b (diff)
Introduce the notion of name visibility into modules. For a given
(sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/ModuleLoader.h')
-rw-r--r--include/clang/Lex/ModuleLoader.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h
index 6a7fe0204f..0bd97b6bd4 100644
--- a/include/clang/Lex/ModuleLoader.h
+++ b/include/clang/Lex/ModuleLoader.h
@@ -14,13 +14,13 @@
#ifndef LLVM_CLANG_LEX_MODULE_LOADER_H
#define LLVM_CLANG_LEX_MODULE_LOADER_H
+#include "clang/Basic/Module.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/ArrayRef.h"
namespace clang {
class IdentifierInfo;
-class Module;
/// \brief A sequence of identifier/location pairs used to describe a particular
/// module or submodule, e.g., std.vector.
@@ -41,12 +41,17 @@ public:
/// parameters.
///
/// \param ImportLoc The location of the 'import' keyword.
+ ///
/// \param Path The identifiers (and their locations) of the module
/// "path", e.g., "std.vector" would be split into "std" and "vector".
+ ///
+ /// \param Visibility The visibility provided for the names in the loaded
+ /// module.
///
/// \returns If successful, returns the loaded module. Otherwise, returns
/// NULL to indicate that the module could not be loaded.
- virtual Module *loadModule(SourceLocation ImportLoc, ModuleIdPath Path) = 0;
+ virtual Module *loadModule(SourceLocation ImportLoc, ModuleIdPath Path,
+ Module::NameVisibilityKind Visibility) = 0;
};
}