aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2020-09-08 10:10:36 -0500
committerJohannes Doerfert <johannes@jdoerfert.de>2020-10-05 23:23:05 -0500
commit2a078c3072043541ee0595aea6c8d7909f94c6f9 (patch)
tree5c638da3dce4540ba8972de16ba18c39155c6ee6 /llvm/lib/IR/Attributes.cpp
parentb9888980132e5511e85d4172a46e02475957298b (diff)
downloadllvm-2a078c3072043541ee0595aea6c8d7909f94c6f9.zip
llvm-2a078c3072043541ee0595aea6c8d7909f94c6f9.tar.gz
llvm-2a078c3072043541ee0595aea6c8d7909f94c6f9.tar.bz2
[AttributeFuncs] Consider `align` in `typeIncompatible`
Alignment attributes need to be dropped for non-pointer values. This also introduces a check into the verifier to ensure you don't use `align` on anything but a pointer. Test needed to be adjusted accordingly. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D87304
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index a3940c0..ecb0bd69 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1848,6 +1848,7 @@ AttrBuilder AttributeFuncs::typeIncompatible(Type *Ty) {
.addAttribute(Attribute::NoAlias)
.addAttribute(Attribute::NoCapture)
.addAttribute(Attribute::NonNull)
+ .addAlignmentAttr(1) // the int here is ignored
.addDereferenceableAttr(1) // the int here is ignored
.addDereferenceableOrNullAttr(1) // the int here is ignored
.addAttribute(Attribute::ReadNone)