aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit877cf534ab746e33c55decded1e05407e6146924 (patch)
treefa908b75408cd3e5c076248002a41859bb8ad3ce /llvm/lib/IR/Attributes.cpp
parent1baf545fa6bdb9e3edeb50bd0ca8ede2de6a3517 (diff)
downloadllvm-877cf534ab746e33c55decded1e05407e6146924.zip
llvm-877cf534ab746e33c55decded1e05407e6146924.tar.gz
llvm-877cf534ab746e33c55decded1e05407e6146924.tar.bz2
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> llvm-svn: 179735
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 2d82891..b513f7d 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/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.