clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::CXXPseudoDestructorExpr Class Reference

Represents a C++ pseudo-destructor (C++ [expr.pseudo]). More...

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

 CXXPseudoDestructorExpr (const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
 CXXPseudoDestructorExpr (EmptyShell Shell)
ExprgetBase () const
bool hasQualifier () const
 Determines whether this member expression actually had a C++ nested-name-specifier prior to the name of the member, e.g., x->Base::foo.
NestedNameSpecifierLoc getQualifierLoc () const
 Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
NestedNameSpecifiergetQualifier () const
 If the member name was qualified, retrieves the nested-name-specifier that precedes the member name. Otherwise, returns null.
bool isArrow () const
 Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.').
SourceLocation getOperatorLoc () const
 Retrieve the location of the '.' or '->' operator.
TypeSourceInfogetScopeTypeInfo () const
 Retrieve the scope type in a qualified pseudo-destructor expression.
SourceLocation getColonColonLoc () const
 Retrieve the location of the '::' in a qualified pseudo-destructor expression.
SourceLocation getTildeLoc () const
 Retrieve the location of the '~'.
TypeSourceInfogetDestroyedTypeInfo () const
 Retrieve the source location information for the type being destroyed.
IdentifierInfogetDestroyedTypeIdentifier () const
 In a dependent pseudo-destructor expression for which we do not have full type information on the destroyed type, provides the name of the destroyed type.
QualType getDestroyedType () const
 Retrieve the type being destroyed.
SourceLocation getDestroyedTypeLoc () const
 Retrieve the starting location of the type being destroyed.
void setDestroyedType (IdentifierInfo *II, SourceLocation Loc)
 Set the name of destroyed type for a dependent pseudo-destructor expression.
void setDestroyedType (TypeSourceInfo *Info)
 Set the destroyed type.
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)

Friends

class ASTStmtReader

Detailed Description

Represents a C++ pseudo-destructor (C++ [expr.pseudo]).

A pseudo-destructor is an expression that looks like a member access to a destructor of a scalar type, except that scalar types don't have destructors. For example:

 typedef int T;
 void f(int *p) {
   p->T::~T();
 }

Pseudo-destructors typically occur when instantiating templates such as:

 template<typename T>
 void destroy(T* ptr) {
   ptr->T::~T();
 }

for scalar types. A pseudo-destructor expression has no run-time semantics beyond evaluating the base expression.

Definition at line 1927 of file ExprCXX.h.


Constructor & Destructor Documentation

CXXPseudoDestructorExpr::CXXPseudoDestructorExpr ( const ASTContext Context,
Expr Base,
bool  isArrow,
SourceLocation  OperatorLoc,
NestedNameSpecifierLoc  QualifierLoc,
TypeSourceInfo ScopeType,
SourceLocation  ColonColonLoc,
SourceLocation  TildeLoc,
PseudoDestructorTypeStorage  DestroyedType 
)

Definition at line 234 of file ExprCXX.cpp.

Definition at line 1967 of file ExprCXX.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 2059 of file ExprCXX.h.

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

Reimplemented from clang::Expr.

Definition at line 2054 of file ExprCXX.h.

Definition at line 1971 of file ExprCXX.h.

References clang::CodeGen::Base.

Retrieve the location of the '::' in a qualified pseudo-destructor expression.

Definition at line 2009 of file ExprCXX.h.

Retrieve the type being destroyed.

Definition at line 272 of file ExprCXX.cpp.

References clang::PseudoDestructorTypeStorage::getTypeSourceInfo().

In a dependent pseudo-destructor expression for which we do not have full type information on the destroyed type, provides the name of the destroyed type.

Definition at line 2028 of file ExprCXX.h.

References clang::PseudoDestructorTypeStorage::getIdentifier().

Retrieve the source location information for the type being destroyed.

This type-source information is available for non-dependent pseudo-destructor expressions and some dependent pseudo-destructor expressions. Returns null if we only have the identifier for a dependent pseudo-destructor expression.

Definition at line 2021 of file ExprCXX.h.

References clang::PseudoDestructorTypeStorage::getTypeSourceInfo().

Retrieve the starting location of the type being destroyed.

Definition at line 2036 of file ExprCXX.h.

References clang::PseudoDestructorTypeStorage::getLocation().

Reimplemented from clang::Stmt.

Definition at line 2051 of file ExprCXX.h.

Retrieve the location of the '.' or '->' operator.

Definition at line 1994 of file ExprCXX.h.

If the member name was qualified, retrieves the nested-name-specifier that precedes the member name. Otherwise, returns null.

Definition at line 1985 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

Retrieves the nested-name-specifier that qualifies the type name, with source-location information.

Definition at line 1980 of file ExprCXX.h.

Retrieve the scope type in a qualified pseudo-destructor expression.

Pseudo-destructor expressions can have extra qualification within them that is not part of the nested-name-specifier, e.g., p->T::~T(). Here, if the object type of the expression is (or may be) a scalar type, T may also be a scalar type and, therefore, cannot be part of a nested-name-specifier. It is stored as the "scope type" of the pseudo- destructor expression.

Definition at line 2005 of file ExprCXX.h.

Retrieve the location of the '~'.

Definition at line 2012 of file ExprCXX.h.

Determines whether this member expression actually had a C++ nested-name-specifier prior to the name of the member, e.g., x->Base::foo.

Definition at line 1976 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::hasQualifier().

Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.').

Definition at line 1991 of file ExprCXX.h.

Set the name of destroyed type for a dependent pseudo-destructor expression.

Definition at line 2042 of file ExprCXX.h.

Set the destroyed type.

Definition at line 2047 of file ExprCXX.h.


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 1956 of file ExprCXX.h.


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