diff options
author | Dale Johannesen <dalej@apple.com> | 2008-06-03 18:14:29 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-06-03 18:14:29 +0000 |
commit | 83e468ae23090763baf97fdef84071d5cc471bd0 (patch) | |
tree | 8c7bda8b3db7f1b8042cff3df698d09287925b32 /llvm/lib/VMCore/AsmWriter.cpp | |
parent | 355b74acc227fe586711e9a7dc6bf9933e055f0d (diff) | |
download | bcm5719-llvm-83e468ae23090763baf97fdef84071d5cc471bd0.tar.gz bcm5719-llvm-83e468ae23090763baf97fdef84071d5cc471bd0.zip |
Prevent a crash in debug dumps.
llvm-svn: 51910
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 6 |
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; |