ObjCARC.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #include "ObjCARC.h"
  16. #include "llvm-c/Core.h"
  17. #include "llvm-c/Initialization.h"
  18. #include "llvm/InitializePasses.h"
  19. #include "llvm/Support/CommandLine.h"
  20. namespace llvm {
  21. class PassRegistry;
  22. }
  23. using namespace llvm;
  24. using namespace llvm::objcarc;
  25. /// \brief A handy option to enable/disable all ARC Optimizations.
  26. bool llvm::objcarc::EnableARCOpts;
  27. static cl::opt<bool, true>
  28. EnableARCOptimizations("enable-objc-arc-opts",
  29. cl::desc("enable/disable all ARC Optimizations"),
  30. cl::location(EnableARCOpts),
  31. cl::init(true));
  32. /// initializeObjCARCOptsPasses - Initialize all passes linked into the
  33. /// ObjCARCOpts library.
  34. void llvm::initializeObjCARCOpts(PassRegistry &Registry) {
  35. initializeObjCARCAliasAnalysisPass(Registry);
  36. initializeObjCARCAPElimPass(Registry);
  37. initializeObjCARCExpandPass(Registry);
  38. initializeObjCARCContractPass(Registry);
  39. initializeObjCARCOptPass(Registry);
  40. initializePAEvalPass(Registry);
  41. }
  42. void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R) {
  43. initializeObjCARCOpts(*unwrap(R));
  44. }