summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-02 18:58:38 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-02 18:58:38 +0000
commit24bb923aa84354bfa18240bdda6d9aa07ef83427 (patch)
tree68eac8e51724d44c1974729dc0a78f1cb8dc3f9b /clang/lib/Basic/Module.cpp
parentc5be44aaa2bf1c6f7b2716938329bcb3aedd4778 (diff)
downloadbcm5719-llvm-24bb923aa84354bfa18240bdda6d9aa07ef83427.tar.gz
bcm5719-llvm-24bb923aa84354bfa18240bdda6d9aa07ef83427.zip
Implement (de-)serialization of the set of exported modules in a
module map. llvm-svn: 145695
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 04f9befd1ae..6bca55c754a 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -53,6 +53,14 @@ StringRef Module::getTopLevelModuleName() const {
return Top->Name;
}
+static void printModuleId(llvm::raw_ostream &OS, const ModuleId &Id) {
+ for (unsigned I = 0, N = Id.size(); I != N; ++I) {
+ if (I)
+ OS << ".";
+ OS << Id[I].first;
+ }
+}
+
void Module::print(llvm::raw_ostream &OS, unsigned Indent) const {
OS.indent(Indent);
if (IsFramework)
@@ -80,6 +88,23 @@ void Module::print(llvm::raw_ostream &OS, unsigned Indent) const {
MI != MIEnd; ++MI)
MI->getValue()->print(OS, Indent + 2);
+ for (unsigned I = 0, N = Exports.size(); I != N; ++I) {
+ OS.indent(Indent + 2);
+ OS << "export " << Exports[I].getPointer()->getFullModuleName();
+ if (Exports[I].getInt())
+ OS << ".*";
+ OS << "\n";
+ }
+
+ for (unsigned I = 0, N = UnresolvedExports.size(); I != N; ++I) {
+ OS.indent(Indent + 2);
+ OS << "export ";
+ printModuleId(OS, UnresolvedExports[I].Id);
+ if (UnresolvedExports[I].Wildcard)
+ OS << ".*";
+ OS << "\n";
+ }
+
OS.indent(Indent);
OS << "}\n";
}
OpenPOWER on IntegriCloud