diff options
author | dim <dim@FreeBSD.org> | 2011-10-20 21:14:49 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-10-20 21:14:49 +0000 |
commit | 3963a48221351c61c17fb3f382341ab04809a3d3 (patch) | |
tree | ee2483e98b09cac943dc93a6969d83ca737ff139 /include/clang/Lex/ModuleLoader.h | |
parent | 611ba3ea3300b71eb95dc4e45f20eee5dddd32e1 (diff) | |
download | FreeBSD-src-3963a48221351c61c17fb3f382341ab04809a3d3.zip FreeBSD-src-3963a48221351c61c17fb3f382341ab04809a3d3.tar.gz |
Vendor import of clang release_30 branch r142614:
http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614
Diffstat (limited to 'include/clang/Lex/ModuleLoader.h')
-rw-r--r-- | include/clang/Lex/ModuleLoader.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h new file mode 100644 index 0000000..72ec0e3 --- /dev/null +++ b/include/clang/Lex/ModuleLoader.h @@ -0,0 +1,55 @@ +//===--- ModuleLoader.h - Module Loader Interface ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the ModuleLoader interface, which is responsible for +// loading named modules. +// +//===----------------------------------------------------------------------===// +#ifndef LLVM_CLANG_LEX_MODULE_LOADER_H +#define LLVM_CLANG_LEX_MODULE_LOADER_H + +#include "clang/Basic/SourceLocation.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 Abstract interface for a module loader. +/// +/// This abstract interface describes a module loader, which is responsible +/// for resolving a module name (e.g., "std") to an actual module file, and +/// then loading that module. +class ModuleLoader { +public: + virtual ~ModuleLoader(); + + /// \brief Attempt to load the given module. + /// + /// This routine attempts to load the module described by the given + /// 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; +}; + +} + +#endif |