diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 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 d2121dcebe..7a8e01d5d7 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; +} |