mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Add a dereferenceable attribute
This attribute indicates that the parameter or return pointer is dereferenceable. Practically speaking, loads from such a pointer within the associated byte range are safe to speculatively execute. Such pointer parameters are common in source languages (C++ references, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -588,6 +588,8 @@ static Attribute::AttrKind GetAttrFromCode(uint64_t Code) {
|
||||
return Attribute::NonLazyBind;
|
||||
case bitc::ATTR_KIND_NON_NULL:
|
||||
return Attribute::NonNull;
|
||||
case bitc::ATTR_KIND_DEREFERENCEABLE:
|
||||
return Attribute::Dereferenceable;
|
||||
case bitc::ATTR_KIND_NO_RED_ZONE:
|
||||
return Attribute::NoRedZone;
|
||||
case bitc::ATTR_KIND_NO_RETURN:
|
||||
@ -689,8 +691,10 @@ std::error_code BitcodeReader::ParseAttributeGroupBlock() {
|
||||
return EC;
|
||||
if (Kind == Attribute::Alignment)
|
||||
B.addAlignmentAttr(Record[++i]);
|
||||
else
|
||||
else if (Kind == Attribute::StackAlignment)
|
||||
B.addStackAlignmentAttr(Record[++i]);
|
||||
else if (Kind == Attribute::Dereferenceable)
|
||||
B.addDereferenceableAttr(Record[++i]);
|
||||
} else { // String attribute
|
||||
assert((Record[i] == 3 || Record[i] == 4) &&
|
||||
"Invalid attribute group entry");
|
||||
|
Reference in New Issue
Block a user