blob: d10d95e5b1ba75665ad6dee48d1248db7820845e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
//=- UnsafeBufferUsageGadgets.def - List of ways to use a buffer --*- C++ -*-=//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
/// A gadget is an individual operation in the code that may be of interest to
/// the UnsafeBufferUsage analysis.
#ifndef GADGET
#define GADGET(name)
#endif
/// Unsafe gadgets correspond to unsafe code patterns that warrant
/// an immediate warning.
#ifndef WARNING_GADGET
#define WARNING_GADGET(name) GADGET(name)
#endif
/// Safe gadgets correspond to code patterns that aren't unsafe but need to be
/// properly recognized in order to emit correct warnings and fixes over unsafe
/// gadgets.
#ifndef FIXABLE_GADGET
#define FIXABLE_GADGET(name) GADGET(name)
#endif
WARNING_GADGET(Increment)
WARNING_GADGET(Decrement)
WARNING_GADGET(ArraySubscript)
WARNING_GADGET(PointerArithmetic)
#undef FIXABLE_GADGET
#undef WARNING_GADGET
#undef GADGET
|