//===- ObjCARCUtil.h - ObjC ARC Utility Functions ---------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// \file /// This file defines ARC utility functions which are used by various parts of /// the compiler. /// //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_OBJCARCUTIL_H #define LLVM_ANALYSIS_OBJCARCUTIL_H #include "llvm/Analysis/ObjCARCInstKind.h" #include "llvm/IR/Function.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/LLVMContext.h" namespace llvm { namespace objcarc { inline const char *getRVMarkerModuleFlagStr() { … } inline bool hasAttachedCallOpBundle(const CallBase *CB) { … } /// This function returns operand bundle clang_arc_attachedcall's argument, /// which is the address of the ARC runtime function. inline std::optional<Function *> getAttachedARCFunction(const CallBase *CB) { … } /// Check whether the function is retainRV/unsafeClaimRV. inline bool isRetainOrClaimRV(ARCInstKind Kind) { … } /// This function returns the ARCInstKind of the function attached to operand /// bundle clang_arc_attachedcall. It returns std::nullopt if the call doesn't /// have the operand bundle or the operand is null. Otherwise it returns either /// RetainRV or UnsafeClaimRV. inline ARCInstKind getAttachedARCFunctionKind(const CallBase *CB) { … } } // end namespace objcarc } // end namespace llvm #endif