Make the TargetIndependent flag have the right boolean value.
authorBill Wendling <isanbard@gmail.com>
Thu, 18 Apr 2013 21:45:04 +0000 (21:45 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 18 Apr 2013 21:45:04 +0000 (21:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179798 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Attributes.h
lib/IR/AsmWriter.cpp
lib/IR/Attributes.cpp

index 4e113d6a61205ed5361af6d04c49cafce8f5b281..f93f28b239a6e4880dbc6c9b022564640710e6b0 100644 (file)
@@ -306,7 +306,7 @@ public:
   unsigned getStackAlignment(unsigned Index) const;
 
   /// \brief Return the attributes at the index as a string.
-  std::string getAsString(unsigned Index, bool TargetIndependent = false,
+  std::string getAsString(unsigned Index, bool TargetIndependent = true,
                           bool InAttrGrp = false) const;
 
   typedef ArrayRef<Attribute>::iterator iterator;
index 6b0bfd5918876692d5f4101840851c1625f37c2f..5e9c52080fd372e54a70b358ea60d38555b24147 100644 (file)
@@ -1615,7 +1615,7 @@ void AssemblyWriter::printFunction(const Function *F) {
   const AttributeSet &Attrs = F->getAttributes();
   if (!OldStyleAttrSyntax && Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
     AttributeSet AS = Attrs.getFnAttributes();
-    std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, true);
+    std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
     if (!AttrStr.empty())
       Out << "; Function Attrs: " << AttrStr << '\n';
   }
@@ -1682,7 +1682,7 @@ void AssemblyWriter::printFunction(const Function *F) {
       Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
   } else {
     AttributeSet AS = Attrs.getFnAttributes();
-    std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, true);
+    std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
     if (!AttrStr.empty())
       Out << ' ' << AttrStr;
   }
@@ -2156,7 +2156,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, false, true)
+        << I->first.getAsString(AttributeSet::FunctionIndex, true, true)
         << " }\n";
 }
 
index d2b438f37cacdeed694a620497c90a1a034a4143..98dcecfba6b56413ea6a6f494abad0de95fe9510 100644 (file)
@@ -485,7 +485,7 @@ std::string AttributeSetNode::getAsString(bool TargetIndependent,
   std::string Str = "";
   for (SmallVectorImpl<Attribute>::const_iterator I = AttrList.begin(),
          E = AttrList.end(); I != E; ) {
-    if (!TargetIndependent || !I->isStringAttribute()) {
+    if (TargetIndependent || !I->isStringAttribute()) {
       Str += I->getAsString(InAttrGrp);
       if (++I != E) Str += " ";
     } else {