summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index d8372ef0063..9e010051a51 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -979,7 +979,11 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
}
void AssemblyWriter::printAlias(const GlobalAlias *GA) {
- Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
+ // Don't crash when dumping partially built GA
+ if (!GA->hasName())
+ Out << "<<nameless>> = ";
+ else
+ Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
switch (GA->getVisibility()) {
default: assert(0 && "Invalid visibility style!");
case GlobalValue::DefaultVisibility: break;
OpenPOWER on IntegriCloud