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
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static OffsetOfExprCreate (ASTContext &C, QualType type, SourceLocation OperatorLoc, TypeSourceInfo *tsi, OffsetOfNode *compsPtr, unsigned numComps, Expr **exprsPtr, unsigned numExprs, SourceLocation RParenLoc)
static OffsetOfExprCreateEmpty (ASTContext &C, unsigned NumComps, unsigned NumExprs)
static bool classof (const Stmt *T)
static bool classof (const OffsetOfExpr *)

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 1640 of file Expr.h.


Member Function Documentation

child_range clang::OffsetOfExpr::children ( ) [inline]

Reimplemented from clang::Stmt.

Definition at line 1824 of file Expr.h.

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

Reimplemented from clang::Expr.

Definition at line 1817 of file Expr.h.

References clang::Stmt::getStmtClass().

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

Definition at line 1821 of file Expr.h.

OffsetOfExpr * OffsetOfExpr::Create ( ASTContext C,
QualType  type,
SourceLocation  OperatorLoc,
TypeSourceInfo tsi,
OffsetOfNode compsPtr,
unsigned  numComps,
Expr **  exprsPtr,
unsigned  numExprs,
SourceLocation  RParenLoc 
) [static]

Definition at line 991 of file Expr.cpp.

References clang::ASTContext::Allocate().

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

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

Definition at line 1005 of file Expr.cpp.

References clang::ASTContext::Allocate().

const OffsetOfNode& clang::OffsetOfExpr::getComponent ( unsigned  Idx) const [inline]

Definition at line 1780 of file Expr.h.

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

Definition at line 1794 of file Expr.h.

Referenced by getIndexExpr().

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

Definition at line 1799 of file Expr.h.

References getIndexExpr().

unsigned clang::OffsetOfExpr::getNumComponents ( ) const [inline]

Definition at line 1790 of file Expr.h.

unsigned clang::OffsetOfExpr::getNumExpressions ( ) const [inline]

Definition at line 1809 of file Expr.h.

SourceLocation clang::OffsetOfExpr::getOperatorLoc ( ) const [inline]

getOperatorLoc - Return the location of the operator.

Definition at line 1766 of file Expr.h.

SourceLocation clang::OffsetOfExpr::getRParenLoc ( ) const [inline]

Return the location of the right parentheses.

Definition at line 1770 of file Expr.h.

SourceRange clang::OffsetOfExpr::getSourceRange ( ) const [inline]

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.

Reimplemented from clang::Stmt.

Definition at line 1813 of file Expr.h.

TypeSourceInfo* clang::OffsetOfExpr::getTypeSourceInfo ( ) const [inline]

Definition at line 1773 of file Expr.h.

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

Definition at line 1785 of file Expr.h.

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

Definition at line 1803 of file Expr.h.

void clang::OffsetOfExpr::setOperatorLoc ( SourceLocation  L) [inline]

Definition at line 1767 of file Expr.h.

void clang::OffsetOfExpr::setRParenLoc ( SourceLocation  R) [inline]

Definition at line 1771 of file Expr.h.

void clang::OffsetOfExpr::setTypeSourceInfo ( TypeSourceInfo tsi) [inline]

Definition at line 1776 of file Expr.h.


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