mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user