10b57cec5SDimitry Andric//===-- Regions.def - Metadata about MemRegion kinds ------------*- C++ -*-===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric// The list of regions (MemRegion sub-classes) used in the Static Analyzer.
100b57cec5SDimitry Andric// In order to use this information, users of this file must define one or more
110b57cec5SDimitry Andric// of the three macros:
120b57cec5SDimitry Andric//
130b57cec5SDimitry Andric// REGION(Id, Parent) - for specific MemRegion sub-classes, reserving
140b57cec5SDimitry Andric// enum value IdKind for their kind.
150b57cec5SDimitry Andric//
160b57cec5SDimitry Andric// ABSTRACT_REGION(Id, Parent) - for abstract region classes,
170b57cec5SDimitry Andric//
180b57cec5SDimitry Andric// REGION_RANGE(Id, First, Last) - for ranges of kind-enums,
190b57cec5SDimitry Andric// allowing to determine abstract class of a region
200b57cec5SDimitry Andric// based on the kind-enum value.
210b57cec5SDimitry Andric//
220b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
230b57cec5SDimitry Andric
240b57cec5SDimitry Andric#ifndef REGION
250b57cec5SDimitry Andric#define REGION(Id, Parent)
260b57cec5SDimitry Andric#endif
270b57cec5SDimitry Andric
280b57cec5SDimitry Andric#ifndef ABSTRACT_REGION
290b57cec5SDimitry Andric#define ABSTRACT_REGION(Id, Parent)
300b57cec5SDimitry Andric#endif
310b57cec5SDimitry Andric
320b57cec5SDimitry Andric#ifndef REGION_RANGE
330b57cec5SDimitry Andric#define REGION_RANGE(Id, First, Last)
340b57cec5SDimitry Andric#endif
350b57cec5SDimitry Andric
360b57cec5SDimitry AndricABSTRACT_REGION(MemSpaceRegion, MemRegion)
370b57cec5SDimitry Andric  REGION(CodeSpaceRegion, MemSpaceRegion)
380b57cec5SDimitry Andric  ABSTRACT_REGION(GlobalsSpaceRegion, MemSpaceRegion)
390b57cec5SDimitry Andric    ABSTRACT_REGION(NonStaticGlobalSpaceRegion, GlobalsSpaceRegion)
400b57cec5SDimitry Andric      REGION(GlobalImmutableSpaceRegion, NonStaticGlobalSpaceRegion)
410b57cec5SDimitry Andric      REGION(GlobalInternalSpaceRegion, NonStaticGlobalSpaceRegion)
420b57cec5SDimitry Andric      REGION(GlobalSystemSpaceRegion, NonStaticGlobalSpaceRegion)
430b57cec5SDimitry Andric      REGION_RANGE(NON_STATIC_GLOBAL_MEMSPACES, GlobalImmutableSpaceRegionKind,
440b57cec5SDimitry Andric                                                GlobalSystemSpaceRegionKind)
450b57cec5SDimitry Andric    REGION(StaticGlobalSpaceRegion, MemSpaceRegion)
460b57cec5SDimitry Andric    REGION_RANGE(GLOBAL_MEMSPACES, GlobalImmutableSpaceRegionKind,
470b57cec5SDimitry Andric                                   StaticGlobalSpaceRegionKind)
480b57cec5SDimitry Andric  REGION(HeapSpaceRegion, MemSpaceRegion)
490b57cec5SDimitry Andric  ABSTRACT_REGION(StackSpaceRegion, MemSpaceRegion)
500b57cec5SDimitry Andric    REGION(StackArgumentsSpaceRegion, StackSpaceRegion)
510b57cec5SDimitry Andric    REGION(StackLocalsSpaceRegion, StackSpaceRegion)
520b57cec5SDimitry Andric    REGION_RANGE(STACK_MEMSPACES, StackArgumentsSpaceRegionKind,
530b57cec5SDimitry Andric                                  StackLocalsSpaceRegionKind)
540b57cec5SDimitry Andric  REGION(UnknownSpaceRegion, MemSpaceRegion)
550b57cec5SDimitry Andric  REGION_RANGE(MEMSPACES, CodeSpaceRegionKind,
560b57cec5SDimitry Andric                          UnknownSpaceRegionKind)
570b57cec5SDimitry AndricABSTRACT_REGION(SubRegion, MemRegion)
580b57cec5SDimitry Andric  REGION(AllocaRegion, SubRegion)
590b57cec5SDimitry Andric  REGION(SymbolicRegion, SubRegion)
600b57cec5SDimitry Andric  ABSTRACT_REGION(TypedRegion, SubRegion)
610b57cec5SDimitry Andric    REGION(BlockDataRegion, TypedRegion)
620b57cec5SDimitry Andric    ABSTRACT_REGION(CodeTextRegion, TypedRegion)
630b57cec5SDimitry Andric      REGION(BlockCodeRegion, CodeTextRegion)
640b57cec5SDimitry Andric      REGION(FunctionCodeRegion, CodeTextRegion)
650b57cec5SDimitry Andric      REGION_RANGE(CODE_TEXT_REGIONS, BlockCodeRegionKind,
660b57cec5SDimitry Andric                                      FunctionCodeRegionKind)
670b57cec5SDimitry Andric    ABSTRACT_REGION(TypedValueRegion, TypedRegion)
680b57cec5SDimitry Andric      REGION(CompoundLiteralRegion, TypedValueRegion)
690b57cec5SDimitry Andric      REGION(CXXBaseObjectRegion, TypedValueRegion)
700b57cec5SDimitry Andric      REGION(CXXDerivedObjectRegion, TypedValueRegion)
710b57cec5SDimitry Andric      REGION(CXXTempObjectRegion, TypedValueRegion)
7206c3fb27SDimitry Andric      REGION(CXXLifetimeExtendedObjectRegion, TypedValueRegion)
730b57cec5SDimitry Andric      REGION(CXXThisRegion, TypedValueRegion)
740b57cec5SDimitry Andric      ABSTRACT_REGION(DeclRegion, TypedValueRegion)
750b57cec5SDimitry Andric        REGION(FieldRegion, DeclRegion)
760b57cec5SDimitry Andric        REGION(ObjCIvarRegion, DeclRegion)
775ffd83dbSDimitry Andric        ABSTRACT_REGION(VarRegion, DeclRegion)
785ffd83dbSDimitry Andric          REGION(NonParamVarRegion, VarRegion)
795ffd83dbSDimitry Andric          REGION(ParamVarRegion, VarRegion)
805ffd83dbSDimitry Andric        REGION_RANGE(VAR_REGIONS, NonParamVarRegionKind,
815ffd83dbSDimitry Andric                                  ParamVarRegionKind)
820b57cec5SDimitry Andric      REGION_RANGE(DECL_REGIONS, FieldRegionKind,
835ffd83dbSDimitry Andric                                 ParamVarRegionKind)
840b57cec5SDimitry Andric      REGION(ElementRegion, TypedValueRegion)
850b57cec5SDimitry Andric      REGION(ObjCStringRegion, TypedValueRegion)
860b57cec5SDimitry Andric      REGION(StringRegion, TypedValueRegion)
870b57cec5SDimitry Andric      REGION_RANGE(TYPED_VALUE_REGIONS, CompoundLiteralRegionKind,
880b57cec5SDimitry Andric                                        StringRegionKind)
890b57cec5SDimitry Andric    REGION_RANGE(TYPED_REGIONS, BlockDataRegionKind,
900b57cec5SDimitry Andric                                StringRegionKind)
910b57cec5SDimitry Andric
920b57cec5SDimitry Andric#undef REGION_RANGE
930b57cec5SDimitry Andric#undef ABSTRACT_REGION
940b57cec5SDimitry Andric#undef REGION
95