clang API Documentation
#include "clang/AST/Expr.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "llvm/Support/ErrorHandling.h"
#include "clang/AST/StmtNodes.inc"
Go to the source code of this file.
Defines | |
#define | ABSTRACT_STMT(Kind) |
#define | STMT(Kind, Base) case Expr::Kind##Class: |
#define | EXPR(Kind, Base) |
Typedefs | |
typedef Expr::Classification | Cl |
Functions | |
static Cl::Kinds | ClassifyInternal (ASTContext &Ctx, const Expr *E) |
static Cl::Kinds | ClassifyDecl (ASTContext &Ctx, const Decl *D) |
static Cl::Kinds | ClassifyUnnamed (ASTContext &Ctx, QualType T) |
static Cl::Kinds | ClassifyMemberExpr (ASTContext &Ctx, const MemberExpr *E) |
static Cl::Kinds | ClassifyBinaryOp (ASTContext &Ctx, const BinaryOperator *E) |
static Cl::Kinds | ClassifyConditional (ASTContext &Ctx, const Expr *trueExpr, const Expr *falseExpr) |
static Cl::ModifiableType | IsModifiable (ASTContext &Ctx, const Expr *E, Cl::Kinds Kind, SourceLocation &Loc) |
static Cl::Kinds | ClassifyTemporary (QualType T) |
Classify an expression which creates a temporary, based on its type. | |
static Cl::Kinds | ClassifyExprValueKind (const LangOptions &Lang, const Expr *E, ExprValueKind Kind) |
#define ABSTRACT_STMT | ( | Kind | ) |
#define STMT | ( | Kind, | |
Base | |||
) | case Expr::Kind##Class: |
typedef Expr::Classification Cl |
Definition at line 24 of file ExprClassification.cpp.
static Cl::Kinds ClassifyBinaryOp | ( | ASTContext & | Ctx, |
const BinaryOperator * | E | ||
) | [static] |
Definition at line 505 of file ExprClassification.cpp.
References clang::BO_Comma, clang::BO_PtrMemD, clang::BO_PtrMemI, clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_MemberFunction, clang::Expr::Classification::CL_PRValue, ClassifyInternal(), clang::ASTContext::getLangOpts(), clang::BinaryOperator::getLHS(), clang::Expr::getObjectKind(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::BinaryOperator::isAssignmentOp(), clang::Type::isFunctionType(), and clang::OK_ObjCProperty.
Referenced by ClassifyInternal().
static Cl::Kinds ClassifyConditional | ( | ASTContext & | Ctx, |
const Expr * | trueExpr, | ||
const Expr * | falseExpr | ||
) | [static] |
Definition at line 540 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_PRValue, ClassifyInternal(), clang::ASTContext::getLangOpts(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::Type::isVoidType().
Referenced by ClassifyInternal().
static Cl::Kinds ClassifyDecl | ( | ASTContext & | Ctx, |
const Decl * | D | ||
) | [static] |
ClassifyDecl - Return the classification of an expression referencing the given declaration.
Definition at line 404 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_MemberFunction, clang::Expr::Classification::CL_PRValue, and clang::ASTContext::getLangOpts().
Referenced by ClassifyInternal().
static Cl::Kinds ClassifyExprValueKind | ( | const LangOptions & | Lang, |
const Expr * | E, | ||
ExprValueKind | Kind | ||
) | [static] |
Definition at line 88 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CL_XValue, ClassifyTemporary(), clang::Expr::getType(), clang::VK_LValue, clang::VK_RValue, and clang::VK_XValue.
Referenced by ClassifyInternal().
static Cl::Kinds ClassifyInternal | ( | ASTContext & | Ctx, |
const Expr * | E | ||
) | [static] |
Definition at line 102 of file ExprClassification.cpp.
References clang::CompoundStmt::body_back(), clang::Expr::Classification::CL_ClassTemporary, clang::Expr::Classification::CL_DuplicateVectorComponents, clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_ObjCMessageRValue, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CL_SubObjCPropertySetting, clang::Expr::Classification::CL_XValue, ClassifyBinaryOp(), ClassifyConditional(), ClassifyDecl(), ClassifyExprValueKind(), ClassifyMemberExpr(), ClassifyTemporary(), ClassifyUnnamed(), clang::ConditionalOperator::getFalseExpr(), clang::BinaryConditionalOperator::getFalseExpr(), clang::ASTContext::getLangOpts(), clang::Stmt::getStmtClass(), clang::ConditionalOperator::getTrueExpr(), clang::BinaryConditionalOperator::getTrueExpr(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Expr::IgnoreParens(), clang::Expr::isRValue(), clang::Stmt::NoStmtClass, S, clang::ASTContext::UnknownAnyTy, clang::UO_Deref, clang::UO_Extension, clang::UO_Imag, clang::UO_PreDec, clang::UO_PreInc, and clang::UO_Real.
Referenced by ClassifyBinaryOp(), ClassifyConditional(), and ClassifyMemberExpr().
static Cl::Kinds ClassifyMemberExpr | ( | ASTContext & | Ctx, |
const MemberExpr * | E | ||
) | [static] |
Definition at line 448 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_MemberFunction, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CL_SubObjCPropertySetting, ClassifyInternal(), clang::MemberExpr::getBase(), clang::Decl::getDeclContext(), clang::ASTContext::getLangOpts(), clang::MemberExpr::getMemberDecl(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), clang::MemberExpr::isArrow(), clang::DeclContext::isRecord(), and clang::ASTContext::UnknownAnyTy.
Referenced by ClassifyInternal().
static Cl::Kinds ClassifyTemporary | ( | QualType | T | ) | [static] |
Classify an expression which creates a temporary, based on its type.
Definition at line 77 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_ArrayTemporary, clang::Expr::Classification::CL_ClassTemporary, clang::Expr::Classification::CL_PRValue, clang::Type::isArrayType(), and clang::Type::isRecordType().
Referenced by ClassifyExprValueKind(), ClassifyInternal(), and ClassifyUnnamed().
static Cl::Kinds ClassifyUnnamed | ( | ASTContext & | Ctx, |
QualType | T | ||
) | [static] |
ClassifyUnnamed - Return the classification of an expression yielding an unnamed value of the given type. This applies in particular to function calls and casts.
Definition at line 431 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CL_XValue, ClassifyTemporary(), clang::Type::getAs(), clang::ASTContext::getLangOpts(), clang::ReferenceType::getPointeeType(), clang::Type::isFunctionType(), and clang::Type::isLValueReferenceType().
Referenced by ClassifyInternal().
static Cl::ModifiableType IsModifiable | ( | ASTContext & | Ctx, |
const Expr * | E, | ||
Cl::Kinds | Kind, | ||
SourceLocation & | Loc | ||
) | [static] |
Definition at line 572 of file ExprClassification.cpp.
References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CM_ArrayType, clang::Expr::Classification::CM_ConstQualified, clang::Expr::Classification::CM_Function, clang::Expr::Classification::CM_IncompleteType, clang::Expr::Classification::CM_LValueCast, clang::Expr::Classification::CM_Modifiable, clang::Expr::Classification::CM_NoSetterProperty, clang::Expr::Classification::CM_RValue, clang::Qualifiers::getAddressSpace(), clang::CanQual< T >::getAs(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getLangOpts(), clang::Expr::getObjectKind(), clang::CanQual< T >::getQualifiers(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::CanQual< T >::isConstQualified(), clang::Type::isFunctionType(), clang::OK_ObjCProperty, and clang::LangAS::opencl_constant.