Add an option `-enable-old-style-attr-syntax' to print out function attributes in the "old" style.

It's sometimes beneficial to emit a testcase with the old style attribute
syntax. Allow someone to do this.
<rdar://problem/13563209>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179735 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2013-04-17 23:35:59 +00:00
parent f92bf40ced
commit b1ac6e6172
4 changed files with 35 additions and 28 deletions

View File

@@ -480,12 +480,17 @@ unsigned AttributeSetNode::getStackAlignment() const {
return 0;
}
std::string AttributeSetNode::getAsString(bool InAttrGrp) const {
std::string AttributeSetNode::getAsString(bool TargetIndependent,
bool InAttrGrp) const {
std::string Str = "";
for (SmallVectorImpl<Attribute>::const_iterator I = AttrList.begin(),
E = AttrList.end(); I != E; ) {
Str += I->getAsString(InAttrGrp);
if (++I != E) Str += " ";
if (!TargetIndependent || !I->isStringAttribute()) {
Str += I->getAsString(InAttrGrp);
if (++I != E) Str += " ";
} else {
++I;
}
}
return Str;
}
@@ -841,10 +846,11 @@ unsigned AttributeSet::getStackAlignment(unsigned Index) const {
return ASN ? ASN->getStackAlignment() : 0;
}
std::string AttributeSet::getAsString(unsigned Index,
std::string AttributeSet::getAsString(unsigned Index, bool TargetIndependent,
bool InAttrGrp) const {
AttributeSetNode *ASN = getAttributes(Index);
return ASN ? ASN->getAsString(InAttrGrp) : std::string("");
return ASN ? ASN->getAsString(TargetIndependent, InAttrGrp) :
std::string("");
}
/// \brief The attributes for the specified index are returned.