Expose canInstUseRefCountValues as swift::canNeverUseValues.

canInstUseRefCountValues should have always been named
canInstNotUseRefCountValues. I don't remember how it get renamed as such. Even
though it is a little weird to have a "canNever" in a function name, it makes
sense here to contrast it with canUseValue which returns if a specific user can
use a ptr in a way that requires the ptr to be alive. This in contrast says that
a user can never use a ptr in a manner where the ptr must be alive. I.e. this is
a universal quantifier.

Swift SVN r22961
This commit is contained in:
Michael Gottesman
2014-10-27 09:15:57 +00:00
parent ea88457258
commit a014c65205
2 changed files with 9 additions and 2 deletions

View File

@@ -203,7 +203,7 @@ static bool canApplyOfBuiltinUseNonTrivialValues(BuiltinInst *BInst) {
}
/// Returns true if Inst is a function that we know never uses ref count values.
static bool canInstUseRefCountValues(SILInstruction *Inst) {
bool swift::arc::canNeverUseValues(SILInstruction *Inst) {
switch (Inst->getKind()) {
// These instructions do not use other values.
case ValueKind::FunctionRefInst:
@@ -302,7 +302,7 @@ bool swift::arc::canUseValue(SILInstruction *User, SILValue Ptr,
AliasAnalysis *AA) {
// If Inst is an instruction that we know can never use values with reference
// semantics, return true.
if (canInstUseRefCountValues(User))
if (canNeverUseValues(User))
return false;
// If the user is a load or a store and we can prove that it does not access