From: Chris Lattner Date: Wed, 2 Mar 2005 23:12:40 +0000 (+0000) Subject: Print the module ID as a comment. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=31ab1b3d74440908889fc8ea0615c1d397478360;p=oota-llvm.git Print the module ID as a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20411 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index b42ccc18471..692f8aa38d6 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -765,6 +765,12 @@ void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType, void AssemblyWriter::printModule(const Module *M) { + if (!M->getModuleIdentifier().empty() && + // Don't print hte ID if it will start a new line (which would + // require a comment char before it). + M->getModuleIdentifier().find('\n') == std::string::npos) + Out << "; ModuleID = '" << M->getModuleIdentifier() << "'\n"; + switch (M->getEndianness()) { case Module::LittleEndian: Out << "target endian = little\n"; break; case Module::BigEndian: Out << "target endian = big\n"; break;