From cf6830d3ebdc8cf8cce4fc3dd2bc2f0d9f1034cc Mon Sep 17 00:00:00 2001 From: Victor Hernandez Date: Mon, 18 Jan 2010 19:15:57 +0000 Subject: Make printing of metadata more robust when function is not found (which is the normal situation for non function-local metadata) llvm-svn: 93748 --- llvm/lib/VMCore/AsmWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/VMCore/AsmWriter.cpp') diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index eff2c772c2b..c0aeaf93c88 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -2064,7 +2064,7 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const { } else if (const MDNode *N = dyn_cast(this)) { Function *F = N->getFunction(); SlotTracker SlotTable(F); - AssemblyWriter W(OS, SlotTable, getModuleFromVal(F), AAW); + AssemblyWriter W(OS, SlotTable, F ? getModuleFromVal(F) : 0, AAW); W.printMDNodeBody(N); } else if (const NamedMDNode *N = dyn_cast(this)) { SlotTracker SlotTable(N->getParent()); -- cgit v1.2.3