26 #define DEBUG_TYPE "objc-arc-expand"
48 using namespace llvm::objcarc;
54 virtual bool doInitialization(
Module &M);
70 "objc-arc-expand",
"ObjC ARC expansion",
false,
false)
73 return new ObjCARCExpand();
76 void ObjCARCExpand::getAnalysisUsage(
AnalysisUsage &AU)
const {
80 bool ObjCARCExpand::doInitialization(
Module &M) {
85 bool ObjCARCExpand::runOnFunction(
Function &
F) {
95 DEBUG(
dbgs() <<
"ObjCARCExpand: Visiting Function: " << F.
getName() <<
"\n");
100 DEBUG(
dbgs() <<
"ObjCARCExpand: Visiting: " << *Inst <<
"\n");
114 Value *
Value = cast<CallInst>(Inst)->getArgOperand(0);
115 DEBUG(
dbgs() <<
"ObjCARCExpand: Old = " << *Inst <<
"\n"
116 " New = " << *Value <<
"\n");
125 DEBUG(
dbgs() <<
"ObjCARCExpand: Finished List.\n\n");
static PassRegistry * getPassRegistry()
The main container class for the LLVM Intermediate Representation.
static InstructionClass GetBasicInstructionClass(const Value *V)
Determine which objc runtime call instruction class V belongs to.
StringRef getName() const
inst_iterator inst_begin(Function *F)
ID
LLVM Calling Convention Representation.
bool EnableARCOpts
A handy option to enable/disable all ARC Optimizations.
void replaceAllUsesWith(Value *V)
Pass * createObjCARCExpandPass()
INITIALIZE_PASS(ObjCARCExpand,"objc-arc-expand","ObjC ARC expansion", false, false) Pass *llvm
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
objc_autoreleaseReturnValue
objc_retainAutoreleasedReturnValue
objc_retainAutoreleaseReturnValue
LLVM Value Representation.
inst_iterator inst_end(Function *F)
static bool ModuleHasARC(const Module &M)
Test if the given module looks interesting to run ARC optimization on.
void initializeObjCARCExpandPass(PassRegistry &)