clang  6.0.0svn
Macros | Typedefs | Functions
ExprClassification.cpp File Reference
#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"
Include dependency graph for ExprClassification.cpp:

Go to the source code of this file.

Macros

#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)
 ClassifyDecl - Return the classification of an expression referencing the given declaration. More...
 
static Cl::Kinds ClassifyUnnamed (ASTContext &Ctx, QualType T)
 ClassifyUnnamed - Return the classification of an expression yielding an unnamed value of the given type. More...
 
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. More...
 
static Cl::Kinds ClassifyExprValueKind (const LangOptions &Lang, const Expr *E, ExprValueKind Kind)
 

Macro Definition Documentation

◆ ABSTRACT_STMT

#define ABSTRACT_STMT (   Kind)

◆ EXPR

#define EXPR (   Kind,
  Base 
)

◆ STMT

#define STMT (   Kind,
  Base 
)    case Expr::Kind##Class:

Typedef Documentation

◆ Cl

Definition at line 24 of file ExprClassification.cpp.

Function Documentation

◆ ClassifyBinaryOp()

static Cl::Kinds ClassifyBinaryOp ( ASTContext Ctx,
const BinaryOperator E 
)
static

Definition at line 528 of file ExprClassification.cpp.

◆ ClassifyConditional()

static Cl::Kinds ClassifyConditional ( ASTContext Ctx,
const Expr trueExpr,
const Expr falseExpr 
)
static

◆ ClassifyDecl()

static Cl::Kinds ClassifyDecl ( ASTContext Ctx,
const Decl D 
)
static

ClassifyDecl - Return the classification of an expression referencing the given declaration.

Definition at line 425 of file ExprClassification.cpp.

References clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_MemberFunction, clang::Expr::Classification::CL_PRValue, and clang::ASTContext::getLangOpts().

◆ ClassifyExprValueKind()

static Cl::Kinds ClassifyExprValueKind ( const LangOptions Lang,
const Expr E,
ExprValueKind  Kind 
)
static

Definition at line 88 of file ExprClassification.cpp.

◆ ClassifyInternal()

static Cl::Kinds ClassifyInternal ( ASTContext Ctx,
const Expr E 
)
static

Definition at line 102 of file ExprClassification.cpp.

Referenced by ClassifyConditional().

◆ ClassifyMemberExpr()

static Cl::Kinds ClassifyMemberExpr ( ASTContext Ctx,
const MemberExpr E 
)
static

Definition at line 471 of file ExprClassification.cpp.

◆ ClassifyTemporary()

static Cl::Kinds ClassifyTemporary ( QualType  T)
static

◆ 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 454 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().

◆ IsModifiable()

static Cl::ModifiableType IsModifiable ( ASTContext Ctx,
const Expr E,
Cl::Kinds  Kind,
SourceLocation Loc 
)
static

Definition at line 595 of file ExprClassification.cpp.