40 #define DEBUG_TYPE "objc-arc-expand"
47 using namespace llvm::objcarc;
53 bool doInitialization(
Module &M)
override;
69 "objc-arc-expand",
"ObjC ARC expansion",
false,
false)
72 return new ObjCARCExpand();
75 void ObjCARCExpand::getAnalysisUsage(
AnalysisUsage &AU)
const {
79 bool ObjCARCExpand::doInitialization(
Module &M) {
84 bool ObjCARCExpand::runOnFunction(
Function &
F) {
94 DEBUG(
dbgs() <<
"ObjCARCExpand: Visiting Function: " << F.
getName() <<
"\n");
99 DEBUG(
dbgs() <<
"ObjCARCExpand: Visiting: " << *Inst <<
"\n");
113 Value *
Value = cast<CallInst>(Inst)->getArgOperand(0);
114 DEBUG(
dbgs() <<
"ObjCARCExpand: Old = " << *Inst <<
"\n"
115 " New = " << *Value <<
"\n");
124 DEBUG(
dbgs() <<
"ObjCARCExpand: Finished List.\n\n");
Pass interface - Implemented by all 'passes'.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A Module instance is used to store all the information related to an LLVM module. ...
StringRef getName() const
Return a constant reference to the value's name.
objc_autoreleaseReturnValue
inst_iterator inst_begin(Function *F)
objc_retainAutoreleasedReturnValue
bool EnableARCOpts
A handy option to enable/disable all ARC Optimizations.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
bool ModuleHasARC(const Module &M)
Test if the given module looks interesting to run ARC optimization on.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
Pass * createObjCARCExpandPass()
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
ARCInstKind GetBasicARCInstKind(const Value *V)
Determine which objc runtime call instruction class V belongs to.
INITIALIZE_PASS(ObjCARCExpand,"objc-arc-expand","ObjC ARC expansion", false, false) Pass *llvm
void setPreservesCFG()
This function should be called by the pass, iff they do not:
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
objc_retainAutoreleaseReturnValue
LLVM Value Representation.
inst_iterator inst_end(Function *F)
void initializeObjCARCExpandPass(PassRegistry &)