compiler/resolution/lifetime.cpp
// Normalizes the lifetime to the intrinsic lifetime as appropriate
// for cases such as getting the lifetime of a local variable.
// This doesn't always occur though, in the inference, so that
// a variable containing a borrow can have an inferred lifetime greater
// than its intrinsic lifetime.
Normalizes the lifetime to the intrinsic lifetime as appropriate
for cases such as getting the lifetime of a local variable.
This doesn't always occur though, in the inference, so that
a variable containing a borrow can have an inferred lifetime greater
than its intrinsic lifetime.
Normalizes the lifetime to the intrinsic lifetime as appropriate for cases such as getting the lifetime of a local variable . This doesn ' t always occur though in the inference so that a variable containing a borrow can have an inferred lifetime greater than its intrinsic lifetime .
LifetimePair LifetimeState::lifetimeForActual(Symbol* sym, bool usedAsRef, bool usedAsBorrow, FnSymbol* inFn) {
  bool combineForRef = usedAsRef;
  bool combineForBorrow = usedAsBorrow && containsOwnedClass(sym->type);
  bool combineForOuter = !isLocalVariable(inFn, sym);
  bool combineForArg = isArgSymbol(sym);
  if (combineForRef || combineForBorrow || combineForOuter || combineForArg)
    return combinedLifetimeForSymbol(sym);
  return inferredLifetimeForSymbol(sym);
}
LifetimePair LifetimeState :: lifetimeForActual ( Symbol * sym , bool usedAsRef , bool usedAsBorrow , FnSymbol * inFn ) { bool combineForRef = usedAsRef ; bool combineForBorrow = usedAsBorrow && containsOwnedClass ( sym -> type ) ; bool combineForOuter = ! isLocalVariable ( inFn , sym ) ; bool combineForArg = isArgSymbol ( sym ) ; if ( combineForRef || combineForBorrow || combineForOuter || combineForArg ) return combinedLifetimeForSymbol ( sym ) ; return inferredLifetimeForSymbol ( sym ) ; }
Normalizes the lifetime to the intrinsic lifetime as appropriate
for cases such as getting the lifetime of a local variable.
Normalizes the lifetime to the intrinsic lifetime as appropriate for cases such as getting the lifetime of a local variable .
// Careful here, as sym might not be a canonical symbol, // or it might be, so it being a ref or not is an uncertain matter.