Inline hasFunctionOnlyAttrs into its only use.
authorBill Wendling <isanbard@gmail.com>
Wed, 19 Dec 2012 09:15:11 +0000 (09:15 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 19 Dec 2012 09:15:11 +0000 (09:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170518 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Attributes.h
lib/VMCore/Verifier.cpp

index dff48190235612b34b1460f9578258e8f25604b6..a6297e0f7f71f47f171038bb7b291cc448e92b0a 100644 (file)
@@ -117,30 +117,6 @@ public:
   /// alignment value.
   unsigned getStackAlignment() const;
 
-  /// \brief Attribute that may be applied to the function itself.  These cannot
-  /// be used on return values or function parameters.
-  bool hasFunctionOnlyAttrs() const {
-    return hasAttribute(Attribute::NoReturn) ||
-      hasAttribute(Attribute::NoUnwind) ||
-      hasAttribute(Attribute::ReadNone) ||
-      hasAttribute(Attribute::ReadOnly) ||
-      hasAttribute(Attribute::NoInline) ||
-      hasAttribute(Attribute::AlwaysInline) ||
-      hasAttribute(Attribute::OptimizeForSize) ||
-      hasAttribute(Attribute::StackProtect) ||
-      hasAttribute(Attribute::StackProtectReq) ||
-      hasAttribute(Attribute::NoRedZone) ||
-      hasAttribute(Attribute::NoImplicitFloat) ||
-      hasAttribute(Attribute::Naked) ||
-      hasAttribute(Attribute::InlineHint) ||
-      hasAttribute(Attribute::StackAlignment) ||
-      hasAttribute(Attribute::UWTable) ||
-      hasAttribute(Attribute::NonLazyBind) ||
-      hasAttribute(Attribute::ReturnsTwice) ||
-      hasAttribute(Attribute::AddressSafety) ||
-      hasAttribute(Attribute::MinSize);
-  }
-
   bool operator==(const Attribute &A) const {
     return Attrs == A.Attrs;
   }
index 17301872ea9a1d599f852ab23dc7ba844e62f738..aec44355fa5c3f9e3cce542a65b1b0aa111a5475 100644 (file)
@@ -529,7 +529,25 @@ void Verifier::VerifyParameterAttrs(Attribute Attrs, Type *Ty,
   if (!Attrs.hasAttributes())
     return;
 
-  Assert1(!Attrs.hasFunctionOnlyAttrs(),
+  Assert1(!Attrs.hasAttribute(Attribute::NoReturn) &&
+          !Attrs.hasAttribute(Attribute::NoUnwind) &&
+          !Attrs.hasAttribute(Attribute::ReadNone) &&
+          !Attrs.hasAttribute(Attribute::ReadOnly) &&
+          !Attrs.hasAttribute(Attribute::NoInline) &&
+          !Attrs.hasAttribute(Attribute::AlwaysInline) &&
+          !Attrs.hasAttribute(Attribute::OptimizeForSize) &&
+          !Attrs.hasAttribute(Attribute::StackProtect) &&
+          !Attrs.hasAttribute(Attribute::StackProtectReq) &&
+          !Attrs.hasAttribute(Attribute::NoRedZone) &&
+          !Attrs.hasAttribute(Attribute::NoImplicitFloat) &&
+          !Attrs.hasAttribute(Attribute::Naked) &&
+          !Attrs.hasAttribute(Attribute::InlineHint) &&
+          !Attrs.hasAttribute(Attribute::StackAlignment) &&
+          !Attrs.hasAttribute(Attribute::UWTable) &&
+          !Attrs.hasAttribute(Attribute::NonLazyBind) &&
+          !Attrs.hasAttribute(Attribute::ReturnsTwice) &&
+          !Attrs.hasAttribute(Attribute::AddressSafety) &&
+          !Attrs.hasAttribute(Attribute::MinSize),
           "Some attributes in '" + Attrs.getAsString() +
           "' only apply to functions!", V);