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
This commit is contained in:
Victor Hernandez 2010-01-14 01:47:37 +00:00
parent d0f20acf74
commit 559588b156

View File

@ -2062,8 +2062,9 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
else
W.printAlias(cast<GlobalAlias>(GV));
} else if (const MDNode *N = dyn_cast<MDNode>(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<NamedMDNode>(this)) {
SlotTracker SlotTable(N->getParent());