2013-01-29 04:58:30 +00:00
|
|
|
//===-- ObjCARC.cpp -------------------------------------------------------===//
|
2013-01-28 01:35:51 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements common infrastructure for libLLVMObjCARCOpts.a, which
|
|
|
|
// implements several scalar transformations over the LLVM intermediate
|
|
|
|
// representation, including the C bindings for that library.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-28 03:28:38 +00:00
|
|
|
#include "ObjCARC.h"
|
2013-01-28 05:51:58 +00:00
|
|
|
#include "llvm-c/Core.h"
|
2013-02-15 12:30:38 +00:00
|
|
|
#include "llvm-c/Initialization.h"
|
2013-01-28 01:35:51 +00:00
|
|
|
#include "llvm/InitializePasses.h"
|
2013-01-28 03:35:20 +00:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2013-01-28 01:35:51 +00:00
|
|
|
|
2013-01-28 05:51:58 +00:00
|
|
|
namespace llvm {
|
|
|
|
class PassRegistry;
|
|
|
|
}
|
|
|
|
|
2013-01-28 01:35:51 +00:00
|
|
|
using namespace llvm;
|
2013-01-28 03:28:38 +00:00
|
|
|
using namespace llvm::objcarc;
|
|
|
|
|
|
|
|
/// \brief A handy option to enable/disable all ARC Optimizations.
|
|
|
|
bool llvm::objcarc::EnableARCOpts;
|
|
|
|
static cl::opt<bool, true>
|
|
|
|
EnableARCOptimizations("enable-objc-arc-opts",
|
2013-04-17 20:48:03 +00:00
|
|
|
cl::desc("enable/disable all ARC Optimizations"),
|
2013-01-28 03:28:38 +00:00
|
|
|
cl::location(EnableARCOpts),
|
|
|
|
cl::init(true));
|
2013-01-28 01:35:51 +00:00
|
|
|
|
|
|
|
/// initializeObjCARCOptsPasses - Initialize all passes linked into the
|
|
|
|
/// ObjCARCOpts library.
|
|
|
|
void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
|
|
|
|
initializeObjCARCAliasAnalysisPass(Registry);
|
|
|
|
initializeObjCARCAPElimPass(Registry);
|
|
|
|
initializeObjCARCExpandPass(Registry);
|
|
|
|
initializeObjCARCContractPass(Registry);
|
|
|
|
initializeObjCARCOptPass(Registry);
|
|
|
|
}
|
|
|
|
|
|
|
|
void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
|
|
|
|
initializeObjCARCOpts(*unwrap(R));
|
|
|
|
}
|