clang API Documentation

Public Member Functions | Static Public Member Functions
clang::ArraySubscriptExpr Class Reference

ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting. More...

#include <Expr.h>

Inheritance diagram for clang::ArraySubscriptExpr:
Inheritance graph
[legend]
Collaboration diagram for clang::ArraySubscriptExpr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ArraySubscriptExpr (Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation rbracketloc)
 ArraySubscriptExpr (EmptyShell Shell)
 Create an empty array subscript expression.
ExprgetLHS ()
const ExprgetLHS () const
void setLHS (Expr *E)
ExprgetRHS ()
const ExprgetRHS () const
void setRHS (Expr *E)
ExprgetBase ()
const ExprgetBase () const
ExprgetIdx ()
const ExprgetIdx () const
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
SourceLocation getRBracketLoc () const
void setRBracketLoc (SourceLocation L)
SourceLocation getExprLoc () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)

Detailed Description

ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.

Definition at line 2068 of file Expr.h.


Constructor & Destructor Documentation

clang::ArraySubscriptExpr::ArraySubscriptExpr ( Expr lhs,
Expr rhs,
QualType  t,
ExprValueKind  VK,
ExprObjectKind  OK,
SourceLocation  rbracketloc 
) [inline]

Definition at line 2073 of file Expr.h.

Create an empty array subscript expression.

Definition at line 2089 of file Expr.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 2142 of file Expr.h.

static bool clang::ArraySubscriptExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::Expr.

Definition at line 2137 of file Expr.h.

References clang::Stmt::getStmtClass().

const Expr* clang::ArraySubscriptExpr::getBase ( ) const [inline]

Definition at line 2113 of file Expr.h.

References getLHS(), getRHS(), clang::Expr::getType(), and clang::Type::isIntegerType().

getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.

Reimplemented from clang::Expr.

Definition at line 2133 of file Expr.h.

References getBase(), and clang::Expr::getExprLoc().

const Expr* clang::ArraySubscriptExpr::getIdx ( ) const [inline]

Definition at line 2121 of file Expr.h.

References getLHS(), getRHS(), clang::Expr::getType(), and clang::Type::isIntegerType().

An array access can be written A[4] or 4[A] (both are equivalent).

  • getBase() and getIdx() always present the normalized view: A[4]. In this case getBase() returns "A" and getIdx() returns "4".
  • getLHS() and getRHS() present the syntactic view. e.g. for 4[A] getLHS() returns "4". Note: Because vector element access is also written A[4] we must predicate the format conversion in getBase and getIdx only on the the type of the RHS, as it is possible for the LHS to be a vector of integer type

Definition at line 2101 of file Expr.h.

Referenced by getBase(), getIdx(), getLocStart(), and GetUnreachableLoc().

const Expr* clang::ArraySubscriptExpr::getLHS ( ) const [inline]

Definition at line 2102 of file Expr.h.

Reimplemented from clang::Stmt.

Definition at line 2128 of file Expr.h.

Reimplemented from clang::Stmt.

Definition at line 2125 of file Expr.h.

References getLHS(), and clang::Stmt::getLocStart().

Definition at line 2130 of file Expr.h.

Referenced by GetUnreachableLoc().

Definition at line 2105 of file Expr.h.

Referenced by getBase(), getIdx(), and GetUnreachableLoc().

const Expr* clang::ArraySubscriptExpr::getRHS ( ) const [inline]

Definition at line 2106 of file Expr.h.

void clang::ArraySubscriptExpr::setLHS ( Expr E) [inline]

Definition at line 2103 of file Expr.h.

Definition at line 2131 of file Expr.h.

void clang::ArraySubscriptExpr::setRHS ( Expr E) [inline]

Definition at line 2107 of file Expr.h.


The documentation for this class was generated from the following file: