clang: lib/AST/StmtIterator.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

17#include

18#include

19

20using namespace clang;

21

22

23

25 while (const ArrayType *vt = dyn_cast(t)) {

26 if (const VariableArrayType *vat = dyn_cast(vt))

27 if (vat->getSizeExpr())

28 return vat;

29

30 t = vt->getElementType().getTypePtr();

31 }

32

33 return nullptr;

34}

35

38

42

43 if (p)

44 return;

45

47 if (VarDecl* VD = dyn_cast(*DGI))

48 if (VD->hasInit())

49 return;

50

52 }

53 else {

56 }

57}

58

60 assert(getVAPtr() == nullptr);

62

63 if (ImmediateAdvance)

65

68 return;

69

71}

72

74 if (VarDecl* VD = dyn_cast(D)) {

77 return true;

78 }

79

80 if (VD->getInit())

81 return true;

82 }

83 else if (TypedefNameDecl* TD = dyn_cast(D)) {

85 FindVA(TD->getUnderlyingType().getTypePtr())) {

87 return true;

88 }

89 }

91 if (ECD->getInitExpr())

92 return true;

93 }

94

95 return false;

96}

97

99 : DGI(dgi), RawVAPtr(DeclGroupMode), DGE(dge) {

101}

102

104 : DGI(nullptr), RawVAPtr(SizeOfTypeVAMode) {

106}

107

110 assert(VAPtr->SizeExpr);

111 return const_cast<Stmt*&>(VAPtr->SizeExpr);

112 }

113

117}

static const VariableArrayType * FindVA(const Type *t)

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

static const VariableArrayType * FindVA(const Type *t)

C Language Family Type Representation.

Represents an array type, per C99 6.7.5.2 - Array Declarators.

QualType getElementType() const

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

An instance of this object exists for each enum constant that is defined.

const Type * getTypePtr() const

Retrieves a pointer to the underlying (unqualified) type.

void NextDecl(bool ImmediateAdvance=true)

void setVAPtr(const VariableArrayType *P)

Stmt *& GetDeclExpr() const

const VariableArrayType * getVAPtr() const

bool inSizeOfTypeVA() const

Stmt - This represents one statement.

The base class of the type hierarchy.

Base class for declarations which introduce a typedef-name.

Represents a variable declaration or definition.

Stmt ** getInitAddress()

Retrieve the address of the initializer expression.

Represents a C array with a specified size that is not an integer-constant-expression.

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

__UINTPTR_TYPE__ uintptr_t

An unsigned integer type with the property that any valid pointer to void can be converted to this ty...