[PATCH] D61710: lld: Add a warning limit, similar to the existing error limit

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 01:17:17 PDT 2019


ruiu added a comment.

In D61710#1496097 <https://reviews.llvm.org/D61710#1496097>, @arichardson wrote:

> I implemented the same thing for the CHERI fork of lld since I added some new warning that could in certain cases be emitted many times but are not necessarily a real problem.


What would you do if something is not a real problem? I'd think "fix all warning" is generally a good idea, so I'd try to fix the problem (if it is not a real problem) or suppress the warning, and when suppressing a warning, I'd do one by one. So I wouldn't personally suppress warnings as a whole, as it could hide other warnings.

I just came up with another (maybe crazy) idea. When we get an overwhelming number of warnings, they are usually of the same kind of warning. So, it might make sense to set a limit per a warning. And there's an easy (and probably a bit hacky) way to do that -- we can identify who calls `warn()` by an address returned by `__builtin_return_address()`. If some line invokes `warn()` more than a certain threshold (e.g. 20), we can immediately return from `warn()`.


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

https://reviews.llvm.org/D61710





More information about the llvm-commits mailing list