Fix printing of wildcard exports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145812 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp
index 59fced5..c3a8a37 100644
--- a/lib/Basic/Module.cpp
+++ b/lib/Basic/Module.cpp
@@ -102,9 +102,14 @@
   
   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 << "export ";
+    if (Module *Restriction = Exports[I].getPointer()) {
+      OS << Restriction->getFullModuleName();
+      if (Exports[I].getInt())
+        OS << ".*";
+    } else {
+      OS << "*";
+    }
     OS << "\n";
   }
 
@@ -112,8 +117,12 @@
     OS.indent(Indent + 2);
     OS << "export ";
     printModuleId(OS, UnresolvedExports[I].Id);
-    if (UnresolvedExports[I].Wildcard)
-      OS << ".*";
+    if (UnresolvedExports[I].Wildcard) {
+      if (UnresolvedExports[I].Id.empty())
+        OS << "*";
+      else
+        OS << ".*";
+    }
     OS << "\n";
   }