blob: 6ea038b8ba8c2f37126a00137d70093d73a79b2a [file] [log] [blame]
Michael Gottesman23a1ee52013-01-29 04:58:30 +00001//===-- ObjCARC.cpp -------------------------------------------------------===//
Michael Gottesman79d8d812013-01-28 01:35:51 +00002//
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"
Benjamin Kramer6ecb1e72013-02-15 12:30:38 +000018#include "llvm-c/Initialization.h"
Michael Gottesman79d8d812013-01-28 01:35:51 +000019#include "llvm/InitializePasses.h"
Michael Gottesman283e0792013-01-28 03:35:20 +000020#include "llvm/Support/CommandLine.h"
Michael Gottesman79d8d812013-01-28 01:35:51 +000021
Michael Gottesman9bfcf282013-01-28 05:51:58 +000022namespace llvm {
23 class PassRegistry;
24}
25
Michael Gottesman79d8d812013-01-28 01:35:51 +000026using namespace llvm;
Michael Gottesman08904e32013-01-28 03:28:38 +000027using 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",
Michael Gottesman6806b512013-04-17 20:48:03 +000033 cl::desc("enable/disable all ARC Optimizations"),
Michael Gottesman08904e32013-01-28 03:28:38 +000034 cl::location(EnableARCOpts),
35 cl::init(true));
Michael Gottesman79d8d812013-01-28 01:35:51 +000036
37/// initializeObjCARCOptsPasses - Initialize all passes linked into the
38/// ObjCARCOpts library.
39void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
40 initializeObjCARCAliasAnalysisPass(Registry);
41 initializeObjCARCAPElimPass(Registry);
42 initializeObjCARCExpandPass(Registry);
43 initializeObjCARCContractPass(Registry);
44 initializeObjCARCOptPass(Registry);
Rafael Espindolaa3b5b602014-11-17 02:28:27 +000045 initializePAEvalPass(Registry);
Michael Gottesman79d8d812013-01-28 01:35:51 +000046}
47
48void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
49 initializeObjCARCOpts(*unwrap(R));
50}