Prevent a crash in debug dumps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen 2008-06-03 18:14:29 +00:00
parent 428ac54894
commit 24f07dc6e4

View File

@ -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;