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 //===----------------------------------------------------------------------===//
17 #include "llvm-c/Core.h"
18 #include "llvm-c/Initialization.h"
19 #include "llvm/InitializePasses.h"
20 #include "llvm/Wrap.h"
21 #include "llvm/Support/CommandLine.h"
28 using namespace llvm::objcarc;
30 /// \brief A handy option to enable/disable all ARC Optimizations.
31 bool llvm::objcarc::EnableARCOpts;
32 static cl::opt<bool, true>
33 EnableARCOptimizations("enable-objc-arc-opts",
34 cl::desc("enable/disable all ARC Optimizations"),
35 cl::location(EnableARCOpts),
38 /// initializeObjCARCOptsPasses - Initialize all passes linked into the
39 /// ObjCARCOpts library.
40 void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
41 initializeObjCARCAliasAnalysisPass(Registry);
42 initializeObjCARCAPElimPass(Registry);
43 initializeObjCARCExpandPass(Registry);
44 initializeObjCARCContractPass(Registry);
45 initializeObjCARCOptPass(Registry);
48 void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
49 initializeObjCARCOpts(*unwrap(R));