summaryrefslogtreecommitdiff
path: root/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/AsmWriter.cpp')
-rw-r--r--lib/IR/AsmWriter.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp
index dd0abba0e4..7761127d55 100644
--- a/lib/IR/AsmWriter.cpp
+++ b/lib/IR/AsmWriter.cpp
@@ -1608,7 +1608,22 @@ void AssemblyWriter::printFunction(const Function *F) {
const AttributeSet &Attrs = F->getAttributes();
if (Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
AttributeSet AS = Attrs.getFnAttributes();
- std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
+ std::string AttrStr;
+
+ unsigned Idx = 0;
+ for (unsigned E = AS.getNumSlots(); Idx != E; ++Idx)
+ if (AS.getSlotIndex(Idx) == AttributeSet::FunctionIndex)
+ break;
+
+ for (AttributeSet::iterator I = AS.begin(Idx), E = AS.end(Idx);
+ I != E; ++I) {
+ Attribute Attr = *I;
+ if (!Attr.isStringAttribute()) {
+ if (!AttrStr.empty()) AttrStr += ' ';
+ AttrStr += Attr.getAsString();
+ }
+ }
+
if (!AttrStr.empty())
Out << "; Function Attrs: " << AttrStr << '\n';
}
@@ -2142,8 +2157,7 @@ void AssemblyWriter::writeAllAttributeGroups() {
for (std::vector<std::pair<AttributeSet, unsigned> >::iterator
I = asVec.begin(), E = asVec.end(); I != E; ++I)
Out << "attributes #" << I->second << " = { "
- << I->first.getAsString(AttributeSet::FunctionIndex, true, true)
- << " }\n";
+ << I->first.getAsString(AttributeSet::FunctionIndex, true) << " }\n";
}
//===----------------------------------------------------------------------===//