[llvm-commits] [llvm] r165209 - in /llvm/trunk/lib: Transforms/IPO/GlobalOpt.cpp Transforms/Scalar/CodeGenPrepare.cpp VMCore/AsmWriter.cpp

Bill Wendling isanbard at gmail.com
Wed Oct 3 23:58:52 PDT 2012


Author: void
Date: Thu Oct  4 01:58:52 2012
New Revision: 165209

URL: http://llvm.org/viewvc/llvm-project?rev=165209&view=rev
Log:
Use method to query for attributes.

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=165209&r1=165208&r2=165209&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Oct  4 01:58:52 2012
@@ -2063,7 +2063,7 @@
 
 static AttrListPtr StripNest(const AttrListPtr &Attrs) {
   for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
-    if ((Attrs.getSlot(i).Attrs & Attribute::Nest) == 0)
+    if (!Attrs.getSlot(i).Attrs.hasNestAttr())
       continue;
 
     // There can be only one.

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=165209&r1=165208&r2=165209&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Oct  4 01:58:52 2012
@@ -714,7 +714,7 @@
   // See llvm::isInTailCallPosition().
   const Function *F = BB->getParent();
   Attributes CallerRetAttr = F->getAttributes().getRetAttributes();
-  if ((CallerRetAttr & Attribute::ZExt) || (CallerRetAttr & Attribute::SExt))
+  if (CallerRetAttr.hasZExtAttr() || CallerRetAttr.hasSExtAttr())
     return false;
 
   // Make sure there are no instructions between the PHI and return, or that the

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=165209&r1=165208&r2=165209&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Oct  4 01:58:52 2012
@@ -1243,7 +1243,7 @@
   // Print the type
   TypePrinter.print(Operand->getType(), Out);
   // Print parameter attributes list
-  if (Attrs != Attribute::None)
+  if (Attrs.hasAttributes())
     Out << ' ' << Attrs.getAsString();
   Out << ' ';
   // Print the operand
@@ -1556,7 +1556,7 @@
   FunctionType *FT = F->getFunctionType();
   const AttrListPtr &Attrs = F->getAttributes();
   Attributes RetAttrs = Attrs.getRetAttributes();
-  if (RetAttrs != Attribute::None)
+  if (RetAttrs.hasAttributes())
     Out <<  Attrs.getRetAttributes().getAsString() << ' ';
   TypePrinter.print(F->getReturnType(), Out);
   Out << ' ';
@@ -1586,7 +1586,7 @@
       TypePrinter.print(FT->getParamType(i), Out);
 
       Attributes ArgAttrs = Attrs.getParamAttributes(i+1);
-      if (ArgAttrs != Attribute::None)
+      if (ArgAttrs.hasAttributes())
         Out << ' ' << ArgAttrs.getAsString();
     }
   }
@@ -1600,7 +1600,7 @@
   if (F->hasUnnamedAddr())
     Out << " unnamed_addr";
   Attributes FnAttrs = Attrs.getFnAttributes();
-  if (FnAttrs != Attribute::None)
+  if (FnAttrs.hasAttributes())
     Out << ' ' << Attrs.getFnAttributes().getAsString();
   if (F->hasSection()) {
     Out << " section \"";
@@ -1634,7 +1634,7 @@
   TypePrinter.print(Arg->getType(), Out);
 
   // Output parameter attributes list
-  if (Attrs != Attribute::None)
+  if (Attrs.hasAttributes())
     Out << ' ' << Attrs.getAsString();
 
   // Output name, if available...
@@ -1849,7 +1849,7 @@
     Type *RetTy = FTy->getReturnType();
     const AttrListPtr &PAL = CI->getAttributes();
 
-    if (PAL.getRetAttributes() != Attribute::None)
+    if (PAL.getRetAttributes().hasAttributes())
       Out << ' ' << PAL.getRetAttributes().getAsString();
 
     // If possible, print out the short form of the call instruction.  We can
@@ -1873,7 +1873,7 @@
       writeParamOperand(CI->getArgOperand(op), PAL.getParamAttributes(op + 1));
     }
     Out << ')';
-    if (PAL.getFnAttributes() != Attribute::None)
+    if (PAL.getFnAttributes().hasAttributes())
       Out << ' ' << PAL.getFnAttributes().getAsString();
   } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
     Operand = II->getCalledValue();
@@ -1888,7 +1888,7 @@
       PrintCallingConv(II->getCallingConv(), Out);
     }
 
-    if (PAL.getRetAttributes() != Attribute::None)
+    if (PAL.getRetAttributes().hasAttributes())
       Out << ' ' << PAL.getRetAttributes().getAsString();
 
     // If possible, print out the short form of the invoke instruction. We can
@@ -1913,7 +1913,7 @@
     }
 
     Out << ')';
-    if (PAL.getFnAttributes() != Attribute::None)
+    if (PAL.getFnAttributes().hasAttributes())
       Out << ' ' << PAL.getFnAttributes().getAsString();
 
     Out << "\n          to ";





More information about the llvm-commits mailing list