clang API Documentation
Represents a C++ pseudo-destructor (C++ [expr.pseudo]). More...
#include <ExprCXX.h>
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) | |
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. | |
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 |
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 | ( | 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.
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.
Expr* clang::CXXPseudoDestructorExpr::getBase | ( | ) | const [inline] |
Definition at line 1971 of file ExprCXX.h.
References clang::CodeGen::Base.
SourceLocation clang::CXXPseudoDestructorExpr::getColonColonLoc | ( | ) | const [inline] |
Retrieve the type being destroyed.
Definition at line 272 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 2028 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 2021 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 2036 of file ExprCXX.h.
References clang::PseudoDestructorTypeStorage::getLocation().
Reimplemented from clang::Stmt.
Definition at line 279 of file ExprCXX.cpp.
References clang::PseudoDestructorTypeStorage::getLocation(), and clang::PseudoDestructorTypeStorage::getTypeSourceInfo().
SourceLocation clang::CXXPseudoDestructorExpr::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
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 1985 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.
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.
Definition at line 1976 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::hasQualifier().
bool clang::CXXPseudoDestructorExpr::isArrow | ( | ) | const [inline] |
void clang::CXXPseudoDestructorExpr::setDestroyedType | ( | IdentifierInfo * | II, |
SourceLocation | Loc | ||
) | [inline] |
void clang::CXXPseudoDestructorExpr::setDestroyedType | ( | TypeSourceInfo * | Info | ) | [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.