clang 22.0.0git
DynamicType.h
Go to the documentation of this file.
1/===- DynamicType.h - Dynamic type related APIs ----------------*- 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/ This file defines APIs that track and query dynamic type information. This
10/ information can be used to devirtualize calls during the symbolic execution
11/ or do type checking.
12/
13/===----------------------------------------------------------------------===/
14
15#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICTYPE_H
16#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICTYPE_H
17
18#include "clang/AST/Type.h"
25
26namespace clang {
27namespace ento {
28
29/ Get dynamic type information for the region \p MR.
31
32/ Get raw dynamic type information for the region \p MR.
33/ It might return null.
35 const MemRegion *MR);
36
37/ Get dynamic type information stored in a class object represented by \p Sym.
39 SymbolRef Sym);
40
41/ Get dynamic cast information from \p CastFromTy to \p CastToTy of \p MR.
43 const MemRegion *MR,
44 QualType CastFromTy,
45 QualType CastToTy);
46
47/ Set dynamic type information of the region; return the new state.
49 DynamicTypeInfo NewTy);
50
51/ Set dynamic type information of the region; return the new state.
53 QualType NewTy, bool CanBeSubClassed = true);
54
55/ Set constraint on a type contained in a class object; return the new state.
57 SymbolRef Sym,
58 DynamicTypeInfo NewTy);
59
60/ Set constraint on a type contained in a class object; return the new state.
62 SymbolRef Sym, QualType NewTy,
63 bool CanBeSubClassed = true);
64
65/ Set dynamic type and cast information of the region; return the new state.
67 const MemRegion *MR,
68 QualType CastFromTy,
69 QualType CastToTy,
70 bool IsCastSucceeds);
71
72/ Removes the dead type informations from \p State.
74
75/ Removes the dead cast informations from \p State.
77
78/ Removes the dead Class object type informations from \p State.
80 SymbolReaper &SR);
81
82void printDynamicTypeInfoJson(raw_ostream &Out, ProgramStateRef State,
83 const char *NL = "\n", unsigned int Space = 0,
84 bool IsDot = false);
85
86} / namespace ento
87} / namespace clang
88
89#endif / LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICTYPE_H
C Language Family Type Representation.
A (possibly-)qualified type.
Definition TypeBase.h:937
Stores the currently inferred strictest bound on the runtime type of a region in a given state along ...
MemRegion - The root abstract class for all memory regions.
Definition MemRegion.h:98
A class responsible for cleaning up unused symbols.
void printDynamicTypeInfoJson(raw_ostream &Out, ProgramStateRef State, const char *NL="\n", unsigned int Space=0, bool IsDot=false)
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
const SymExpr * SymbolRef
Definition SymExpr.h:133
ProgramStateRef setClassObjectDynamicTypeInfo(ProgramStateRef State, SymbolRef Sym, DynamicTypeInfo NewTy)
Set constraint on a type contained in a class object; return the new state.
ProgramStateRef removeDeadClassObjectTypes(ProgramStateRef State, SymbolReaper &SR)
Removes the dead Class object type informations from State.
DynamicTypeInfo getDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR)
Get dynamic type information for the region MR.
const DynamicTypeInfo * getRawDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR)
Get raw dynamic type information for the region MR.
const DynamicCastInfo * getDynamicCastInfo(ProgramStateRef State, const MemRegion *MR, QualType CastFromTy, QualType CastToTy)
Get dynamic cast information from CastFromTy to CastToTy of MR.
ProgramStateRef removeDeadCasts(ProgramStateRef State, SymbolReaper &SR)
Removes the dead cast informations from State.
ProgramStateRef setDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR, DynamicTypeInfo NewTy)
Set dynamic type information of the region; return the new state.
ProgramStateRef removeDeadTypes(ProgramStateRef State, SymbolReaper &SR)
Removes the dead type informations from State.
ProgramStateRef setDynamicTypeAndCastInfo(ProgramStateRef State, const MemRegion *MR, QualType CastFromTy, QualType CastToTy, bool IsCastSucceeds)
Set dynamic type and cast information of the region; return the new state.
DynamicTypeInfo getClassObjectDynamicTypeInfo(ProgramStateRef State, SymbolRef Sym)
Get dynamic type information stored in a class object represented by Sym.
The JSON file list parser is used to communicate input to InstallAPI.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant