[IR] Convert null-pointer-is-valid into an enum attribute
The "null-pointer-is-valid" attribute needs to be checked by many pointer-related combines. To make the check more efficient, convert it from a string into an enum attribute. In the future, this attribute may be replaced with data layout properties. Differential Revision: https://reviews.llvm.org/D78862
This commit is contained in:
@@ -1469,6 +1469,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
|
||||
return Attribute::NoCfCheck;
|
||||
case bitc::ATTR_KIND_NO_UNWIND:
|
||||
return Attribute::NoUnwind;
|
||||
case bitc::ATTR_KIND_NULL_POINTER_IS_VALID:
|
||||
return Attribute::NullPointerIsValid;
|
||||
case bitc::ATTR_KIND_OPT_FOR_FUZZING:
|
||||
return Attribute::OptForFuzzing;
|
||||
case bitc::ATTR_KIND_OPTIMIZE_FOR_SIZE:
|
||||
@@ -1654,7 +1656,7 @@ Error BitcodeReader::parseAttributeGroupBlock() {
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeFramePointerAttributes(B);
|
||||
UpgradeAttributes(B);
|
||||
MAttributeGroups[GrpID] = AttributeList::get(Context, Idx, B);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user