Skip to content

Commit

Permalink
[-Wunsafe-buffer-usage] Add fix-its for function parameters using the…
Browse files Browse the repository at this point in the history
… `span` strategy

Generate fix-its for function parameters that are raw pointers used
unsafely.  Currently, the analyzer fixes one parameter at a time.

Fix-its for a function parameter includes:

- Fix the parameter declaration of the definition, result in a new
  overload of the function. We call the function with the original
  signature the old overload.
- For any other existing declaration of the old overload, mark it with
  the [[unsafe_buffer_usage]] attribute and generate a new overload
  declaration next to it.
- Creates a new definition for the old overload, which is simply
  defined by a call to the new overload.

Reviewed by: NoQ (Artem Dergachev), t-rasmud (Rashmi Mudduluru), and
             jkorous (Jan Korous)

Differential revision: https://reviews.llvm.org/D143048
  • Loading branch information
ziqingluo-90 committed Jun 9, 2023
1 parent aff35b2 commit 1e270be
Show file tree
Hide file tree
Showing 7 changed files with 850 additions and 19 deletions.

0 comments on commit 1e270be

Please sign in to comment.