summaryrefslogtreecommitdiffstats
path: root/include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
blob: 3c52c2bc71427e1adc460a6222af6a81e1c3645d (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//===-- Regions.def - Metadata about MemRegion kinds ------------*- 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
//
//===----------------------------------------------------------------------===//
//
// The list of regions (MemRegion sub-classes) used in the Static Analyzer.
// In order to use this information, users of this file must define one or more
// of the three macros:
//
// REGION(Id, Parent) - for specific MemRegion sub-classes, reserving
// enum value IdKind for their kind.
//
// ABSTRACT_REGION(Id, Parent) - for abstract region classes,
//
// REGION_RANGE(Id, First, Last) - for ranges of kind-enums,
// allowing to determine abstract class of a region
// based on the kind-enum value.
//
//===----------------------------------------------------------------------===//

#ifndef REGION
#define REGION(Id, Parent)
#endif

#ifndef ABSTRACT_REGION
#define ABSTRACT_REGION(Id, Parent)
#endif

#ifndef REGION_RANGE
#define REGION_RANGE(Id, First, Last)
#endif

ABSTRACT_REGION(MemSpaceRegion, MemRegion)
  REGION(CodeSpaceRegion, MemSpaceRegion)
  ABSTRACT_REGION(GlobalsSpaceRegion, MemSpaceRegion)
    ABSTRACT_REGION(NonStaticGlobalSpaceRegion, GlobalsSpaceRegion)
      REGION(GlobalImmutableSpaceRegion, NonStaticGlobalSpaceRegion)
      REGION(GlobalInternalSpaceRegion, NonStaticGlobalSpaceRegion)
      REGION(GlobalSystemSpaceRegion, NonStaticGlobalSpaceRegion)
      REGION_RANGE(NON_STATIC_GLOBAL_MEMSPACES, GlobalImmutableSpaceRegionKind,
                                                GlobalSystemSpaceRegionKind)
    REGION(StaticGlobalSpaceRegion, MemSpaceRegion)
    REGION_RANGE(GLOBAL_MEMSPACES, GlobalImmutableSpaceRegionKind,
                                   StaticGlobalSpaceRegionKind)
  REGION(HeapSpaceRegion, MemSpaceRegion)
  ABSTRACT_REGION(StackSpaceRegion, MemSpaceRegion)
    REGION(StackArgumentsSpaceRegion, StackSpaceRegion)
    REGION(StackLocalsSpaceRegion, StackSpaceRegion)
    REGION_RANGE(STACK_MEMSPACES, StackArgumentsSpaceRegionKind,
                                  StackLocalsSpaceRegionKind)
  REGION(UnknownSpaceRegion, MemSpaceRegion)
  REGION_RANGE(MEMSPACES, CodeSpaceRegionKind,
                          UnknownSpaceRegionKind)
ABSTRACT_REGION(SubRegion, MemRegion)
  REGION(AllocaRegion, SubRegion)
  REGION(SymbolicRegion, SubRegion)
  ABSTRACT_REGION(TypedRegion, SubRegion)
    REGION(BlockDataRegion, TypedRegion)
    ABSTRACT_REGION(CodeTextRegion, TypedRegion)
      REGION(BlockCodeRegion, CodeTextRegion)
      REGION(FunctionCodeRegion, CodeTextRegion)
      REGION_RANGE(CODE_TEXT_REGIONS, BlockCodeRegionKind,
                                      FunctionCodeRegionKind)
    ABSTRACT_REGION(TypedValueRegion, TypedRegion)
      REGION(CompoundLiteralRegion, TypedValueRegion)
      REGION(CXXBaseObjectRegion, TypedValueRegion)
      REGION(CXXDerivedObjectRegion, TypedValueRegion)
      REGION(CXXTempObjectRegion, TypedValueRegion)
      REGION(CXXThisRegion, TypedValueRegion)
      ABSTRACT_REGION(DeclRegion, TypedValueRegion)
        REGION(FieldRegion, DeclRegion)
        REGION(ObjCIvarRegion, DeclRegion)
        REGION(VarRegion, DeclRegion)
        REGION_RANGE(DECL_REGIONS, FieldRegionKind,
                                   VarRegionKind)
      REGION(ElementRegion, TypedValueRegion)
      REGION(ObjCStringRegion, TypedValueRegion)
      REGION(StringRegion, TypedValueRegion)
      REGION_RANGE(TYPED_VALUE_REGIONS, CompoundLiteralRegionKind,
                                        StringRegionKind)
    REGION_RANGE(TYPED_REGIONS, BlockDataRegionKind,
                                StringRegionKind)

#undef REGION_RANGE
#undef ABSTRACT_REGION
#undef REGION