[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 2 15:12:56 PST 2005



Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.171 -> 1.172
---
Log message:

Print the module ID as a comment.


---
Diffs of the changes:  (+6 -0)

 AsmWriter.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.171 llvm/lib/VMCore/AsmWriter.cpp:1.172
--- llvm/lib/VMCore/AsmWriter.cpp:1.171	Thu Feb 24 10:58:29 2005
+++ llvm/lib/VMCore/AsmWriter.cpp	Wed Mar  2 17:12:40 2005
@@ -765,6 +765,12 @@
 
 
 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;






More information about the llvm-commits mailing list