clang API Documentation

Classes | Public Member Functions | Static Public Member Functions
clang::OffsetOfExpr Class Reference

#include <Expr.h>

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

List of all members.

Classes

class  OffsetOfNode

Public Member Functions

SourceLocation getOperatorLoc () const
 getOperatorLoc - Return the location of the operator.
void setOperatorLoc (SourceLocation L)
SourceLocation getRParenLoc () const
 Return the location of the right parentheses.
void setRParenLoc (SourceLocation R)
TypeSourceInfogetTypeSourceInfo () const
void setTypeSourceInfo (TypeSourceInfo *tsi)
const OffsetOfNodegetComponent (unsigned Idx) const
void setComponent (unsigned Idx, OffsetOfNode ON)
unsigned getNumComponents () const
ExprgetIndexExpr (unsigned Idx)
const ExprgetIndexExpr (unsigned Idx) const
void setIndexExpr (unsigned Idx, Expr *E)
unsigned getNumExpressions () const
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static OffsetOfExprCreate (const ASTContext &C, QualType type, SourceLocation OperatorLoc, TypeSourceInfo *tsi, ArrayRef< OffsetOfNode > comps, ArrayRef< Expr * > exprs, SourceLocation RParenLoc)
static OffsetOfExprCreateEmpty (const ASTContext &C, unsigned NumComps, unsigned NumExprs)
static bool classof (const Stmt *T)

Detailed Description

OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator). For example, given:

 struct S {
   float f;
   double d;
 };
 struct T {
   int i;
   struct S s[10];
 };

we can represent and evaluate the expression offsetof(struct T, s[2].d).

Definition at line 1776 of file Expr.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1957 of file Expr.h.

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

Reimplemented from clang::Expr.

Definition at line 1952 of file Expr.h.

References clang::Stmt::getStmtClass().

OffsetOfExpr * OffsetOfExpr::Create ( const ASTContext C,
QualType  type,
SourceLocation  OperatorLoc,
TypeSourceInfo tsi,
ArrayRef< OffsetOfNode comps,
ArrayRef< Expr * >  exprs,
SourceLocation  RParenLoc 
) [static]

Definition at line 1306 of file Expr.cpp.

References clang::ASTContext::Allocate().

Referenced by clang::Sema::BuildBuiltinOffsetOf().

OffsetOfExpr * OffsetOfExpr::CreateEmpty ( const ASTContext C,
unsigned  NumComps,
unsigned  NumExprs 
) [static]

Definition at line 1320 of file Expr.cpp.

References clang::ASTContext::Allocate().

Definition at line 1916 of file Expr.h.

Definition at line 1930 of file Expr.h.

Referenced by getIndexExpr().

const Expr* clang::OffsetOfExpr::getIndexExpr ( unsigned  Idx) const [inline]

Definition at line 1935 of file Expr.h.

References getIndexExpr().

Reimplemented from clang::Stmt.

Definition at line 1950 of file Expr.h.

Reimplemented from clang::Stmt.

Definition at line 1949 of file Expr.h.

Definition at line 1926 of file Expr.h.

Definition at line 1945 of file Expr.h.

getOperatorLoc - Return the location of the operator.

Definition at line 1902 of file Expr.h.

Return the location of the right parentheses.

Definition at line 1906 of file Expr.h.

Definition at line 1909 of file Expr.h.

void clang::OffsetOfExpr::setComponent ( unsigned  Idx,
OffsetOfNode  ON 
) [inline]

Definition at line 1921 of file Expr.h.

void clang::OffsetOfExpr::setIndexExpr ( unsigned  Idx,
Expr E 
) [inline]

Definition at line 1939 of file Expr.h.

Definition at line 1903 of file Expr.h.

Definition at line 1907 of file Expr.h.

Definition at line 1912 of file Expr.h.


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