[llvm-commits] [llvm] r170518 - in /llvm/trunk: include/llvm/Attributes.h lib/VMCore/Verifier.cpp
Bill Wendling
isanbard at gmail.com
Wed Dec 19 01:15:11 PST 2012
Author: void
Date: Wed Dec 19 03:15:11 2012
New Revision: 170518
URL: http://llvm.org/viewvc/llvm-project?rev=170518&view=rev
Log:
Inline hasFunctionOnlyAttrs into its only use.
Modified:
llvm/trunk/include/llvm/Attributes.h
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/include/llvm/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Attributes.h?rev=170518&r1=170517&r2=170518&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Attributes.h (original)
+++ llvm/trunk/include/llvm/Attributes.h Wed Dec 19 03:15:11 2012
@@ -117,30 +117,6 @@
/// 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;
}
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=170518&r1=170517&r2=170518&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Dec 19 03:15:11 2012
@@ -529,7 +529,25 @@
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);
More information about the llvm-commits
mailing list