blob: b86dff17fc217ec9caa7f46218221f2c290166ed [file] [log] [blame]
Michael Gottesman79d8d812013-01-28 01:35:51 +00001//===-- 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
Michael Gottesman08904e32013-01-28 03:28:38 +000016#include "ObjCARC.h"
Michael Gottesman9bfcf282013-01-28 05:51:58 +000017#include "llvm-c/Core.h"
Michael Gottesman79d8d812013-01-28 01:35:51 +000018#include "llvm/InitializePasses.h"
Michael Gottesman283e0792013-01-28 03:35:20 +000019#include "llvm/Support/CommandLine.h"
Michael Gottesman79d8d812013-01-28 01:35:51 +000020
Michael Gottesman9bfcf282013-01-28 05:51:58 +000021namespace llvm {
22 class PassRegistry;
23}
24
Michael Gottesman79d8d812013-01-28 01:35:51 +000025using namespace llvm;
Michael Gottesman08904e32013-01-28 03:28:38 +000026using namespace llvm::objcarc;
27
28/// \brief A handy option to enable/disable all ARC Optimizations.
29bool llvm::objcarc::EnableARCOpts;
30static cl::opt<bool, true>
31EnableARCOptimizations("enable-objc-arc-opts",
32 cl::location(EnableARCOpts),
33 cl::init(true));
Michael Gottesman79d8d812013-01-28 01:35:51 +000034
35/// initializeObjCARCOptsPasses - Initialize all passes linked into the
36/// ObjCARCOpts library.
37void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
38 initializeObjCARCAliasAnalysisPass(Registry);
39 initializeObjCARCAPElimPass(Registry);
40 initializeObjCARCExpandPass(Registry);
41 initializeObjCARCContractPass(Registry);
42 initializeObjCARCOptPass(Registry);
43}
44
45void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
46 initializeObjCARCOpts(*unwrap(R));
47}