[llvm] r180844 - Now that the underlying issue is fixed, revert r180750 and r180722.

Rafael Espindola rafael.espindola at gmail.com
Wed May 1 06:07:03 PDT 2013


Author: rafael
Date: Wed May  1 08:07:03 2013
New Revision: 180844

URL: http://llvm.org/viewvc/llvm-project?rev=180844&view=rev
Log:
Now that the underlying issue is fixed, revert r180750 and r180722.

The cause of the windows failures was fixed by r180791. Revert to the state
after Sabre's original revert.

Original message:

revert r179735, it has no testcases, and doesn't really make sense.

Modified:
    llvm/trunk/include/llvm/IR/Attributes.h
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/lib/IR/AttributeImpl.h
    llvm/trunk/lib/IR/Attributes.cpp

Modified: llvm/trunk/include/llvm/IR/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Attributes.h?rev=180844&r1=180843&r2=180844&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Attributes.h (original)
+++ llvm/trunk/include/llvm/IR/Attributes.h Wed May  1 08:07:03 2013
@@ -307,8 +307,7 @@ public:
   unsigned getStackAlignment(unsigned Index) const;
 
   /// \brief Return the attributes at the index as a string.
-  std::string getAsString(unsigned Index, bool TargetIndependent = true,
-                          bool InAttrGrp = false) const;
+  std::string getAsString(unsigned Index, bool InAttrGrp = false) const;
 
   typedef ArrayRef<Attribute>::iterator iterator;
 

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=180844&r1=180843&r2=180844&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Wed May  1 08:07:03 2013
@@ -1608,7 +1608,22 @@ void AssemblyWriter::printFunction(const
   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::writeAllAttributeGr
   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";
 }
 
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/IR/AttributeImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AttributeImpl.h?rev=180844&r1=180843&r2=180844&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AttributeImpl.h (original)
+++ llvm/trunk/lib/IR/AttributeImpl.h Wed May  1 08:07:03 2013
@@ -178,7 +178,7 @@ public:
 
   unsigned getAlignment() const;
   unsigned getStackAlignment() const;
-  std::string getAsString(bool TargetIndependent, bool InAttrGrp) const;
+  std::string getAsString(bool InAttrGrp) const;
 
   typedef SmallVectorImpl<Attribute>::iterator       iterator;
   typedef SmallVectorImpl<Attribute>::const_iterator const_iterator;

Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=180844&r1=180843&r2=180844&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Wed May  1 08:07:03 2013
@@ -483,16 +483,13 @@ unsigned AttributeSetNode::getStackAlign
   return 0;
 }
 
-std::string AttributeSetNode::getAsString(bool TargetIndependent,
-                                          bool InAttrGrp) const {
+std::string AttributeSetNode::getAsString(bool InAttrGrp) const {
   std::string Str;
   for (SmallVectorImpl<Attribute>::const_iterator I = AttrList.begin(),
          E = AttrList.end(); I != E; ++I) {
-    if (TargetIndependent || !I->isStringAttribute()) {
-      if (I != AttrList.begin())
-        Str += ' ';
-      Str += I->getAsString(InAttrGrp);
-    }
+    if (I != AttrList.begin())
+      Str += ' ';
+    Str += I->getAsString(InAttrGrp);
   }
   return Str;
 }
@@ -848,10 +845,10 @@ unsigned AttributeSet::getStackAlignment
   return ASN ? ASN->getStackAlignment() : 0;
 }
 
-std::string AttributeSet::getAsString(unsigned Index, bool TargetIndependent,
+std::string AttributeSet::getAsString(unsigned Index,
                                       bool InAttrGrp) const {
   AttributeSetNode *ASN = getAttributes(Index);
-  return ASN ? ASN->getAsString(TargetIndependent, InAttrGrp) : std::string("");
+  return ASN ? ASN->getAsString(InAttrGrp) : std::string("");
 }
 
 /// \brief The attributes for the specified index are returned.





More information about the llvm-commits mailing list