clang API Documentation
#include <Expr.h>
Public Member Functions | |
TypeSourceInfo * | getTypeInfoAsWritten () const |
void | setTypeInfoAsWritten (TypeSourceInfo *writtenTy) |
QualType | getTypeAsWritten () const |
Static Public Member Functions | |
static bool | classof (const Stmt *T) |
Protected Member Functions | |
ExplicitCastExpr (StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy) | |
ExplicitCastExpr (StmtClass SC, EmptyShell Shell, unsigned PathSize) | |
Construct an empty explicit cast. |
ExplicitCastExpr - An explicit cast written in the source code.
This class is effectively an abstract class, because it provides the basic representation of an explicitly-written cast without specifying which kind of cast (C cast, functional cast, static cast, etc.) was written; specific derived classes represent the particular style of cast and its location information.
Unlike implicit casts, explicit cast nodes have two different types: the type that was written into the source code, and the actual type of the expression as determined by semantic analysis. These types may differ slightly. For example, in C++ one can cast to a reference type, which indicates that the resulting expression will be an lvalue or xvalue. The reference type, however, will not be used as the type of the expression.
clang::ExplicitCastExpr::ExplicitCastExpr | ( | StmtClass | SC, |
QualType | exprTy, | ||
ExprValueKind | VK, | ||
CastKind | kind, | ||
Expr * | op, | ||
unsigned | PathSize, | ||
TypeSourceInfo * | writtenTy | ||
) | [inline, protected] |
clang::ExplicitCastExpr::ExplicitCastExpr | ( | StmtClass | SC, |
EmptyShell | Shell, | ||
unsigned | PathSize | ||
) | [inline, protected] |
static bool clang::ExplicitCastExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::CastExpr.
Reimplemented in clang::CStyleCastExpr, clang::ObjCBridgedCastExpr, clang::CXXFunctionalCastExpr, clang::CXXConstCastExpr, clang::CXXReinterpretCastExpr, clang::CXXDynamicCastExpr, clang::CXXStaticCastExpr, and clang::CXXNamedCastExpr.
Definition at line 2850 of file Expr.h.
References clang::Stmt::getStmtClass().
QualType clang::ExplicitCastExpr::getTypeAsWritten | ( | ) | const [inline] |
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code.
Definition at line 2848 of file Expr.h.
References clang::TypeSourceInfo::getType().
Referenced by clang::canDynamicCastThrow(), clang::Sema::checkUnknownAnyArg(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::Expr::HasSideEffects(), and isIdenticalStmt().
TypeSourceInfo* clang::ExplicitCastExpr::getTypeInfoAsWritten | ( | ) | const [inline] |
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Definition at line 2843 of file Expr.h.
Referenced by clang::CXXFunctionalCastExpr::getLocStart(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), and clang::ASTNodeImporter::VisitCStyleCastExpr().
void clang::ExplicitCastExpr::setTypeInfoAsWritten | ( | TypeSourceInfo * | writtenTy | ) | [inline] |