1//===-- SVals.def - Metadata about SVal kinds -------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// The list of symbolic values (SVal kinds and sub-kinds) used in the Static
10// Analyzer. The distinction between loc:: and nonloc:: SVal namespaces is
11// currently hardcoded, because it is too peculiar and explicit to be handled
12// uniformly. In order to use this information, users of this file must define
13// one or more of the following macros:
14//
15// BASIC_SVAL(Id, Parent) - for specific SVal sub-kinds, which are
16// neither in loc:: nor in nonloc:: namespace; these classes occupy
17// their own base kind IdKind.
18//
19// ABSTRACT_SVAL(Id, Parent) - for abstract SVal classes which are
20// neither in loc:: nor in nonloc:: namespace,
21//
22// ABSTRACT_SVAL_WITH_KIND(Id, Parent) - for SVal classes which are also
23// neither in loc:: nor in nonloc:: namespace, but occupy a whole base kind
24// identifier IdKind, much like BASIC_SVALs.
25//
26// LOC_SVAL(Id, Parent) - for values in loc:: namespace, which occupy a sub-kind
27// loc::IdKind.
28//
29// NONLOC_SVAL(Id, Parent) - for values in nonloc:: namespace, which occupy a
30// sub-kind nonloc::IdKind.
31//
32//===----------------------------------------------------------------------===//
33
34#ifndef BASIC_SVAL
35#define BASIC_SVAL(Id, Parent)
36#endif
37
38#ifndef ABSTRACT_SVAL
39#define ABSTRACT_SVAL(Id, Parent)
40#endif
41
42#ifndef ABSTRACT_SVAL_WITH_KIND
43#define ABSTRACT_SVAL_WITH_KIND(Id, Parent) ABSTRACT_SVAL(Id, Parent)
44#endif
45
46#ifndef LOC_SVAL
47#define LOC_SVAL(Id, Parent)
48#endif
49
50#ifndef NONLOC_SVAL
51#define NONLOC_SVAL(Id, Parent)
52#endif
53
54BASIC_SVAL(UndefinedVal, SVal)
55ABSTRACT_SVAL(DefinedOrUnknownSVal, SVal)
56  BASIC_SVAL(UnknownVal, DefinedOrUnknownSVal)
57  ABSTRACT_SVAL(DefinedSVal, DefinedOrUnknownSVal)
58    ABSTRACT_SVAL_WITH_KIND(Loc, DefinedSVal)
59      LOC_SVAL(ConcreteInt, Loc)
60      LOC_SVAL(GotoLabel, Loc)
61      LOC_SVAL(MemRegionVal, Loc)
62    ABSTRACT_SVAL_WITH_KIND(NonLoc, DefinedSVal)
63      NONLOC_SVAL(CompoundVal, NonLoc)
64      NONLOC_SVAL(ConcreteInt, NonLoc)
65      NONLOC_SVAL(LazyCompoundVal, NonLoc)
66      NONLOC_SVAL(LocAsInteger, NonLoc)
67      NONLOC_SVAL(SymbolVal, NonLoc)
68      NONLOC_SVAL(PointerToMember, NonLoc)
69
70#undef NONLOC_SVAL
71#undef LOC_SVAL
72#undef ABSTRACT_SVAL_WITH_KIND
73#undef ABSTRACT_SVAL
74#undef BASIC_SVAL
75