mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +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:
@@ -76,6 +76,14 @@ unsigned Argument::getArgNo() const {
|
||||
return ArgIdx;
|
||||
}
|
||||
|
||||
/// hasNonNullAttr - Return true if this argument has the nonnull attribute on
|
||||
/// it in its containing function.
|
||||
bool Argument::hasNonNullAttr() const {
|
||||
if (!getType()->isPointerTy()) return false;
|
||||
return getParent()->getAttributes().
|
||||
hasAttribute(getArgNo()+1, Attribute::NonNull);
|
||||
}
|
||||
|
||||
/// hasByValAttr - Return true if this argument has the byval attribute on it
|
||||
/// in its containing function.
|
||||
bool Argument::hasByValAttr() const {
|
||||
|
Reference in New Issue
Block a user