From: Victor Hernandez Date: Thu, 14 Jan 2010 01:47:37 +0000 (+0000) Subject: Fix printing of function-local metadata in AsmWriter X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=559588b156611aaab33d8b46dc0575508a49da2b;p=oota-llvm.git Fix printing of function-local metadata in AsmWriter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93402 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 92dbd93d353..eff2c772c2b 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -2062,8 +2062,9 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const { else W.printAlias(cast(GV)); } else if (const MDNode *N = dyn_cast(this)) { - SlotTracker SlotTable((Function*)0); - AssemblyWriter W(OS, SlotTable, 0, AAW); + Function *F = N->getFunction(); + SlotTracker SlotTable(F); + AssemblyWriter W(OS, SlotTable, getModuleFromVal(F), AAW); W.printMDNodeBody(N); } else if (const NamedMDNode *N = dyn_cast(this)) { SlotTracker SlotTable(N->getParent());