[llvm-commits] [llvm] r88715 - /llvm/trunk/lib/VMCore/AsmWriter.cpp

Eric Christopher echristo at apple.com
Fri Nov 13 15:00:14 PST 2009


Author: echristo
Date: Fri Nov 13 17:00:14 2009
New Revision: 88715

URL: http://llvm.org/viewvc/llvm-project?rev=88715&view=rev
Log:
Print out something, even if it's non-parseable later when we've
got ghost linkage. It's better than aborting.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=88715&r1=88714&r2=88715&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Fri Nov 13 17:00:14 2009
@@ -1497,8 +1497,8 @@
   case GlobalValue::AvailableExternallyLinkage:
     Out << "available_externally ";
     break;
-  case GlobalValue::GhostLinkage:
-    llvm_unreachable("GhostLinkage not allowed in AsmWriter!");
+    // This is invalid syntax and just a debugging aid.
+  case GlobalValue::GhostLinkage:	  Out << "ghost ";	    break;
   }
 }
 
@@ -1514,6 +1514,11 @@
 }
 
 void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
+  // If we're going to print a global that has GhostLinkage
+  // materialize it now.
+  if (GV->getLinkage() == GlobalValue::GhostLinkage) {
+  }
+
   WriteAsOperandInternal(Out, GV, &TypePrinter, &Machine);
   Out << " = ";
 





More information about the llvm-commits mailing list