[PATCH] D67140: [analyzer][NFC] Fix inconsistent references to checkers as "checks"

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 10 02:18:35 PDT 2019


gribozavr added a comment.

In D67140#1664106 <https://reviews.llvm.org/D67140#1664106>, @NoQ wrote:

> In D67140#1659982 <https://reviews.llvm.org/D67140#1659982>, @gribozavr wrote:
>
> > We should take a page from desktop software here. If the messages were in a separate file, there would be a lot of people capable of mass-editing them. When messages are hardcoded in the tool code, navigating and editing them requires more skill, and definitely a lot more jumping around.
>
>
> In the Static Analyzer there's often an explosive amount of dynamically generated messages that are going to be pretty hard to stuff into a tablegen pattern. Say, you can probably turn this <https://github.com/llvm-mirror/clang/blob/release_90/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp#L210> into "`%0 %1 %2 with a %3 retain count into an out parameter %4%5`" but would it really help?


Unfortunately, that message is already not following best practices. One should not be passing snippets in natural language into substitutions. Every character that is a natural language construct should be in the message string. The only allowed substitutions are types, names, numbers and such. We already support %select in message strings, but there are frameworks that are more flexible -- we can port features from them into our message strings as needed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67140/new/

https://reviews.llvm.org/D67140





More information about the cfe-commits mailing list