mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Add 'nonnull', a new parameter and return attribute which indicates that the pointer is not null. Instcombine will elide comparisons between these and null. Patch by Luqman Aden!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209185 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -193,6 +193,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
|
||||
return "noinline";
|
||||
if (hasAttribute(Attribute::NonLazyBind))
|
||||
return "nonlazybind";
|
||||
if (hasAttribute(Attribute::NonNull))
|
||||
return "nonnull";
|
||||
if (hasAttribute(Attribute::NoRedZone))
|
||||
return "noredzone";
|
||||
if (hasAttribute(Attribute::NoReturn))
|
||||
@@ -392,6 +394,7 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
|
||||
case Attribute::Builtin: return 1ULL << 41;
|
||||
case Attribute::OptimizeNone: return 1ULL << 42;
|
||||
case Attribute::InAlloca: return 1ULL << 43;
|
||||
case Attribute::NonNull: return 1ULL << 44;
|
||||
}
|
||||
llvm_unreachable("Unsupported attribute type");
|
||||
}
|
||||
@@ -1177,6 +1180,7 @@ AttributeSet AttributeFuncs::typeIncompatible(Type *Ty, uint64_t Index) {
|
||||
.addAttribute(Attribute::Nest)
|
||||
.addAttribute(Attribute::NoAlias)
|
||||
.addAttribute(Attribute::NoCapture)
|
||||
.addAttribute(Attribute::NonNull)
|
||||
.addAttribute(Attribute::ReadNone)
|
||||
.addAttribute(Attribute::ReadOnly)
|
||||
.addAttribute(Attribute::StructRet)
|
||||
|
||||
Reference in New Issue
Block a user