aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-04-17 23:35:59 +0000
committerBill Wendling <isanbard@gmail.com>2013-04-17 23:35:59 +0000
commitb1ac6e617291e2a628bc460933bde97c73466cb0 (patch)
treec4207d2f1e88610f79ccf1bd5e815607d34ee7eb /lib/IR/Attributes.cpp
parentf92bf40cedf2204211b96d27e89e0e2f0170b78d (diff)
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
Diffstat (limited to 'lib/IR/Attributes.cpp')
-rw-r--r--lib/IR/Attributes.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 2d828914cd..b513f7dc84 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -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.