summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-09 09:51:10 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-09 09:51:10 +0000
commit943c29135e03e55f9a5dab393786171a4a536482 (patch)
tree7e8e95ae04dea6db150d6af46ad32333319a2afc /include
parent15c3789763e82b7c781ea1ebcae24de826259b75 (diff)
downloadllvm-943c29135e03e55f9a5dab393786171a4a536482.tar.gz
llvm-943c29135e03e55f9a5dab393786171a4a536482.tar.bz2
llvm-943c29135e03e55f9a5dab393786171a4a536482.tar.xz
Move the 'ParameterOnly' variable inside of the Attributes class and make it a method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Attributes.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index 2a0fbc0ee1..86a963419e 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -110,10 +110,6 @@ DECLARE_LLVM_ATTRIBUTE(AddressSafety,1ULL<<32) ///< Address safety checking is o
/// an exception might pass by.
/// uwtable + nounwind = Needs an entry because the ABI says so.
-/// @brief Attributes that only apply to function parameters.
-const AttrConst ParameterOnly = {ByVal_i | Nest_i |
- StructRet_i | NoCapture_i};
-
/// @brief Attributes that may be applied to the function itself. These cannot
/// be used on return values or function parameters.
const AttrConst FunctionOnly = {NoReturn_i | NoUnwind_i | ReadNone_i |
@@ -215,11 +211,6 @@ public:
static Attributes get(Builder &B);
static Attributes get(LLVMContext &Context, Builder &B);
- /// @brief Parameter attributes that do not apply to vararg call arguments.
- bool hasIncompatibleWithVarArgsAttrs() const {
- return hasAttribute(Attributes::StructRet);
- }
-
/// @brief Return true if the attribute is present.
bool hasAttribute(AttrVal Val) const;
@@ -231,14 +222,27 @@ public:
/// @brief Return true if the attributes are a non-null intersection.
bool hasAttributes(const Attributes &A) const;
- /// This returns the alignment field of an attribute as a byte alignment
+ /// @brief Returns the alignment field of an attribute as a byte alignment
/// value.
unsigned getAlignment() const;
- /// This returns the stack alignment field of an attribute as a byte alignment
- /// value.
+ /// @brief Returns the stack alignment field of an attribute as a byte
+ /// alignment value.
unsigned getStackAlignment() const;
+ /// @brief Parameter attributes that do not apply to vararg call arguments.
+ bool hasIncompatibleWithVarArgsAttrs() const {
+ return hasAttribute(Attributes::StructRet);
+ }
+
+ /// @brief Attributes that only apply to function parameters.
+ bool hasParameterOnlyAttrs() const {
+ return hasAttribute(Attributes::ByVal) ||
+ hasAttribute(Attributes::Nest) ||
+ hasAttribute(Attributes::StructRet) ||
+ hasAttribute(Attributes::NoCapture);
+ }
+
bool isEmptyOrSingleton() const;
// This is a "safe bool() operator".