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 | 24f07dc6e464aa82694fd3dd5fc88dc139d16b7c (patch) | |
tree | c84396cd542a479432e01dc9e889a3198bb43dd0 /lib/VMCore | |
parent | 428ac54894f80ba4848d5f13576643f289412e6f (diff) | |
download | external_llvm-24f07dc6e464aa82694fd3dd5fc88dc139d16b7c.zip external_llvm-24f07dc6e464aa82694fd3dd5fc88dc139d16b7c.tar.gz external_llvm-24f07dc6e464aa82694fd3dd5fc88dc139d16b7c.tar.bz2 |
Prevent a crash in debug dumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index d8372ef..9e01005 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/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; |