diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-25 17:37:20 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-25 17:37:20 +0000 |
commit | 0c8927efed7576d8992c3950601fc19394603a75 (patch) | |
tree | 9c418eae9e3eea4d598c5591670603297e7f3f43 | |
parent | 5dd9c2e9aea7294c184609aff7f2fe82eaea4eb0 (diff) | |
download | external_llvm-0c8927efed7576d8992c3950601fc19394603a75.zip external_llvm-0c8927efed7576d8992c3950601fc19394603a75.tar.gz external_llvm-0c8927efed7576d8992c3950601fc19394603a75.tar.bz2 |
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
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 6cdf725..1fb229b 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; |