clang: include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ENVIRONMENT_H

14#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ENVIRONMENT_H

15

19#include "llvm/ADT/ImmutableMap.h"

20#include

21

23

24class Stmt;

25

26namespace ento {

27

28class SValBuilder;

29class SymbolReaper;

30

31

32

33

34

36 const StackFrameContext *> {

37public:

39

42

43

44 static void Profile(llvm::FoldingSetNodeID &ID,

46 ID.AddPointer(E.getStmt());

47 ID.AddPointer(E.getLocationContext());

48 }

49

50 void Profile(llvm::FoldingSetNodeID &ID) const {

52 }

53};

54

55

57private:

59

60 using BindingsTy = llvm::ImmutableMap<EnvironmentEntry, SVal>;

61

62 BindingsTy ExprBindings;

63

64 Environment(BindingsTy eb) : ExprBindings(eb) {}

65

67

68public:

69 using iterator = BindingsTy::iterator;

70

72 iterator end() const { return ExprBindings.end(); }

73

74

75

77

78

79

81 env->ExprBindings.Profile(ID);

82 }

83

84

85

86 void Profile(llvm::FoldingSetNodeID& ID) const {

88 }

89

91 return ExprBindings == RHS.ExprBindings;

92 }

93

95 const LocationContext *LCtx = nullptr, const char *NL = "\n",

96 unsigned int Space = 0, bool IsDot = false) const;

97};

98

100private:

101 using FactoryTy = Environment::BindingsTy::Factory;

102

103 FactoryTy F;

104

105public:

107

110 }

111

112

114 bool Invalidate);

115

119};

120

121}

122

123}

124

125#endif

This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...

__device__ __2f16 float __ockl_bool s

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...

Stmt - This represents one statement.

An entry in the environment consists of a Stmt and an LocationContext.

const Stmt * getStmt() const

const LocationContext * getLocationContext() const

void Profile(llvm::FoldingSetNodeID &ID) const

static void Profile(llvm::FoldingSetNodeID &ID, const EnvironmentEntry &E)

Profile an EnvironmentEntry for inclusion in a FoldingSet.

Environment getInitialEnvironment()

Environment bindExpr(Environment Env, const EnvironmentEntry &E, SVal V, bool Invalidate)

Bind a symbolic value to the given environment entry.

Environment removeDeadBindings(Environment Env, SymbolReaper &SymReaper, ProgramStateRef state)

EnvironmentManager(llvm::BumpPtrAllocator &Allocator)

An immutable map from EnvironemntEntries to SVals.

SVal getSVal(const EnvironmentEntry &E, SValBuilder &svalBuilder) const

Fetches the current binding of the expression in the Environment.

void Profile(llvm::FoldingSetNodeID &ID) const

Profile - Used to profile the contents of this object for inclusion in a FoldingSet.

bool operator==(const Environment &RHS) const

static void Profile(llvm::FoldingSetNodeID &ID, const Environment *env)

Profile - Profile the contents of an Environment object for use in a FoldingSet.

void printJson(raw_ostream &Out, const ASTContext &Ctx, const LocationContext *LCtx=nullptr, const char *NL="\n", unsigned int Space=0, bool IsDot=false) const

BindingsTy::iterator iterator

SVal - This represents a symbolic expression, which can be either an L-value or an R-value.

A class responsible for cleaning up unused symbols.

The JSON file list parser is used to communicate input to InstallAPI.