From 0c8927efed7576d8992c3950601fc19394603a75 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 25 Sep 2008 17:37:20 +0000 Subject: [PATCH] Avoid a spurious extra space character when printing empty structs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56616 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AsmWriter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 6cdf72527bf..1fb229be33c 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -532,11 +532,12 @@ static void calcTypeName(const Type *Ty, Result += "{ "; for (StructType::element_iterator I = STy->element_begin(), E = STy->element_end(); I != E; ++I) { - if (I != STy->element_begin()) - Result += ", "; calcTypeName(*I, TypeStack, TypeNames, Result); + if (next(I) != STy->element_end()) + Result += ','; + Result += ' '; } - Result += " }"; + Result += '}'; if (STy->isPacked()) Result += '>'; break;