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,6 +979,10 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
} }
void AssemblyWriter::printAlias(const GlobalAlias *GA) { void AssemblyWriter::printAlias(const GlobalAlias *GA) {
// Don't crash when dumping partially built GA
if (!GA->hasName())
Out << "<<nameless>> = ";
else
Out << getLLVMName(GA->getName(), GlobalPrefix) << " = "; Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
switch (GA->getVisibility()) { switch (GA->getVisibility()) {
default: assert(0 && "Invalid visibility style!"); default: assert(0 && "Invalid visibility style!");