[PATCH] D72018: [attributes] [analyzer] Add an attribute to prevent checkers from modeling a function

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 3 11:31:17 PST 2020


NoQ added a comment.

In D72018#1803144 <https://reviews.llvm.org/D72018#1803144>, @xazax.hun wrote:

> I expect not to have too many functions that need such exclusions. It was more about making it easier to do some exclusions without touching the analyzer. I will ask around what are the preferences of the team, maybe Artem's proposal will work for us.


I think it ultimately makes sense to introduce analyzer IPA hints ("please inline this function", "please evaluate this one conservatively", "please don't model effects of this function on checker state", etc.), given that otherwise our set of heuristics on this subject is incomprehensible.

But if you have a chance to hardcode a small list of legacy functions with weird behavior (that cannot be expressed with annotations; maybe add explicit modeling for such functions) and use the analyzer //enforce// the lack of other exceptional functions (so that everything else was expressible with annotations), that should be the way to go simply because it makes your function surfaces much easier to reason about for the programmer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72018





More information about the cfe-commits mailing list