summaryrefslogtreecommitdiff
path: root/include/llvm/Attributes.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-26 22:53:05 +0000
committerDevang Patel <dpatel@apple.com>2008-09-26 22:53:05 +0000
commit19c874638d9478a5d5028854817a5ee72293bb2b (patch)
tree748636424f3d1005b6c8713365639fb969466c37 /include/llvm/Attributes.h
parentd5d8191b202c0f96f33c826c93d9796451ff7fca (diff)
downloadllvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.gz
llvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.bz2
llvm-19c874638d9478a5d5028854817a5ee72293bb2b.tar.xz
Now Attributes are divided in three groups
- return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Attributes.h')
-rw-r--r--include/llvm/Attributes.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index 3adbf25115..bc7628011f 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -146,10 +146,23 @@ public:
//===--------------------------------------------------------------------===//
// Attribute List Accessors
//===--------------------------------------------------------------------===//
-
- /// getAttributes - The attributes for the specified index are
- /// returned. Attributes for the result are denoted with Idx = 0.
- Attributes getAttributes(unsigned Idx) const;
+ /// getParamAttributes - The attributes for the specified index are
+ /// returned.
+ Attributes getParamAttributes(unsigned Idx) const {
+ assert (Idx && Idx != ~0U && "Invalid parameter index!");
+ return getAttributes(Idx);
+ }
+
+ /// getRetAttributes - The attributes for the ret value are
+ /// returned.
+ Attributes getRetAttributes() const {
+ return getAttributes(0);
+ }
+
+ /// getFnAttributes - The function attributes are returned.
+ Attributes getFnAttributes() const {
+ return getAttributes(~0);
+ }
/// paramHasAttr - Return true if the specified parameter index has the
/// specified attribute set.
@@ -204,6 +217,11 @@ public:
private:
explicit AttrListPtr(AttributeListImpl *L);
+
+ /// getAttributes - The attributes for the specified index are
+ /// returned. Attributes for the result are denoted with Idx = 0.
+ Attributes getAttributes(unsigned Idx) const;
+
};
} // End llvm namespace