================ @@ -403,142 +369,183 @@ enum ArmSMEState : unsigned { ArmZT0Mask = 0b11 << 2 }; +bool SemaARM::CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, + unsigned ArgIdx, unsigned EltBitWidth, + unsigned VecBitWidth) { + + typedef bool (*OptionSetCheckFnTy)(int64_t Value); + + // Function that checks whether the operand (ArgIdx) is an immediate + // that is one of the predefined values. + auto CheckImmediateInSet = [&](OptionSetCheckFnTy CheckImm, ---------------- momchil-velikov wrote:
Naming and description: the lambda is actually more universal than just checking if an immediate is one of several predefined values - its current usage corresponds to the description, but not the lambda itself. I would suggest either renaming it to something like `CheckImmediateWithPredicate` or modifying it to take as a parameter the set of values to test against (perhaps as `std::initializer_list<int64_t>`, so one can call it like `foo(Arg, {1, 2, 3})`). https://github.com/llvm/llvm-project/pull/100278 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits