aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/AsmWriter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index b42ccc1..692f8aa 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;