[llvm] r180750 - Revert the command line option patch. However, keep the part that makes this pass on Windows. I.e., we don't emit the target dependent attributes in a comment before the function.

Bill Wendling isanbard at gmail.com
Mon Apr 29 16:48:06 PDT 2013


Author: void
Date: Mon Apr 29 18:48:06 2013
New Revision: 180750

URL: http://llvm.org/viewvc/llvm-project?rev=180750&view=rev
Log:
Revert the command line option patch. However, keep the part that makes this pass on Windows. I.e., we don't emit the target dependent attributes in a comment before the function.

Modified:
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/lib/IR/Attributes.cpp

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=180750&r1=180749&r2=180750&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Mon Apr 29 18:48:06 2013
@@ -33,7 +33,6 @@
 #include "llvm/IR/TypeFinder.h"
 #include "llvm/IR/ValueSymbolTable.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -43,12 +42,6 @@
 #include <cctype>
 using namespace llvm;
 
-static cl::opt<bool>
-OldStyleAttrSyntax("enable-old-style-attr-syntax",
-    cl::desc("Output attributes on functions rather than in attribute groups"),
-    cl::Hidden,
-    cl::init(false));
-
 // Make virtual table appear in this compilation unit.
 AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {}
 
@@ -1385,7 +1378,7 @@ void AssemblyWriter::printModule(const M
     printFunction(I);
 
   // Output all attribute groups.
-  if (!OldStyleAttrSyntax && !Machine.as_empty()) {
+  if (!Machine.as_empty()) {
     Out << '\n';
     writeAllAttributeGroups();
   }
@@ -1613,7 +1606,7 @@ void AssemblyWriter::printFunction(const
     Out << "; Materializable\n";
 
   const AttributeSet &Attrs = F->getAttributes();
-  if (!OldStyleAttrSyntax && Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
+  if (Attrs.hasAttributes(AttributeSet::FunctionIndex)) {
     AttributeSet AS = Attrs.getFnAttributes();
     std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
     if (!AttrStr.empty())
@@ -1677,15 +1670,8 @@ void AssemblyWriter::printFunction(const
   Out << ')';
   if (F->hasUnnamedAddr())
     Out << " unnamed_addr";
-  if (!OldStyleAttrSyntax) {
-    if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
-      Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
-  } else {
-    AttributeSet AS = Attrs.getFnAttributes();
-    std::string AttrStr = AS.getAsString(AttributeSet::FunctionIndex, false);
-    if (!AttrStr.empty())
-      Out << ' ' << AttrStr;
-  }
+  if (Attrs.hasAttributes(AttributeSet::FunctionIndex))
+    Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
   if (F->hasSection()) {
     Out << " section \"";
     PrintEscapedString(F->getSection(), Out);

Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=180750&r1=180749&r2=180750&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Mon Apr 29 18:48:06 2013
@@ -851,8 +851,7 @@ unsigned AttributeSet::getStackAlignment
 std::string AttributeSet::getAsString(unsigned Index, bool TargetIndependent,
                                       bool InAttrGrp) const {
   AttributeSetNode *ASN = getAttributes(Index);
-  return ASN ? ASN->getAsString(TargetIndependent, InAttrGrp) :
-    std::string("");
+  return ASN ? ASN->getAsString(TargetIndependent, InAttrGrp) : std::string("");
 }
 
 /// \brief The attributes for the specified index are returned.





More information about the llvm-commits mailing list