[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-14 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368878: [Sema][ObjC] Fix a -Wformat false positive with localizedStringForKey (authored by epilk, committed by ). Changed prior to commit: https://reviews.llvm.org/D27165?vs=214977=215150#toc

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. I like this approach much better! LGTM, aside from a minor nit. Comment at: clang/include/clang/Basic/IdentifierTable.h:754 + /// If this selector is the specific keyword selector described by Names. + bool

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-13 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. One minor request (which will be dead code in your patch), but otherwise LGTM. Comment at: clang/include/clang/Basic/IdentifierTable.h:754 + /// If this selector is the

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 214977. erik.pilkington added a comment. Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D27165/new/ https://reviews.llvm.org/D27165 Files: clang/include/clang/AST/FormatString.h

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-13 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I agree with just special-casing this for now. Comment at: clang/lib/Sema/SemaChecking.cpp:6800 +MD->getSelector() == +S.NSAPIObj->getLocalizedStringForKeySelector()) { + IgnoreStringsWithoutSpecifiers = true;

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 214925. erik.pilkington added a comment. Special case localizedStringForKey instead of using an attribute. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D27165/new/ https://reviews.llvm.org/D27165 Files:

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2019-08-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington commandeered this revision. erik.pilkington added a reviewer: arphaman. erik.pilkington added a comment. Herald added subscribers: dexonsmith, jkorous. Herald added a project: LLVM. Stealing this (with Alex's permission). I think it makes more sense to add a special case for the

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:862 +def FormatDynamicKeyArg : InheritableAttr { + let Spellings = [GCC<"format_dynamic_key_arg">]; + let Args = [IntArgument<"FormatIdx">]; arphaman wrote: > aaron.ballman wrote: > >

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 81952. arphaman added a comment. Update to fix a test failure. Repository: rL LLVM https://reviews.llvm.org/D27165 Files: include/clang/Analysis/Analyses/FormatString.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/Attr.td:862 +def FormatDynamicKeyArg : InheritableAttr { + let Spellings = [GCC<"format_dynamic_key_arg">]; + let Args = [IntArgument<"FormatIdx">]; aaron.ballman wrote: > Does GCC support this

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 81950. arphaman marked an inline comment as done. arphaman added a comment. The updated patch renames the attribute to `loads_format_specifier_value_using_key` and addresses Aaron's comments Repository: rL LLVM https://reviews.llvm.org/D27165 Files:

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:862 +def FormatDynamicKeyArg : InheritableAttr { + let Spellings = [GCC<"format_dynamic_key_arg">]; + let Args = [IntArgument<"FormatIdx">]; Does GCC support this attribute as well?

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-08 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping Repository: rL LLVM https://reviews.llvm.org/D27165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: aaron.ballman, manmanren. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch adds a new ``format_dynamic_key_arg``. It's intended to be used instead of ``format_arg`` for