diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 6 | ||||
-rw-r--r-- | include/clang/Lex/ModuleLoader.h | 13 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 9 |
4 files changed, 15 insertions, 17 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 3ccd04dfb2..c29b07440f 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -781,9 +781,7 @@ public: /// \returns True if an error occurred, false otherwise. bool serialize(raw_ostream &OS); - virtual ModuleKey loadModule(SourceLocation ImportLoc, - IdentifierInfo &ModuleName, - SourceLocation ModuleNameLoc) { + virtual ModuleKey loadModule(SourceLocation ImportLoc, ModuleIdPath Path) { // ASTUnit doesn't know how to load modules (not that this matters). return 0; } diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index 639c2f68d3..9f982c9265 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -12,12 +12,14 @@ #include "clang/Frontend/CompilerInvocation.h" #include "clang/Lex/ModuleLoader.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/OwningPtr.h" #include <cassert> #include <list> #include <string> +#include <utility> namespace llvm { class raw_fd_ostream; @@ -624,9 +626,7 @@ public: /// } - virtual ModuleKey loadModule(SourceLocation ImportLoc, - IdentifierInfo &ModuleName, - SourceLocation ModuleNameLoc); + virtual ModuleKey loadModule(SourceLocation ImportLoc, ModuleIdPath Path); }; } // end namespace clang diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h index 72ec0e3ebc..42071080f7 100644 --- a/include/clang/Lex/ModuleLoader.h +++ b/include/clang/Lex/ModuleLoader.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_LEX_MODULE_LOADER_H #include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/ArrayRef.h" namespace clang { @@ -24,6 +25,10 @@ class IdentifierInfo; /// 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. /// /// This abstract interface describes a module loader, which is responsible @@ -39,15 +44,13 @@ 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. + /// \param Path The identifiers (and their locations) of the module + /// "path", e.g., "std.vector" would be split into "std" and "vector". /// /// \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; + virtual ModuleKey loadModule(SourceLocation ImportLoc, ModuleIdPath Path) = 0; }; } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index da17b248a1..66d0baf73b 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -29,6 +29,7 @@ #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/TypeLoc.h" +#include "clang/Lex/ModuleLoader.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TemplateKinds.h" #include "clang/Basic/TypeTraits.h" @@ -1109,12 +1110,8 @@ public: /// /// \param ImportLoc The location of the '__import_module__' keyword. /// - /// \param ModuleName The name of the module. - /// - /// \param ModuleNameLoc The location of the module name. - DeclResult ActOnModuleImport(SourceLocation ImportLoc, - IdentifierInfo &ModuleName, - SourceLocation ModuleNameLoc); + /// \param Path The module access path. + DeclResult ActOnModuleImport(SourceLocation ImportLoc, ModuleIdPath Path); /// \brief Diagnose that \p New is a module-private redeclaration of /// \p Old. |