llvm.org GIT mirror llvm / e94e4ca
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 Benjamin Kramer 6 years ago
2 changed file(s) with 13 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
481481
482482 std::string AttributeSetNode::getAsString(bool TargetIndependent,
483483 bool InAttrGrp) const {
484 std::string Str = "";
484 std::string Str;
485485 for (SmallVectorImpl::const_iterator I = AttrList.begin(),
486 E = AttrList.end(); I != E; ) {
486 E = AttrList.end(); I != E; ++I) {
487487 if (TargetIndependent || !I->isStringAttribute()) {
488 if (I != AttrList.begin())
489 Str += ' ';
488490 Str += I->getAsString(InAttrGrp);
489 if (++I != E) Str += " ";
490 } else {
491 ++I;
492491 }
493492 }
494493 return Str;
0 ; RUN: opt -S < %s | FileCheck %s -strict-whitespace
1
2 ; CHECK: {{^}}; Function Attrs: nounwind readnone ssp uwtable{{$}}
3 ; CHECK-NEXT: define void @test1() #0
4 define void @test1() #0 {
5 ret void
6 }
7
8 attributes #0 = { nounwind ssp "less-precise-fpmad"="false" uwtable "no-frame-pointer-elim"="true" readnone "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }