ObjCARC.cpp revision 249259
150479Speter//===-- ObjCARC.cpp -------------------------------------------------------===//
246432Sphk//
346155Sphk//                     The LLVM Compiler Infrastructure
474816Sru//
546155Sphk// This file is distributed under the University of Illinois Open Source
680029Sobrien// License. See LICENSE.TXT for details.
780029Sobrien//
880029Sobrien//===----------------------------------------------------------------------===//
9//
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.
13//
14//===----------------------------------------------------------------------===//
15
16#include "ObjCARC.h"
17#include "llvm-c/Core.h"
18#include "llvm-c/Initialization.h"
19#include "llvm/InitializePasses.h"
20#include "llvm/Support/CommandLine.h"
21
22namespace llvm {
23  class PassRegistry;
24}
25
26using namespace llvm;
27using namespace llvm::objcarc;
28
29/// \brief A handy option to enable/disable all ARC Optimizations.
30bool llvm::objcarc::EnableARCOpts;
31static cl::opt<bool, true>
32EnableARCOptimizations("enable-objc-arc-opts",
33                       cl::location(EnableARCOpts),
34                       cl::init(true));
35
36/// initializeObjCARCOptsPasses - Initialize all passes linked into the
37/// ObjCARCOpts library.
38void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
39  initializeObjCARCAliasAnalysisPass(Registry);
40  initializeObjCARCAPElimPass(Registry);
41  initializeObjCARCExpandPass(Registry);
42  initializeObjCARCContractPass(Registry);
43  initializeObjCARCOptPass(Registry);
44}
45
46void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
47  initializeObjCARCOpts(*unwrap(R));
48}
49