clang: include/clang/Analysis/FlowSensitive/ASTOps.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ASTOPS_H

14#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_ASTOPS_H

15

22#include "llvm/ADT/DenseSet.h"

23#include "llvm/ADT/SetVector.h"

24

26namespace dataflow {

27

28

29

30

31

32

33

34

35

36

37

40

41

42

44

45

47

48

51

52

53

54

55

56

58public:

59

62

63

65 return BaseInits;

66 }

67

68

70 return FieldInits;

71 }

72

73private:

76

79

80

81

82 std::optional ImplicitValueInitForUnion;

83};

84

85

86

87

88

89

90

91

93public:

97 }

98

100

101

102

103

104

105 if (isa_and_nonnull(D) || isa_and_nonnull(D))

106 return true;

107

109 }

110

111

112

113

114

119 return DynamicRecursiveASTVisitor::TraverseCXXTypeidExpr(TIE);

120 return true;

121 }

123 return true;

124 }

125

127

128

131 return DynamicRecursiveASTVisitor::TraverseBindingDecl(BD);

132 }

133};

134

135

136

138

140

141

142 llvm::DenseSet<const VarDecl *> Globals;

143

144

145 llvm::DenseSet<const VarDecl *> Locals;

146

147

148 llvm::DenseSet<const FunctionDecl *> Functions;

149

150

151

153};

154

155

157

158

160

161}

162}

163

164#endif

Defines the clang::Expr interface and subclasses for C++ expressions.

C Language Family Type Representation.

A binding in a decomposition declaration.

VarDecl * getHoldingVar() const

Get the variable (if any) that holds the value of evaluating the binding.

Represents a list-initialization with parenthesis.

A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...

bool isPotentiallyEvaluated() const

Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr....

Decl - This represents one declaration (or definition), e.g.

Recursive AST visitor that supports extension via dynamic dispatch.

virtual bool TraverseDecl(Decl *D)

Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...

bool ShouldVisitLambdaBody

Whether this visitor should recurse into lambda body.

bool ShouldVisitImplicitCode

Whether this visitor should recurse into implicit code, e.g.

Represents a function declaration or definition.

Describes an C or C++ initializer list.

A (possibly-)qualified type.

Stmt - This represents one statement.

The base class of the type hierarchy.

UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.

Represents a variable declaration or definition.

Specialization of RecursiveASTVisitor that visits those nodes that are relevant to the dataflow analy...

bool TraverseTypeOfExprTypeLoc(TypeOfExprTypeLoc) override

bool TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *) override

bool TraverseBindingDecl(BindingDecl *BD) override

bool TraverseCXXTypeidExpr(CXXTypeidExpr *TIE) override

bool TraverseDecltypeTypeLoc(DecltypeTypeLoc) override

bool TraverseDecl(Decl *D) override

Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...

Helper class for initialization of a record with an InitListExpr.

ArrayRef< std::pair< const FieldDecl *, Expr * > > field_inits() const

ArrayRef< std::pair< const CXXBaseSpecifier *, Expr * > > base_inits() const

llvm::DenseMap< const ValueDecl *, StorageLocation * > FieldToLoc

ReferencedDecls getReferencedDecls(const FunctionDecl &FD)

Returns declarations that are declared in or referenced from FD.

const Expr & ignoreCFGOmittedNodes(const Expr &E)

Skip past nodes that the CFG does not emit.

FieldSet getObjectFields(QualType Type)

Returns the set of all fields in the type.

bool containsSameFields(const FieldSet &Fields, const RecordStorageLocation::FieldToLoc &FieldLocs)

Returns whether Fields and FieldLocs contain the same fields.

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

A collection of several types of declarations, all referenced from the same function.

llvm::DenseSet< const VarDecl * > Globals

All variables with static storage duration, notably including static member variables and static vari...

llvm::DenseSet< const VarDecl * > Locals

Local variables, not including parameters or static variables declared within a function.

llvm::DenseSet< const ParmVarDecl * > LambdaCapturedParams

When analyzing a lambda's call operator, the set of all parameters (from the surrounding function) th...

llvm::DenseSet< const FunctionDecl * > Functions

Free functions and member functions which are referenced (but not necessarily called).

FieldSet Fields

Non-static member variables.