clang API Documentation

Public Types | Public Member Functions
clang::OffsetOfExpr::OffsetOfNode Class Reference

#include <Expr.h>

List of all members.

Public Types

enum  Kind { Array = 0x00, Field = 0x01, Identifier = 0x02, Base = 0x03 }
 The kind of offsetof node we have. More...

Public Member Functions

 OffsetOfNode (SourceLocation LBracketLoc, unsigned Index, SourceLocation RBracketLoc)
 Create an offsetof node that refers to an array element.
 OffsetOfNode (SourceLocation DotLoc, FieldDecl *Field, SourceLocation NameLoc)
 Create an offsetof node that refers to a field.
 OffsetOfNode (SourceLocation DotLoc, IdentifierInfo *Name, SourceLocation NameLoc)
 Create an offsetof node that refers to an identifier.
 OffsetOfNode (const CXXBaseSpecifier *Base)
 Create an offsetof node that refers into a C++ base class.
Kind getKind () const
 Determine what kind of offsetof node this is.
unsigned getArrayExprIndex () const
 For an array element node, returns the index into the array of expressions.
FieldDeclgetField () const
 For a field offsetof node, returns the field.
IdentifierInfogetFieldName () const
 For a field or identifier offsetof node, returns the name of the field.
CXXBaseSpecifiergetBase () const
 For a base class node, returns the base specifier.
SourceRange getSourceRange () const LLVM_READONLY
 Retrieve the source range that covers this offsetof node.

Detailed Description

Definition at line 1643 of file Expr.h.


Member Enumeration Documentation

The kind of offsetof node we have.

Enumerator:
Array 

An index into an array.

Field 

A field.

Identifier 

A field in a dependent type, known only by its name.

Base 

An implicit indirection through a C++ base class, when the field found is in a base class.

Definition at line 1646 of file Expr.h.


Constructor & Destructor Documentation

clang::OffsetOfExpr::OffsetOfNode::OffsetOfNode ( SourceLocation  LBracketLoc,
unsigned  Index,
SourceLocation  RBracketLoc 
) [inline]

Create an offsetof node that refers to an array element.

Definition at line 1677 of file Expr.h.

clang::OffsetOfExpr::OffsetOfNode::OffsetOfNode ( SourceLocation  DotLoc,
FieldDecl Field,
SourceLocation  NameLoc 
) [inline]

Create an offsetof node that refers to a field.

Definition at line 1682 of file Expr.h.

clang::OffsetOfExpr::OffsetOfNode::OffsetOfNode ( SourceLocation  DotLoc,
IdentifierInfo Name,
SourceLocation  NameLoc 
) [inline]

Create an offsetof node that refers to an identifier.

Definition at line 1688 of file Expr.h.

clang::OffsetOfExpr::OffsetOfNode::OffsetOfNode ( const CXXBaseSpecifier Base) [inline, explicit]

Create an offsetof node that refers into a C++ base class.

Definition at line 1694 of file Expr.h.


Member Function Documentation

unsigned clang::OffsetOfExpr::OffsetOfNode::getArrayExprIndex ( ) const [inline]

For an array element node, returns the index into the array of expressions.

Definition at line 1704 of file Expr.h.

References Array, and getKind().

CXXBaseSpecifier* clang::OffsetOfExpr::OffsetOfNode::getBase ( ) const [inline]

For a base class node, returns the base specifier.

Definition at line 1720 of file Expr.h.

References getKind().

FieldDecl* clang::OffsetOfExpr::OffsetOfNode::getField ( ) const [inline]

For a field offsetof node, returns the field.

Definition at line 1710 of file Expr.h.

References Field, and getKind().

Referenced by getFieldName().

IdentifierInfo * OffsetOfExpr::OffsetOfNode::getFieldName ( ) const

For a field or identifier offsetof node, returns the name of the field.

Definition at line 1040 of file Expr.cpp.

References Field, getField(), clang::NamedDecl::getIdentifier(), getKind(), and Identifier.

Kind clang::OffsetOfExpr::OffsetOfNode::getKind ( ) const [inline]

Determine what kind of offsetof node this is.

Definition at line 1698 of file Expr.h.

Referenced by getArrayExprIndex(), getBase(), getField(), and getFieldName().

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

Retrieve the source range that covers this offsetof node.

For an array element node, the source range contains the locations of the square brackets. For a field or identifier node, the source range contains the location of the period (if there is one) and the identifier.

Definition at line 1731 of file Expr.h.


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