diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-04-29 18:23:53 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-04-29 18:23:53 +0000 |
commit | e02c622baa07c6ec65181e81d0fbf54dde9c4a5a (patch) | |
tree | 0470d4c6a38e0cc64384eaebe6cec5e703563fdf /llvm/lib/IR/Attributes.cpp | |
parent | ea64c97fa901597dcd6ec810c925e0c181448bbf (diff) | |
download | llvm-e02c622baa07c6ec65181e81d0fbf54dde9c4a5a.zip llvm-e02c622baa07c6ec65181e81d0fbf54dde9c4a5a.tar.gz llvm-e02c622baa07c6ec65181e81d0fbf54dde9c4a5a.tar.bz2 |
Revert "revert r179735, it has no testcases, and doesn't really make sense."
This un-reverts r179735 and reverts commit r180574.
This fixes assertion failures for me locally and should fix the failures
on Windows reported widely on llvm-dev. We should check if the bots
caught this and if so why not.
llvm-svn: 180722
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 8347844..80968db 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -483,13 +483,16 @@ 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; ++I) { - if (I != AttrList.begin()) - Str += ' '; - Str += I->getAsString(InAttrGrp); + if (TargetIndependent || !I->isStringAttribute()) { + if (I != AttrList.begin()) + Str += ' '; + Str += I->getAsString(InAttrGrp); + } } return Str; } @@ -845,10 +848,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. |