26 using namespace llvm::objcarc;
32 return OS <<
"ARCInstKind::Retain";
34 return OS <<
"ARCInstKind::RetainRV";
36 return OS <<
"ARCInstKind::RetainBlock";
38 return OS <<
"ARCInstKind::Release";
40 return OS <<
"ARCInstKind::Autorelease";
42 return OS <<
"ARCInstKind::AutoreleaseRV";
44 return OS <<
"ARCInstKind::AutoreleasepoolPush";
46 return OS <<
"ARCInstKind::AutoreleasepoolPop";
48 return OS <<
"ARCInstKind::NoopCast";
50 return OS <<
"ARCInstKind::FusedRetainAutorelease";
52 return OS <<
"ARCInstKind::FusedRetainAutoreleaseRV";
54 return OS <<
"ARCInstKind::LoadWeakRetained";
56 return OS <<
"ARCInstKind::StoreWeak";
58 return OS <<
"ARCInstKind::InitWeak";
60 return OS <<
"ARCInstKind::LoadWeak";
62 return OS <<
"ARCInstKind::MoveWeak";
64 return OS <<
"ARCInstKind::CopyWeak";
66 return OS <<
"ARCInstKind::DestroyWeak";
68 return OS <<
"ARCInstKind::StoreStrong";
70 return OS <<
"ARCInstKind::CallOrUser";
72 return OS <<
"ARCInstKind::Call";
74 return OS <<
"ARCInstKind::User";
76 return OS <<
"ARCInstKind::IntrinsicUser";
78 return OS <<
"ARCInstKind::None";
98 Type *ETy = PTy->getElementType();
112 .
Case(
"objc_retain_autorelease",
115 .
Case(
"objc_retainAutoreleaseReturnValue",
123 if (Pte->getElementType()->isIntegerTy(8))
135 if (
PointerType *Pte = dyn_cast<PointerType>(PTy->getElementType()))
136 if (Pte->getElementType()->isIntegerTy(8))
138 Type *ETy1 = PTy1->getElementType();
147 if (
PointerType *Pte1 = dyn_cast<PointerType>(ETy1))
148 if (Pte1->getElementType()->isIntegerTy(8))
156 .
Case(
"llvm.arc.annotation.topdown.bbstart",
158 .
Case(
"llvm.arc.annotation.topdown.bbend",
160 .
Case(
"llvm.arc.annotation.bottomup.bbstart",
162 .
Case(
"llvm.arc.annotation.bottomup.bbend",
176 case Intrinsic::returnaddress:
177 case Intrinsic::frameaddress:
178 case Intrinsic::stacksave:
179 case Intrinsic::stackrestore:
180 case Intrinsic::vastart:
181 case Intrinsic::vacopy:
182 case Intrinsic::vaend:
183 case Intrinsic::objectsize:
185 case Intrinsic::stackprotector:
186 case Intrinsic::eh_return_i32:
187 case Intrinsic::eh_return_i64:
188 case Intrinsic::eh_typeid_for:
189 case Intrinsic::eh_dwarf_cfa:
190 case Intrinsic::eh_sjlj_lsda:
191 case Intrinsic::eh_sjlj_functioncontext:
192 case Intrinsic::init_trampoline:
193 case Intrinsic::adjust_trampoline:
194 case Intrinsic::lifetime_start:
195 case Intrinsic::lifetime_end:
196 case Intrinsic::invariant_start:
197 case Intrinsic::invariant_end:
199 case Intrinsic::dbg_declare:
200 case Intrinsic::dbg_value:
216 case Intrinsic::memcpy:
217 case Intrinsic::memmove:
218 case Intrinsic::memset:
234 switch (
I->getOpcode()) {
252 case Instruction::Invoke:
255 case Instruction::BitCast:
256 case Instruction::GetElementPtr:
260 case Instruction::Br:
261 case Instruction::Switch:
262 case Instruction::IndirectBr:
263 case Instruction::Alloca:
264 case Instruction::VAArg:
265 case Instruction::Add:
266 case Instruction::FAdd:
267 case Instruction::Sub:
268 case Instruction::FSub:
269 case Instruction::Mul:
270 case Instruction::FMul:
271 case Instruction::SDiv:
272 case Instruction::UDiv:
273 case Instruction::FDiv:
274 case Instruction::SRem:
275 case Instruction::URem:
276 case Instruction::FRem:
277 case Instruction::Shl:
278 case Instruction::LShr:
279 case Instruction::AShr:
283 case Instruction::SExt:
284 case Instruction::ZExt:
285 case Instruction::Trunc:
286 case Instruction::IntToPtr:
287 case Instruction::FCmp:
288 case Instruction::FPTrunc:
289 case Instruction::FPExt:
290 case Instruction::FPToUI:
291 case Instruction::FPToSI:
292 case Instruction::UIToFP:
293 case Instruction::SIToFP:
294 case Instruction::InsertElement:
296 case Instruction::ShuffleVector:
297 case Instruction::ExtractValue:
299 case Instruction::ICmp:
ARCInstKind GetARCInstKind(const Value *V)
Map V to its ARCInstKind equivalence class.
objc_destroyWeak (derived)
bool IsUser(ARCInstKind Class)
Test if the given class is a kind of user.
LLVM Argument representation.
objc_loadWeakRetained (primitive)
could call objc_release and/or "use" pointers
CallInst - This class represents a function call, abstracting a target machine's calling convention...
objc_retainedObject, etc.
StringSwitch & Case(const char(&S)[N], const T &Value)
bool IsNoopOnNull(ARCInstKind Class)
Test if the given class represents instructions which do nothing if passed a null pointer...
bool IsForwarding(ARCInstKind Class)
Test if the given class represents instructions which return their argument verbatim.
static ARCInstKind GetCallSiteClass(ImmutableCallSite CS)
Helper for GetARCInstKind.
StringRef getName() const
Return a constant reference to the value's name.
static bool isUseOnlyIntrinsic(unsigned ID)
objc_autoreleaseReturnValue
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A Use represents the edge between a Value definition and its users.
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
objc_retainAutoreleasedReturnValue
bool IsAlwaysTail(ARCInstKind Class)
Test if the given class represents instructions which are always safe to mark with the "tail" keyword...
PointerType - Class to represent pointers.
raw_ostream & operator<<(raw_ostream &OS, const ARCInstKind Class)
static bool isInertIntrinsic(unsigned ID)
A switch()-like statement whose cases are string literals.
The instances of the Type class are immutable: once they are created, they are never changed...
APInt Or(const APInt &LHS, const APInt &RHS)
Bitwise OR function for APInt.
APInt Xor(const APInt &LHS, const APInt &RHS)
Bitwise XOR function for APInt.
ARCInstKind GetFunctionClass(const Function *F)
Determine if F is one of the special known Functions.
anything that is inert from an ARC perspective.
bool CanDecrementRefCount(ARCInstKind Kind)
Returns false if conservatively we can prove that any instruction mapped to this kind can not decreme...
ARCInstKind
Equivalence classes of instructions in the ARC Model.
Type * getType() const
All values are typed, get the type of this value.
bool IsNoThrow(ARCInstKind Class)
Test if the given class represents instructions which are always safe to mark with the nounwind attri...
Function * getCalledFunction() const
getCalledFunction - Return the function called, or null if this is an indirect function invocation...
R Default(const T &Value) const
static bool IsPotentialRetainableObjPtr(const Value *Op)
Test whether the given value is possible a retainable object pointer.
bool isIntegerTy() const
isIntegerTy - True if this is an instance of IntegerType.
objc_storeStrong (derived)
APInt And(const APInt &LHS, const APInt &RHS)
Bitwise AND function for APInt.
bool IsRetain(ARCInstKind Class)
Test if the given class is objc_retain or equivalent.
objc_storeWeak (primitive)
objc_retainAutoreleaseReturnValue
const ARM::ArchExtKind Kind
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
bool CanInterruptRV(ARCInstKind Class)
Test whether the given instruction can autorelease any pointer or cause an autoreleasepool pop...
bool IsNeverTail(ARCInstKind Class)
Test if the given class represents instructions which are never safe to mark with the "tail" keyword...
bool IsAutorelease(ARCInstKind Class)
Test if the given class is objc_autorelease or equivalent.