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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 3 08:59:49 PST 2020


xazax.hun added a comment.

In D72018#1803012 <https://reviews.llvm.org/D72018#1803012>, @aaron.ballman wrote:

> In D72018#1802636 <https://reviews.llvm.org/D72018#1802636>, @NoQ wrote:
>
> > Would changing the literal in the attribute have the same effect? I.e., `acquire_handle("Fuchsia_But_Please_Ignore_Me")`.
>
>
> It should, but doesn't currently because we don't have any checking that the string literal matches a name in the static analyzer or clang-tidy for that attribute.


Actually, the static analyzer checker does check for the literal, so this could work.

> 
> 
> In D72018#1801739 <https://reviews.llvm.org/D72018#1801739>, @xazax.hun wrote:
> 
>> I think if there are many problems with this concept, I will fall back to hard code this information in the checker instead of using an annotation.
> 
> 
> How much hard coded information would this remove? How often do you find that users want to add to the list of hard coded functions themselves but can't? Maybe the benefits to the attribute outweigh the downside and it is worth exploring ways to resolve some of these concerns -- I don't have a good feeling for the problem space though.

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.


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