class VariableArrayType

Declaration

class VariableArrayType : public ArrayType { /* full declaration omitted */ };

Description

Represents a C array with a specified size that is not an integer-constant-expression. For example, 'int s[x+foo()]'. Since the size expression is an arbitrary expression, we store it as such. Note: VariableArrayType's aren't uniqued (since the expressions aren't) and should not be: two lexically equivalent variable array types could mean different things, for example, these variables do not have the same type dynamically: void foo(int x) { int Y[x]; ++x; int Z[x]; }

Declared at: clang/include/clang/AST/Type.h:3105

Inherits from: ArrayType

Member Variables

private clang::Stmt* SizeExpr
An assignment-expression. VLA's are only permitted within a function block.
private clang::SourceRange Brackets
The range spanned by the left and right array brackets.

Inherited from Type:

protected

Method Overview

  • public void Profile(llvm::FoldingSetNodeID & ID)
  • private VariableArrayType(clang::QualType et, clang::QualType can, clang::Expr * e, clang::ArrayType::ArraySizeModifier sm, unsigned int tq, clang::SourceRange brackets)
  • public static bool classof(const clang::Type * T)
  • public clang::QualType desugar() const
  • public clang::SourceRange getBracketsRange() const
  • public clang::SourceLocation getLBracketLoc() const
  • public clang::SourceLocation getRBracketLoc() const
  • public clang::Expr * getSizeExpr() const
  • public bool isSugared() const

Inherited from ArrayType:

Inherited from FoldingSetBase::Node:

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    void Profile(llvm::FoldingSetNodeID& ID)

    Declared at: clang/include/clang/AST/Type.h:3141

    Parameters

    llvm::FoldingSetNodeID& ID

    VariableArrayType(
        clang::QualType et,
        clang::QualType can,
        clang::Expr* e,
        clang::ArrayType::ArraySizeModifier sm,
        unsigned int tq,
        clang::SourceRange brackets)

    Declared at: clang/include/clang/AST/Type.h:3115

    Parameters

    clang::QualType et
    clang::QualType can
    clang::Expr* e
    clang::ArrayType::ArraySizeModifier sm
    unsigned int tq
    clang::SourceRange brackets

    static bool classof(const clang::Type* T)

    Declared at: clang/include/clang/AST/Type.h:3137

    Parameters

    const clang::Type* T

    clang::QualType desugar() const

    Declared at: clang/include/clang/AST/Type.h:3135

    clang::SourceRange getBracketsRange() const

    Declared at: clang/include/clang/AST/Type.h:3130

    clang::SourceLocation getLBracketLoc() const

    Declared at: clang/include/clang/AST/Type.h:3131

    clang::SourceLocation getRBracketLoc() const

    Declared at: clang/include/clang/AST/Type.h:3132

    clang::Expr* getSizeExpr() const

    Declared at: clang/include/clang/AST/Type.h:3124

    bool isSugared() const

    Declared at: clang/include/clang/AST/Type.h:3134