liberty/lib/Utilities/InlineFunctionWithVmap.cpp
// hasLifetimeMarkers - Check whether the given alloca already has
// lifetime.start or lifetime.end intrinsics.
Check whether the given alloca already has
lifetime.start or lifetime.end intrinsics.
Check whether the given alloca already has lifetime . start or lifetime . end intrinsics .
static bool hasLifetimeMarkers(AllocaInst *AI) {
  Type *Int8PtrTy = Type::getInt8PtrTy(AI->getType()->getContext());
  if (AI->getType() == Int8PtrTy)
    return isUsedByLifetimeMarker(AI);
  for (Value::user_iterator I = AI->user_begin(), E = AI->user_end(); I != E;
       ++I) {
    if (I->getType() != Int8PtrTy) continue;
    if (I->stripPointerCasts() != AI) continue;
    if (isUsedByLifetimeMarker(*I))
      return true;
  }
  return false;
}
static bool hasLifetimeMarkers ( AllocaInst * AI ) { Type * Int8PtrTy = Type :: getInt8PtrTy ( AI -> getType ( ) -> getContext ( ) ) ; if ( AI -> getType ( ) == Int8PtrTy ) return isUsedByLifetimeMarker ( AI ) ; for ( Value :: user_iterator I = AI -> user_begin ( ) , E = AI -> user_end ( ) ; I != E ; ++ I ) { if ( I -> getType ( ) != Int8PtrTy ) continue ; if ( I -> stripPointerCasts ( ) != AI ) continue ; if ( isUsedByLifetimeMarker ( * I ) ) return true ; } return false ; }
hasLifetimeMarkers - Check whether the given alloca already has
lifetime.start or lifetime.end intrinsics.
hasLifetimeMarkers - Check whether the given alloca already has lifetime . start or lifetime . end intrinsics .
// Do a scan to find all the casts to i8*.