class CaseStmt

Declaration

class CaseStmt : public SwitchCase, private TrailingObjects { /* full declaration omitted */ };

Description

CaseStmt - Represent a case statement. It can optionally be a GNU case statement of the form LHS ... RHS representing a range of cases.

Declared at: clang/include/clang/AST/Stmt.h:1599

Inherits from: SwitchCase, TrailingObjects

Member Variables

Inherited from SwitchCase:

protected ColonLoc
protected NextSwitchCase = nullptr

Inherited from Stmt:

protected

Method Overview

  • private CaseStmt(clang::Expr * lhs, clang::Expr * rhs, clang::SourceLocation caseLoc, clang::SourceLocation ellipsisLoc, clang::SourceLocation colonLoc)
  • private CaseStmt(clang::Stmt::EmptyShell Empty, bool CaseStmtIsGNURange)
  • public static clang::CaseStmt * Create(const clang::ASTContext & Ctx, clang::Expr * lhs, clang::Expr * rhs, clang::SourceLocation caseLoc, clang::SourceLocation ellipsisLoc, clang::SourceLocation colonLoc)
  • public static clang::CaseStmt * CreateEmpty(const clang::ASTContext & Ctx, bool CaseStmtIsGNURange)
  • public bool caseStmtIsGNURange() const
  • public clang::Stmt::const_child_range children() const
  • public clang::Stmt::child_range children()
  • public static bool classof(const clang::Stmt * T)
  • public clang::SourceLocation getBeginLoc() const
  • public clang::SourceLocation getCaseLoc() const
  • public clang::SourceLocation getEllipsisLoc() const
  • public clang::SourceLocation getEndLoc() const
  • public clang::Expr * getLHS()
  • public const clang::Expr * getLHS() const
  • public clang::Expr * getRHS()
  • public const clang::Expr * getRHS() const
  • public clang::Stmt * getSubStmt()
  • public const clang::Stmt * getSubStmt() const
  • private unsigned int lhsOffset() const
  • private unsigned int numTrailingObjects(OverloadToken<clang::Stmt *>) const
  • private unsigned int numTrailingObjects(OverloadToken<clang::SourceLocation>) const
  • private unsigned int rhsOffset() const
  • public void setCaseLoc(clang::SourceLocation L)
  • public void setEllipsisLoc(clang::SourceLocation L)
  • public void setLHS(clang::Expr * Val)
  • public void setRHS(clang::Expr * Val)
  • public void setSubStmt(clang::Stmt * S)
  • private unsigned int subStmtOffset() const

Inherited from SwitchCase:

Inherited from Stmt:

Methods

CaseStmt(clang::Expr* lhs,
         clang::Expr* rhs,
         clang::SourceLocation caseLoc,
         clang::SourceLocation ellipsisLoc,
         clang::SourceLocation colonLoc)

Description

Build a case statement assuming that the storage for the trailing objects has been properly allocated.

Declared at: clang/include/clang/AST/Stmt.h:1636

Parameters

clang::Expr* lhs
clang::Expr* rhs
clang::SourceLocation caseLoc
clang::SourceLocation ellipsisLoc
clang::SourceLocation colonLoc

CaseStmt(clang::Stmt::EmptyShell Empty,
         bool CaseStmtIsGNURange)

Description

Build an empty switch case statement.

Declared at: clang/include/clang/AST/Stmt.h:1651

Parameters

clang::Stmt::EmptyShell Empty
bool CaseStmtIsGNURange

static clang::CaseStmt* Create(
    const clang::ASTContext& Ctx,
    clang::Expr* lhs,
    clang::Expr* rhs,
    clang::SourceLocation caseLoc,
    clang::SourceLocation ellipsisLoc,
    clang::SourceLocation colonLoc)

Description

Build a case statement.

Declared at: clang/include/clang/AST/Stmt.h:1658

Parameters

const clang::ASTContext& Ctx
clang::Expr* lhs
clang::Expr* rhs
clang::SourceLocation caseLoc
clang::SourceLocation ellipsisLoc
clang::SourceLocation colonLoc

static clang::CaseStmt* CreateEmpty(
    const clang::ASTContext& Ctx,
    bool CaseStmtIsGNURange)

Description

Build an empty case statement.

Declared at: clang/include/clang/AST/Stmt.h:1663

Parameters

const clang::ASTContext& Ctx
bool CaseStmtIsGNURange

bool caseStmtIsGNURange() const

Description

True if this case statement is of the form case LHS ... RHS, which is a GNU extension. In this case the RHS can be obtained with getRHS() and the location of the ellipsis can be obtained with getEllipsisLoc().

Declared at: clang/include/clang/AST/Stmt.h:1668

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/Stmt.h:1748

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/Stmt.h:1742

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

Declared at: clang/include/clang/AST/Stmt.h:1737

Parameters

const clang::Stmt* T

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/Stmt.h:1727

clang::SourceLocation getCaseLoc() const

Declared at: clang/include/clang/AST/Stmt.h:1670

clang::SourceLocation getEllipsisLoc() const

Description

Get the location of the ... in a case statement of the form LHS ... RHS.

Declared at: clang/include/clang/AST/Stmt.h:1674

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/Stmt.h:1728

clang::Expr* getLHS()

Declared at: clang/include/clang/AST/Stmt.h:1688

const clang::Expr* getLHS() const

Declared at: clang/include/clang/AST/Stmt.h:1692

clang::Expr* getRHS()

Declared at: clang/include/clang/AST/Stmt.h:1700

const clang::Expr* getRHS() const

Declared at: clang/include/clang/AST/Stmt.h:1706

clang::Stmt* getSubStmt()

Declared at: clang/include/clang/AST/Stmt.h:1718

const clang::Stmt* getSubStmt() const

Declared at: clang/include/clang/AST/Stmt.h:1719

unsigned int lhsOffset() const

Declared at: clang/include/clang/AST/Stmt.h:1630

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

Declared at: clang/include/clang/AST/Stmt.h:1622

Parameters

OverloadToken<clang::Stmt*>

unsigned int numTrailingObjects(
    OverloadToken<clang::SourceLocation>) const

Declared at: clang/include/clang/AST/Stmt.h:1626

Parameters

OverloadToken<clang::SourceLocation>

unsigned int rhsOffset() const

Declared at: clang/include/clang/AST/Stmt.h:1631

void setCaseLoc(clang::SourceLocation L)

Declared at: clang/include/clang/AST/Stmt.h:1671

Parameters

clang::SourceLocation L

void setEllipsisLoc(clang::SourceLocation L)

Description

Set the location of the ... in a case statement of the form LHS ... RHS. Assert that this case statement is of this form.

Declared at: clang/include/clang/AST/Stmt.h:1681

Parameters

clang::SourceLocation L

void setLHS(clang::Expr* Val)

Declared at: clang/include/clang/AST/Stmt.h:1696

Parameters

clang::Expr* Val

void setRHS(clang::Expr* Val)

Declared at: clang/include/clang/AST/Stmt.h:1712

Parameters

clang::Expr* Val

void setSubStmt(clang::Stmt* S)

Declared at: clang/include/clang/AST/Stmt.h:1723

Parameters

clang::Stmt* S

unsigned int subStmtOffset() const

Declared at: clang/include/clang/AST/Stmt.h:1632