summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2009-11-13 23:00:14 +0000
committerEric Christopher <echristo@apple.com>2009-11-13 23:00:14 +0000
commit0cabd30b22068b49f9cf49980127abbb0fcc11d4 (patch)
treeaa232e95725a37b4ba789281e425828a193a1387 /llvm/lib
parentebea00581283314330a709a08b333e8a092ceb5a (diff)
downloadbcm5719-llvm-0cabd30b22068b49f9cf49980127abbb0fcc11d4.tar.gz
bcm5719-llvm-0cabd30b22068b49f9cf49980127abbb0fcc11d4.zip
Print out something, even if it's non-parseable later when we've
got ghost linkage. It's better than aborting. llvm-svn: 88715
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 9a803a16628..4954522691e 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -1497,8 +1497,8 @@ static void PrintLinkage(GlobalValue::LinkageTypes LT,
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 @@ static void PrintVisibility(GlobalValue::VisibilityTypes Vis,
}
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 << " = ";
OpenPOWER on IntegriCloud