diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -2378,9 +2378,9 @@ /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - /// getNumArgOperands - Return the number of funcletpad arguments. + /// arg_size - Return the number of funcletpad arguments. /// - unsigned getNumArgOperands() const { return getNumOperands() - 1; } + unsigned arg_size() const { return getNumOperands() - 1; } /// Convenience accessors diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2983,7 +2983,7 @@ : bitc::FUNC_CODE_INST_CLEANUPPAD; pushValue(FuncletPad.getParentPad(), InstID, Vals); - unsigned NumArgOperands = FuncletPad.getNumArgOperands(); + unsigned NumArgOperands = FuncletPad.arg_size(); Vals.push_back(NumArgOperands); for (unsigned Op = 0; Op != NumArgOperands; ++Op) pushValueAndType(FuncletPad.getArgOperand(Op), InstID, Vals); diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -779,7 +779,7 @@ } } else if (const auto *CPI = dyn_cast(FirstI)) { - for (unsigned I = CPI->getNumArgOperands(); I != 0; --I) { + for (unsigned I = CPI->arg_size(); I != 0; --I) { Value *TypeInfo = CPI->getArgOperand(I - 1)->stripPointerCasts(); addCatchTypeInfo(LandingPad, dyn_cast(TypeInfo)); } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1193,11 +1193,11 @@ // In case of single catch (...), we don't emit LSDA, so we don't need // this information. bool IsSingleCatchAllClause = - CPI->getNumArgOperands() == 1 && + CPI->arg_size() == 1 && cast(CPI->getArgOperand(0))->isNullValue(); // cathchpads for longjmp use an empty type list, e.g. catchpad within %0 [] // and they don't need LSDA info - bool IsCatchLongjmp = CPI->getNumArgOperands() == 0; + bool IsCatchLongjmp = CPI->arg_size() == 0; if (!IsSingleCatchAllClause && !IsCatchLongjmp) { // Create a mapping from landing pad label to landing pad index. bool IntrFound = false; diff --git a/llvm/lib/CodeGen/WasmEHPrepare.cpp b/llvm/lib/CodeGen/WasmEHPrepare.cpp --- a/llvm/lib/CodeGen/WasmEHPrepare.cpp +++ b/llvm/lib/CodeGen/WasmEHPrepare.cpp @@ -253,7 +253,7 @@ auto *CPI = cast(BB->getFirstNonPHI()); // In case of a single catch (...), we don't need to emit a personalify // function call - if (CPI->getNumArgOperands() == 1 && + if (CPI->arg_size() == 1 && cast(CPI->getArgOperand(0))->isNullValue()) prepareEHPad(BB, false); else diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -556,8 +556,8 @@ // Create the entry for this cleanup with the appropriate handler // properties. Finally and fault handlers are distinguished by arity. ClrHandlerType HandlerType = - (Cleanup->getNumArgOperands() ? ClrHandlerType::Fault - : ClrHandlerType::Finally); + (Cleanup->arg_size() ? ClrHandlerType::Fault + : ClrHandlerType::Finally); int CleanupState = addClrEHHandler(FuncInfo, HandlerParentState, -1, HandlerType, 0, Pad->getParent()); // Queue any child EH pads on the worklist. diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -4090,8 +4090,7 @@ Out << " within "; writeOperand(FPI->getParentPad(), /*PrintType=*/false); Out << " ["; - for (unsigned Op = 0, NumOps = FPI->getNumArgOperands(); Op < NumOps; - ++Op) { + for (unsigned Op = 0, NumOps = FPI->arg_size(); Op < NumOps; ++Op) { if (Op > 0) Out << ", "; writeOperand(FPI->getArgOperand(Op), /*PrintType=*/true); diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -2806,7 +2806,7 @@ unsigned LLVMGetNumArgOperands(LLVMValueRef Instr) { if (FuncletPadInst *FPI = dyn_cast(unwrap(Instr))) { - return FPI->getNumArgOperands(); + return FPI->arg_size(); } return unwrap(Instr)->arg_size(); }