summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-04-19 11:43:21 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-04-19 11:43:21 +0000
commite94e4ca5fd94de185a840e9237b3b483f62342a8 (patch)
treed8db790a2eb2026ae9ccf044a2d6fe88e3d11452 /lib
parentdb5f9270207292b62ea847560c5dd4e9873b57f5 (diff)
Attributes: Don't print trailing whitespace on the function attribute comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/Attributes.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 98dcecfba6b..44fa78e4af6 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -482,14 +482,13 @@ unsigned AttributeSetNode::getStackAlignment() const {
std::string AttributeSetNode::getAsString(bool TargetIndependent,
bool InAttrGrp) const {
- std::string Str = "";
+ std::string Str;
for (SmallVectorImpl<Attribute>::const_iterator I = AttrList.begin(),
- E = AttrList.end(); I != E; ) {
+ E = AttrList.end(); I != E; ++I) {
if (TargetIndependent || !I->isStringAttribute()) {
+ if (I != AttrList.begin())
+ Str += ' ';
Str += I->getAsString(InAttrGrp);
- if (++I != E) Str += " ";
- } else {
- ++I;
}
}
return Str;