Move C++ code out of the C headers and into either C++ headers
[oota-llvm.git] / lib / Transforms / ObjCARC / ObjCARC.cpp
1 //===-- ObjCARC.cpp -------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
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/Wrap.h"
21 #include "llvm/Support/CommandLine.h"
22
23 namespace llvm {
24   class PassRegistry;
25 }
26
27 using namespace llvm;
28 using namespace llvm::objcarc;
29
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),
36                        cl::init(true));
37
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);
46 }
47
48 void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
49   initializeObjCARCOpts(*unwrap(R));
50 }