Don't write out constants that do not have a name, they will be inlined.
authorChris Lattner <sabre@nondot.org>
Thu, 26 Jul 2001 16:29:38 +0000 (16:29 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Jul 2001 16:29:38 +0000 (16:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index cc62e6007df204972ffa937a899cf36ba7aa3e56..9c66339f21eaa5a3703aa4ecd071126c99148a31 100644 (file)
@@ -129,13 +129,13 @@ bool AssemblyWriter::processConstPool(const ConstantPool &CP, bool isMethod) {
 // processConstant - Print out a constant pool entry...
 //
 bool AssemblyWriter::processConstant(const ConstPoolVal *CPV) {
-  Out << "\t";
+  if (!CPV->hasName())
+    return false;    // Don't print out unnamed constants, they will be inlined
 
-  // Print out name if it exists...
-  if (CPV->hasName())
-    Out << "%" << CPV->getName() << " = ";
+  // Print out name...
+  Out << "\t%" << CPV->getName() << " = ";
 
-  // Print out the opcode...
+  // Print out the constant type...
   Out << CPV->getType();
 
   // Write the value out now...