class EnumConstantDecl

Declaration

class EnumConstantDecl : public ValueDecl, public Mergeable { /* full declaration omitted */ };

Description

An instance of this object exists for each enum constant that is defined. For example, in "enum X {a,b}", each of a/b are EnumConstantDecl's, X is an instance of EnumDecl, and the type of a/b is a TagType for the X EnumDecl.

Declared at: clang/include/clang/AST/Decl.h:3088

Inherits from: ValueDecl, Mergeable

Member Variables

private clang::Stmt* Init
private llvm::APSInt Val

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • public static clang::EnumConstantDecl * Create(clang::ASTContext & C, clang::EnumDecl * DC, clang::SourceLocation L, clang::IdentifierInfo * Id, clang::QualType T, clang::Expr * E, const llvm::APSInt & V)
  • public static clang::EnumConstantDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
  • protected EnumConstantDecl(clang::DeclContext * DC, clang::SourceLocation L, clang::IdentifierInfo * Id, clang::QualType T, clang::Expr * E, const llvm::APSInt & V)
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public clang::EnumConstantDecl * getCanonicalDecl()
  • public const clang::EnumConstantDecl * getCanonicalDecl() const
  • public const clang::Expr * getInitExpr() const
  • public clang::Expr * getInitExpr()
  • public const llvm::APSInt & getInitVal() const
  • public clang::SourceRange getSourceRange() const
  • public void setInitExpr(clang::Expr * E)
  • public void setInitVal(const llvm::APSInt & V)

Inherited from ValueDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::EnumConstantDecl* Create(
    clang::ASTContext& C,
    clang::EnumDecl* DC,
    clang::SourceLocation L,
    clang::IdentifierInfo* Id,
    clang::QualType T,
    clang::Expr* E,
    const llvm::APSInt& V)

Declared at: clang/include/clang/AST/Decl.h:3101

Parameters

clang::ASTContext& C
clang::EnumDecl* DC
clang::SourceLocation L
clang::IdentifierInfo* Id
clang::QualType T
clang::Expr* E
const llvm::APSInt& V

static clang::EnumConstantDecl*
CreateDeserialized(clang::ASTContext& C,
                   unsigned int ID)

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

Parameters

clang::ASTContext& C
unsigned int ID

EnumConstantDecl(clang::DeclContext* DC,
                 clang::SourceLocation L,
                 clang::IdentifierInfo* Id,
                 clang::QualType T,
                 clang::Expr* E,
                 const llvm::APSInt& V)

Declared at: clang/include/clang/AST/Decl.h:3093

Parameters

clang::DeclContext* DC
clang::SourceLocation L
clang::IdentifierInfo* Id
clang::QualType T
clang::Expr* E
const llvm::APSInt& V

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/Decl.h:3121

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/Decl.h:3122

Parameters

clang::Decl::Kind K

clang::EnumConstantDecl* getCanonicalDecl()

Description

Retrieves the canonical declaration of this enumerator.

Declared at: clang/include/clang/AST/Decl.h:3117

const clang::EnumConstantDecl* getCanonicalDecl()
    const

Declared at: clang/include/clang/AST/Decl.h:3118

const clang::Expr* getInitExpr() const

Declared at: clang/include/clang/AST/Decl.h:3107

clang::Expr* getInitExpr()

Declared at: clang/include/clang/AST/Decl.h:3108

const llvm::APSInt& getInitVal() const

Declared at: clang/include/clang/AST/Decl.h:3109

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

Declared at: clang/include/clang/AST/Decl.h:3114

void setInitExpr(clang::Expr* E)

Declared at: clang/include/clang/AST/Decl.h:3111

Parameters

clang::Expr* E

void setInitVal(const llvm::APSInt& V)

Declared at: clang/include/clang/AST/Decl.h:3112

Parameters

const llvm::APSInt& V