[-Wcalled-once-parameter] Harden analysis in terms of block use
This patch introduces a very simple inter-procedural analysis between blocks and enclosing functions. We always analyze blocks first (analysis is done as part of semantic analysis that goes side-by-side with the parsing process), and at the moment of reporting we don't know how that block will be actually used. This patch introduces new logic delaying reports of the "never called" warnings on blocks. If we are not sure that the block will be called exactly once, we shouldn't warn our users about that. Double calls, however, don't require such delays. While analyzing the enclosing function, we can actually decide what we should do with those warnings. Additionally, as a side effect, we can be more confident about blocks in such context and can treat them not as escapes, but as direct calls. rdar://74090107 Differential Revision: https://reviews.llvm.org/D98688
Loading
Please register or sign in to comment