aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorAugie Fackler <augie@google.com>2022-02-24 10:40:20 -0500
committerAugie Fackler <augie@google.com>2022-04-26 13:57:11 -0400
commita907d36cfe8069ce191ffada3b84e37ca50e05b6 (patch)
tree18b83da9db957fb528610cb2b1dd56e34c3ccdf9 /llvm/lib/IR/Attributes.cpp
parent3a9ae9cf7c341ff329550a5bcac8362715d3f4b3 (diff)
downloadllvm-a907d36cfe8069ce191ffada3b84e37ca50e05b6.zip
llvm-a907d36cfe8069ce191ffada3b84e37ca50e05b6.tar.gz
llvm-a907d36cfe8069ce191ffada3b84e37ca50e05b6.tar.bz2
Attributes: add a new `allocptr` attribute
This continues the push away from hard-coded knowledge about functions towards attributes. We'll use this to annotate free(), realloc() and cousins and obviate the hard-coded list of free functions. Differential Revision: https://reviews.llvm.org/D123083
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index c4759f8..3cade80 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1803,7 +1803,8 @@ AttributeMask AttributeFuncs::typeIncompatible(Type *Ty,
.addAttribute(Attribute::ByVal)
.addAttribute(Attribute::StructRet)
.addAttribute(Attribute::ByRef)
- .addAttribute(Attribute::ElementType);
+ .addAttribute(Attribute::ElementType)
+ .addAttribute(Attribute::AllocatedPointer);
}
// Attributes that only apply to pointers or vectors of pointers.