#ifndef LLVM_LIB_TRANSFORMS_OBJCARC_DEPENDENCYANALYSIS_H
#define LLVM_LIB_TRANSFORMS_OBJCARC_DEPENDENCYANALYSIS_H
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/ObjCARCInstKind.h"
namespace llvm {
class BasicBlock;
class Instruction;
class Value;
}
namespace llvm {
namespace objcarc {
class ProvenanceAnalysis;
enum DependenceKind {
NeedsPositiveRetainCount,
AutoreleasePoolBoundary,
CanChangeRetainCount,
RetainAutoreleaseDep, RetainAutoreleaseRVDep };
llvm::Instruction *findSingleDependency(DependenceKind Flavor, const Value *Arg,
BasicBlock *StartBB,
Instruction *StartInst,
ProvenanceAnalysis &PA);
bool
Depends(DependenceKind Flavor, Instruction *Inst, const Value *Arg,
ProvenanceAnalysis &PA);
bool CanUse(const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA,
ARCInstKind Class);
bool CanAlterRefCount(const Instruction *Inst, const Value *Ptr,
ProvenanceAnalysis &PA, ARCInstKind Class);
bool CanDecrementRefCount(const Instruction *Inst, const Value *Ptr,
ProvenanceAnalysis &PA, ARCInstKind Class);
static inline bool CanDecrementRefCount(const Instruction *Inst,
const Value *Ptr,
ProvenanceAnalysis &PA) {
return CanDecrementRefCount(Inst, Ptr, PA, GetARCInstKind(Inst));
}
} }
#endif