aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-02 23:12:40 +0000
committerChris Lattner <sabre@nondot.org>2005-03-02 23:12:40 +0000
commit31ab1b3d74440908889fc8ea0615c1d397478360 (patch)
tree8741a7b0285c8e1bb2ca434384acdacb5f403933 /lib
parent4318a3d0e9d7aa9ab36f376e8c98ee61d5465aaa (diff)
downloadexternal_llvm-31ab1b3d74440908889fc8ea0615c1d397478360.zip
external_llvm-31ab1b3d74440908889fc8ea0615c1d397478360.tar.gz
external_llvm-31ab1b3d74440908889fc8ea0615c1d397478360.tar.bz2
Print the module ID as a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-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;