Fix printing of function-local metadata in AsmWriter

llvm-svn: 93402
This commit is contained in:
Victor Hernandez 2010-01-14 01:47:37 +00:00
parent b816154268
commit 61e6e829c6
1 changed files with 3 additions and 2 deletions

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());