]> granicus.if.org Git - clang/commitdiff
Fix printing of wildcard exports.
authorDouglas Gregor <dgregor@apple.com>
Mon, 5 Dec 2011 17:34:59 +0000 (17:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 5 Dec 2011 17:34:59 +0000 (17:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145812 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Module.cpp

index 59fced5f16cd1dcc878c7b3a7df61dbda58c54fc..c3a8a377c44fefbb49829009ddd77bd3d1288325 100644 (file)
@@ -102,9 +102,14 @@ void Module::print(llvm::raw_ostream &OS, unsigned Indent) const {
   
   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 @@ void Module::print(llvm::raw_ostream &OS, unsigned Indent) const {
     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";
   }