diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /include/clang/Lex/ModuleLoader.h | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'include/clang/Lex/ModuleLoader.h')
-rw-r--r-- | include/clang/Lex/ModuleLoader.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h index 72ec0e3..36d03c0 100644 --- a/include/clang/Lex/ModuleLoader.h +++ b/include/clang/Lex/ModuleLoader.h @@ -14,15 +14,18 @@ #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; -/// \brief An opaque key that is used to describe the module and can be -/// interpreted by the module loader itself. -typedef void *ModuleKey; +/// \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; /// \brief Abstract interface for a module loader. /// @@ -39,15 +42,22 @@ public: /// parameters. /// /// \param ImportLoc The location of the 'import' keyword. - /// \param ModuleName The name of the module to be loaded. - /// \param ModuleNameLoc The location of the module name. /// - /// \returns If successful, a non-NULL module key describing this module. - /// Otherwise, returns NULL to indicate that the module could not be - /// loaded. - virtual ModuleKey loadModule(SourceLocation ImportLoc, - IdentifierInfo &ModuleName, - SourceLocation ModuleNameLoc) = 0; + /// \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. + /// + /// \param IsInclusionDirective Indicates that this module is being loaded + /// implicitly, due to the presence of an inclusion directive. Otherwise, + /// it is being loaded due to an import declaration. + /// + /// \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, + Module::NameVisibilityKind Visibility, + bool IsInclusionDirective) = 0; }; } |