aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/Module.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-02 01:47:07 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-02 01:47:07 +0000
commit90db26000aefe9335370013eec64c85232d80227 (patch)
treea3ced66d78e3b4c8f2da6c52357ad05a4a5a46f6 /include/clang/Basic/Module.h
parent320fa4b6051ff032aaa50d924ca39e3d529dcf5f (diff)
Implementing parsing and resolution of module export declarations
within module maps, which will (eventually) be used to re-export a module from another module. There are still some pieces missing, however. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Module.h')
-rw-r--r--include/clang/Basic/Module.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index 4eaa1be291..43edcfacec 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -15,10 +15,12 @@
#define LLVM_CLANG_BASIC_MODULE_H
#include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include <string>
+#include <utility>
namespace llvm {
class raw_ostream;
@@ -28,6 +30,10 @@ namespace clang {
class FileEntry;
+/// \brief Describes the name of a module.
+typedef llvm::SmallVector<std::pair<std::string, SourceLocation>, 2>
+ ModuleId;
+
/// \brief Describes a module or submodule.
class Module {
public:
@@ -73,6 +79,33 @@ public:
///\ brief The visibility of names within this particular module.
NameVisibilityKind NameVisibility;
+ /// \brief Describes an exported module.
+ ///
+ /// The pointer is the module being re-exported, while the bit will be true
+ /// to indicate that this is a wildcard export.
+ typedef llvm::PointerIntPair<Module *, 1, bool> ExportDecl;
+
+ /// \brief The set of export declarations.
+ llvm::SmallVector<ExportDecl, 2> Exports;
+
+ /// \brief Describes an exported module that has not yet been resolved
+ /// (perhaps because the module it refers to has not yet been loaded).
+ struct UnresolvedExportDecl {
+ /// \brief The location of the 'export' keyword in the module map file.
+ SourceLocation ExportLoc;
+
+ /// \brief The name of the module.
+ ModuleId Id;
+
+ /// \brief Whether this export declaration ends in a wildcard, indicating
+ /// that all of its submodules should be exported (rather than the named
+ /// module itself).
+ bool Wildcard;
+ };
+
+ /// \brief The set of export declarations that have yet to be resolved.
+ llvm::SmallVector<UnresolvedExportDecl, 2> UnresolvedExports;
+
/// \brief Construct a top-level module.
explicit Module(StringRef Name, SourceLocation DefinitionLoc,
bool IsFramework)