class ConstantArrayType

Declaration

class ConstantArrayType : public ArrayType, private TrailingObjects { /* full declaration omitted */ };

Description

Represents the canonical version of C arrays with a specified constant size. For example, the canonical type for 'int A[4 + 4*100]' is a ConstantArrayType where the element type is 'int' and the size is 404.

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

Inherits from: ArrayType, TrailingObjects

Member Variables

private llvm::APInt Size

Inherited from Type:

protected

Method Overview

  • private ConstantArrayType(clang::QualType et, clang::QualType can, const llvm::APInt & size, const clang::Expr * sz, clang::ArrayType::ArraySizeModifier sm, unsigned int tq)
  • public void Profile(llvm::FoldingSetNodeID & ID, const clang::ASTContext & Ctx)
  • public static void Profile(llvm::FoldingSetNodeID & ID, const clang::ASTContext & Ctx, clang::QualType ET, const llvm::APInt & ArraySize, const clang::Expr * SizeExpr, clang::ArrayType::ArraySizeModifier SizeMod, unsigned int TypeQuals)
  • public static bool classof(const clang::Type * T)
  • public clang::QualType desugar() const
  • public static unsigned int getMaxSizeBits(const clang::ASTContext & Context)
  • public static unsigned int getNumAddressingBits(const clang::ASTContext & Context, clang::QualType ElementType, const llvm::APInt & NumElements)
  • public const llvm::APInt & getSize() const
  • public const clang::Expr * getSizeExpr() const
  • public bool isSugared() const
  • private unsigned int numTrailingObjects(OverloadToken<const clang::Expr *>) const

Inherited from ArrayType:

Inherited from FoldingSetBase::Node:

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    ConstantArrayType(
        clang::QualType et,
        clang::QualType can,
        const llvm::APInt& size,
        const clang::Expr* sz,
        clang::ArrayType::ArraySizeModifier sm,
        unsigned int tq)

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

    Parameters

    clang::QualType et
    clang::QualType can
    const llvm::APInt& size
    const clang::Expr* sz
    clang::ArrayType::ArraySizeModifier sm
    unsigned int tq

    void Profile(llvm::FoldingSetNodeID& ID,
                 const clang::ASTContext& Ctx)

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

    Parameters

    llvm::FoldingSetNodeID& ID
    const clang::ASTContext& Ctx

    static void Profile(
        llvm::FoldingSetNodeID& ID,
        const clang::ASTContext& Ctx,
        clang::QualType ET,
        const llvm::APInt& ArraySize,
        const clang::Expr* SizeExpr,
        clang::ArrayType::ArraySizeModifier SizeMod,
        unsigned int TypeQuals)

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

    Parameters

    llvm::FoldingSetNodeID& ID
    const clang::ASTContext& Ctx
    clang::QualType ET
    const llvm::APInt& ArraySize
    const clang::Expr* SizeExpr
    clang::ArrayType::ArraySizeModifier SizeMod
    unsigned int TypeQuals

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

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

    Parameters

    const clang::Type* T

    clang::QualType desugar() const

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

    static unsigned int getMaxSizeBits(
        const clang::ASTContext& Context)

    Description

    Determine the maximum number of active bits that an array's size can require, which limits the maximum size of the array.

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

    Parameters

    const clang::ASTContext& Context

    static unsigned int getNumAddressingBits(
        const clang::ASTContext& Context,
        clang::QualType ElementType,
        const llvm::APInt& NumElements)

    Description

    Determine the number of bits required to address a member of

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

    Parameters

    const clang::ASTContext& Context
    clang::QualType ElementType
    const llvm::APInt& NumElements

    const llvm::APInt& getSize() const

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

    const clang::Expr* getSizeExpr() const

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

    bool isSugared() const

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

    unsigned int numTrailingObjects(
        OverloadToken<const clang::Expr*>) const

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

    Parameters

    OverloadToken<const clang::Expr*>