LLVM API Documentation

ObjCARC.cpp
Go to the documentation of this file.
00001 //===-- ObjCARC.cpp -------------------------------------------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements common infrastructure for libLLVMObjCARCOpts.a, which
00011 // implements several scalar transformations over the LLVM intermediate
00012 // representation, including the C bindings for that library.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #include "ObjCARC.h"
00017 #include "llvm-c/Core.h"
00018 #include "llvm-c/Initialization.h"
00019 #include "llvm/InitializePasses.h"
00020 #include "llvm/Support/CommandLine.h"
00021 
00022 namespace llvm {
00023   class PassRegistry;
00024 }
00025 
00026 using namespace llvm;
00027 using namespace llvm::objcarc;
00028 
00029 /// \brief A handy option to enable/disable all ARC Optimizations.
00030 bool llvm::objcarc::EnableARCOpts;
00031 static cl::opt<bool, true>
00032 EnableARCOptimizations("enable-objc-arc-opts",
00033                        cl::desc("enable/disable all ARC Optimizations"),
00034                        cl::location(EnableARCOpts),
00035                        cl::init(true));
00036 
00037 /// initializeObjCARCOptsPasses - Initialize all passes linked into the
00038 /// ObjCARCOpts library.
00039 void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
00040   initializeObjCARCAliasAnalysisPass(Registry);
00041   initializeObjCARCAPElimPass(Registry);
00042   initializeObjCARCExpandPass(Registry);
00043   initializeObjCARCContractPass(Registry);
00044   initializeObjCARCOptPass(Registry);
00045 }
00046 
00047 void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
00048   initializeObjCARCOpts(*unwrap(R));
00049 }