1 //===-- ObjCARC.cpp --------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements common infrastructure for libLLVMObjCARCOpts.a, which
11 // implements several scalar transformations over the LLVM intermediate
12 // representation, including the C bindings for that library.
14 //===----------------------------------------------------------------------===//
18 #include "llvm-c/Initialization.h"
19 #include "llvm/Analysis/Passes.h"
20 #include "llvm/Analysis/Verifier.h"
21 #include "llvm/IR/DataLayout.h"
22 #include "llvm/InitializePasses.h"
23 #include "llvm/PassManager.h"
24 #include "llvm/Support/Commandline.h"
27 using namespace llvm::objcarc;
29 /// \brief A handy option to enable/disable all ARC Optimizations.
30 bool llvm::objcarc::EnableARCOpts;
31 static cl::opt<bool, true>
32 EnableARCOptimizations("enable-objc-arc-opts",
33 cl::location(EnableARCOpts),
36 /// initializeObjCARCOptsPasses - Initialize all passes linked into the
37 /// ObjCARCOpts library.
38 void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
39 initializeObjCARCAliasAnalysisPass(Registry);
40 initializeObjCARCAPElimPass(Registry);
41 initializeObjCARCExpandPass(Registry);
42 initializeObjCARCContractPass(Registry);
43 initializeObjCARCOptPass(Registry);
46 void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
47 initializeObjCARCOpts(*unwrap(R));