diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 361096f94da..6ca08bbc7a1 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1313,7 +1313,8 @@ void AssemblyWriter::printMDNode(const MDNode *Node, // If this node is already printed then just refer it using its Metadata // id number. if (MI != MDNodes.end()) { - Out << "metadata !" << MI->second; + if (!StandAlone) + Out << "metadata !" << MI->second; return; }