Author: Imad Aldij Date: 2025-03-17T07:59:20-04:00 New Revision: e0223fa24aedf14895ea31beb87dac6d5a2137f0
URL: https://github.com/llvm/llvm-project/commit/e0223fa24aedf14895ea31beb87dac6d5a2137f0 DIFF: https://github.com/llvm/llvm-project/commit/e0223fa24aedf14895ea31beb87dac6d5a2137f0.diff LOG: [Clang][NFC] Rename SecondArgIsLastNamedArgument for clarity and consistency (#131346) Change the name of the control variable `SecondArgIsLastNamedArgument` to `SecondArgIsLastNonVariadicArgument` for clarity and consistency. Following feedback on earlier PR that was merged: - https://github.com/llvm/llvm-project/pull/131238#discussion_r1995690691_ Added: Modified: clang/lib/Sema/SemaChecking.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 500e7be84f9fa..c6feb35efce85 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -4898,15 +4898,15 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) { return false; } - // These are valid if SecondArgIsLastNamedArgument is false after the next - // block. + // These are valid if SecondArgIsLastNonVariadicArgument is false after the + // next block. QualType Type; SourceLocation ParamLoc; bool IsCRegister = false; - bool SecondArgIsLastNamedArgument = false; + bool SecondArgIsLastNonVariadicArgument = false; if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Arg)) { if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) { - SecondArgIsLastNamedArgument = PV == LastParam; + SecondArgIsLastNonVariadicArgument = PV == LastParam; Type = PV->getType(); ParamLoc = PV->getLocation(); @@ -4915,7 +4915,7 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) { } } - if (!SecondArgIsLastNamedArgument) + if (!SecondArgIsLastNonVariadicArgument) Diag(TheCall->getArg(1)->getBeginLoc(), diag::warn_second_arg_of_va_start_not_last_non_variadic_param); else if (IsCRegister || Type->isReferenceType() || _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits