clang API Documentation
Represents a C++ pseudo-destructor (C++ [expr.pseudo]). More...
#include <ExprCXX.h>


Public Member Functions | |
| CXXPseudoDestructorExpr (ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType) | |
| CXXPseudoDestructorExpr (EmptyShell Shell) | |
| Expr * | getBase () 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. | |
| NestedNameSpecifier * | getQualifier () 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. | |
| TypeSourceInfo * | getScopeTypeInfo () 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 '~'. | |
| TypeSourceInfo * | getDestroyedTypeInfo () const |
| Retrieve the source location information for the type being destroyed. | |
| IdentifierInfo * | getDestroyedTypeIdentifier () 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. | |
| SourceRange | getSourceRange () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static bool | classof (const Stmt *T) |
| static bool | classof (const CXXPseudoDestructorExpr *) |
Friends | |
| class | ASTStmtReader |
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.
| CXXPseudoDestructorExpr::CXXPseudoDestructorExpr | ( | ASTContext & | Context, |
| Expr * | Base, | ||
| bool | isArrow, | ||
| SourceLocation | OperatorLoc, | ||
| NestedNameSpecifierLoc | QualifierLoc, | ||
| TypeSourceInfo * | ScopeType, | ||
| SourceLocation | ColonColonLoc, | ||
| SourceLocation | TildeLoc, | ||
| PseudoDestructorTypeStorage | DestroyedType | ||
| ) |
Definition at line 152 of file ExprCXX.cpp.
| clang::CXXPseudoDestructorExpr::CXXPseudoDestructorExpr | ( | EmptyShell | Shell | ) | [inline, explicit] |
| child_range clang::CXXPseudoDestructorExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
| static bool clang::CXXPseudoDestructorExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
| static bool clang::CXXPseudoDestructorExpr::classof | ( | const CXXPseudoDestructorExpr * | ) | [inline, static] |
| Expr* clang::CXXPseudoDestructorExpr::getBase | ( | ) | const [inline] |
| SourceLocation clang::CXXPseudoDestructorExpr::getColonColonLoc | ( | ) | const [inline] |
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
| QualType CXXPseudoDestructorExpr::getDestroyedType | ( | ) | const |
Retrieve the type being destroyed.
Definition at line 188 of file ExprCXX.cpp.
References clang::PseudoDestructorTypeStorage::getTypeSourceInfo().
| IdentifierInfo* clang::CXXPseudoDestructorExpr::getDestroyedTypeIdentifier | ( | ) | const [inline] |
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 1852 of file ExprCXX.h.
References clang::PseudoDestructorTypeStorage::getIdentifier().
| TypeSourceInfo* clang::CXXPseudoDestructorExpr::getDestroyedTypeInfo | ( | ) | const [inline] |
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 1845 of file ExprCXX.h.
References clang::PseudoDestructorTypeStorage::getTypeSourceInfo().
| SourceLocation clang::CXXPseudoDestructorExpr::getDestroyedTypeLoc | ( | ) | const [inline] |
Retrieve the starting location of the type being destroyed.
Definition at line 1860 of file ExprCXX.h.
References clang::PseudoDestructorTypeStorage::getLocation().
| SourceLocation clang::CXXPseudoDestructorExpr::getOperatorLoc | ( | ) | const [inline] |
| NestedNameSpecifier* clang::CXXPseudoDestructorExpr::getQualifier | ( | ) | const [inline] |
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name. Otherwise, returns NULL.
Definition at line 1809 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().
| NestedNameSpecifierLoc clang::CXXPseudoDestructorExpr::getQualifierLoc | ( | ) | const [inline] |
| TypeSourceInfo* clang::CXXPseudoDestructorExpr::getScopeTypeInfo | ( | ) | const [inline] |
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.
| SourceRange CXXPseudoDestructorExpr::getSourceRange | ( | ) | const |
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 195 of file ExprCXX.cpp.
References clang::PseudoDestructorTypeStorage::getLocation(), and clang::PseudoDestructorTypeStorage::getTypeSourceInfo().
| SourceLocation clang::CXXPseudoDestructorExpr::getTildeLoc | ( | ) | const [inline] |
| bool clang::CXXPseudoDestructorExpr::hasQualifier | ( | ) | const [inline] |
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name of the member, e.g., x->Base::foo.
| bool clang::CXXPseudoDestructorExpr::isArrow | ( | ) | const [inline] |
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.').
| void clang::CXXPseudoDestructorExpr::setDestroyedType | ( | IdentifierInfo * | II, |
| SourceLocation | Loc | ||
| ) | [inline] |
Set the name of destroyed type for a dependent pseudo-destructor expression.
| void clang::CXXPseudoDestructorExpr::setDestroyedType | ( | TypeSourceInfo * | Info | ) | [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.