mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-24 20:25:32 -04:00
Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that LLVM treat arbitrary functions as allocation functions. This patch makes LLVM accept the `allocsize` attribute, and makes `@llvm.objectsize` recognize said attribute. The review for this was split into two patches for ease of reviewing: D18974 and D14933. As promised on the revisions, I'm landing both patches as a single commit. Differential Revision: http://reviews.llvm.org/D14933 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -164,6 +164,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
|
||||
switch (Kind) {
|
||||
case Attribute::Alignment:
|
||||
return bitc::ATTR_KIND_ALIGNMENT;
|
||||
case Attribute::AllocSize:
|
||||
return bitc::ATTR_KIND_ALLOC_SIZE;
|
||||
case Attribute::AlwaysInline:
|
||||
return bitc::ATTR_KIND_ALWAYS_INLINE;
|
||||
case Attribute::ArgMemOnly:
|
||||
|
||||
Reference in New Issue
Block a user