diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp b/contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp index 7a8e01d5d7..d2121dcebe 100644 --- a/contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp +++ b/contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp @@ -27,7 +27,7 @@ #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" -#include "llvm/IR/PassManager.h" +#include "llvm/IR/PassManager.h" #include "llvm/IR/Value.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" @@ -35,7 +35,7 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Transforms/ObjCARC.h" +#include "llvm/Transforms/ObjCARC.h" #define DEBUG_TYPE "objc-arc-expand" @@ -43,12 +43,12 @@ using namespace llvm; using namespace llvm::objcarc; namespace { -static bool runImpl(Function &F) { +static bool runImpl(Function &F) { if (!EnableARCOpts) return false; // If nothing in the Module uses ARC, don't do anything. - if (!ModuleHasARC(*F.getParent())) + if (!ModuleHasARC(*F.getParent())) return false; bool Changed = false; @@ -90,37 +90,37 @@ static bool runImpl(Function &F) { return Changed; } - -/// Early ARC transformations. -class ObjCARCExpand : public FunctionPass { - void getAnalysisUsage(AnalysisUsage &AU) const override; - bool runOnFunction(Function &F) override; - -public: - static char ID; - ObjCARCExpand() : FunctionPass(ID) { - initializeObjCARCExpandPass(*PassRegistry::getPassRegistry()); - } -}; -} // namespace - -char ObjCARCExpand::ID = 0; -INITIALIZE_PASS(ObjCARCExpand, "objc-arc-expand", "ObjC ARC expansion", false, - false) - -Pass *llvm::createObjCARCExpandPass() { return new ObjCARCExpand(); } - -void ObjCARCExpand::getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); -} - -bool ObjCARCExpand::runOnFunction(Function &F) { return runImpl(F); } - -PreservedAnalyses ObjCARCExpandPass::run(Function &F, - FunctionAnalysisManager &AM) { - if (!runImpl(F)) - return PreservedAnalyses::all(); - PreservedAnalyses PA; - PA.preserveSet<CFGAnalyses>(); - return PA; -} + +/// Early ARC transformations. +class ObjCARCExpand : public FunctionPass { + void getAnalysisUsage(AnalysisUsage &AU) const override; + bool runOnFunction(Function &F) override; + +public: + static char ID; + ObjCARCExpand() : FunctionPass(ID) { + initializeObjCARCExpandPass(*PassRegistry::getPassRegistry()); + } +}; +} // namespace + +char ObjCARCExpand::ID = 0; +INITIALIZE_PASS(ObjCARCExpand, "objc-arc-expand", "ObjC ARC expansion", false, + false) + +Pass *llvm::createObjCARCExpandPass() { return new ObjCARCExpand(); } + +void ObjCARCExpand::getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); +} + +bool ObjCARCExpand::runOnFunction(Function &F) { return runImpl(F); } + +PreservedAnalyses ObjCARCExpandPass::run(Function &F, + FunctionAnalysisManager &AM) { + if (!runImpl(F)) + return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet<CFGAnalyses>(); + return PA; +} |