Home | History | Annotate | Download | only in AST

Lines Matching refs:Cl

24 typedef Expr::Classification Cl;
26 static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E);
27 static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D);
28 static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T);
29 static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E);
30 static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E);
31 static Cl::Kinds ClassifyConditional(ASTContext &Ctx,
34 static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E,
35 Cl::Kinds Kind, SourceLocation &Loc);
37 Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const {
40 Cl::Kinds kind = ClassifyInternal(Ctx, this);
46 kind = Cl::CL_Function;
51 kind = (kind == Cl::CL_LValue ? Cl::CL_AddressableVoid : Cl::CL_Void);
56 case Cl::CL_LValue: assert(getValueKind() == VK_LValue); break;
57 case Cl::CL_XValue: assert(getValueKind() == VK_XValue); break;
58 case Cl::CL_Function:
59 case Cl::CL_Void:
60 case Cl::CL_AddressableVoid:
61 case Cl::CL_DuplicateVectorComponents:
62 case Cl::CL_MemberFunction:
63 case Cl::CL_SubObjCPropertySetting:
64 case Cl::CL_ClassTemporary:
65 case Cl::CL_ArrayTemporary:
66 case Cl::CL_ObjCMessageRValue:
67 case Cl::CL_PRValue: assert(getValueKind() == VK_RValue); break;
70 Cl::ModifiableType modifiable = Cl::CM_Untested;
77 static Cl::Kinds ClassifyTemporary(QualType T) {
79 return Cl::CL_ClassTemporary;
81 return Cl::CL_ArrayTemporary;
85 return Cl::CL_PRValue;
88 static Cl::Kinds ClassifyExprValueKind(const LangOptions &Lang,
93 return Lang.CPlusPlus ? ClassifyTemporary(E->getType()) : Cl::CL_PRValue;
95 return Cl::CL_LValue;
97 return Cl::CL_XValue;
102 static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
138 return Cl::CL_LValue;
144 : Cl::CL_LValue;
185 return Cl::CL_PRValue;
197 return Cl::CL_LValue;
204 ? Cl::CL_PRValue : Cl::CL_LValue;
217 return Cl::CL_LValue;
228 Cl::Kinds K = ClassifyInternal(Ctx, Op);
229 if (K != Cl::CL_LValue) return K;
232 return Cl::CL_SubObjCPropertySetting;
233 return Cl::CL_LValue;
241 return Lang.CPlusPlus ? Cl::CL_LValue : Cl::CL_PRValue;
244 return Cl::CL_PRValue;
270 return Cl::CL_PRValue;
278 return Cl::CL_PRValue;
295 return Cl::CL_DuplicateVectorComponents;
297 return Cl::CL_LValue;
325 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
333 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
340 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
350 Cl::Kinds kind = ClassifyUnnamed(Ctx, Method->getResultType());
351 return (kind == Cl::CL_PRValue) ? Cl::CL_ObjCMessageRValue : kind;
353 return Cl::CL_PRValue;
360 return Cl::CL_ClassTemporary;
372 return Cl::CL_PRValue;
376 return Cl::CL_LValue;
383 ? Cl::CL_LValue
384 : Cl::CL_XValue;
403 static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) {
412 return Cl::CL_MemberFunction;
424 return islvalue ? Cl::CL_LValue : Cl::CL_PRValue;
430 static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) {
432 if (!Ctx.getLangOpts().CPlusPlus) return Cl::CL_PRValue;
439 return Cl::CL_LValue;
444 return RV->getPointeeType()->isFunctionType() ? Cl::CL_LValue : Cl::CL_XValue;
447 static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) {
450 ? Cl::CL_PRValue : Cl::CL_LValue);
458 return Cl::CL_LValue;
462 return Cl::CL_SubObjCPropertySetting;
472 return Cl::CL_LValue;
477 return Cl::CL_LValue;
485 return Cl::CL_LValue;
488 return Cl::CL_SubObjCPropertySetting;
497 return Method->isStatic() ? Cl::CL_LValue : Cl::CL_MemberFunction;
501 return Cl::CL_PRValue;
504 static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
511 ? Cl::CL_PRValue : Cl::CL_LValue);
524 ? Cl::CL_MemberFunction
532 ? Cl::CL_MemberFunction
533 : Cl::CL_LValue;
536 return Cl::CL_PRValue;
539 static Cl::Kinds ClassifyConditional(ASTContext &Ctx, const Expr *True,
548 return Cl::CL_PRValue;
555 Cl::Kinds LCl = ClassifyInternal(Ctx, True),
557 return LCl == RCl ? LCl : Cl::CL_PRValue;
560 static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E,
561 Cl::Kinds Kind, SourceLocation &Loc) {
564 if (Kind == Cl::CL_PRValue) {
571 return Cl::CM_LValueCast;
575 if (Kind != Cl::CL_LValue)
576 return Cl::CM_RValue;
581 return Cl::CM_Function;
587 return Cl::CM_NoSetterProperty;
593 return Cl::CM_ConstQualified;
597 return Cl::CM_ArrayType;
600 return Cl::CM_IncompleteType;
609 return Cl::CM_ConstQualified;
612 return Cl::CM_Modifiable;
618 case Cl::CL_LValue: return LV_Valid;
619 case Cl::CL_XValue: return LV_InvalidExpression;
620 case Cl::CL_Function: return LV_NotObjectType;
621 case Cl::CL_Void: return LV_InvalidExpression;
622 case Cl::CL_AddressableVoid: return LV_IncompleteVoidType;
623 case Cl::CL_DuplicateVectorComponents: return LV_DuplicateVectorComponents;
624 case Cl::CL_MemberFunction: return LV_MemberFunction;
625 case Cl::CL_SubObjCPropertySetting: return LV_SubObjCPropertySetting;
626 case Cl::CL_ClassTemporary: return LV_ClassTemporary;
627 case Cl::CL_ArrayTemporary: return LV_ArrayTemporary;
628 case Cl::CL_ObjCMessageRValue: return LV_InvalidMessageExpression;
629 case Cl::CL_PRValue: return LV_InvalidExpression;
639 case Cl::CL_LValue: break;
640 case Cl::CL_XValue: return MLV_InvalidExpression;
641 case Cl::CL_Function: return MLV_NotObjectType;
642 case Cl::CL_Void: return MLV_InvalidExpression;
643 case Cl::CL_AddressableVoid: return MLV_IncompleteVoidType;
644 case Cl::CL_DuplicateVectorComponents: return MLV_DuplicateVectorComponents;
645 case Cl::CL_MemberFunction: return MLV_MemberFunction;
646 case Cl::CL_SubObjCPropertySetting: return MLV_SubObjCPropertySetting;
647 case Cl::CL_ClassTemporary: return MLV_ClassTemporary;
648 case Cl::CL_ArrayTemporary: return MLV_ArrayTemporary;
649 case Cl::CL_ObjCMessageRValue: return MLV_InvalidMessageExpression;
650 case Cl::CL_PRValue:
651 return VC.getModifiable() == Cl::CM_LValueCast ?
654 assert(VC.getKind() == Cl::CL_LValue && "Unhandled kind");
656 case Cl::CM_Untested: llvm_unreachable("Did not test modifiability");
657 case Cl::CM_Modifiable: return MLV_Valid;
658 case Cl::CM_RValue: llvm_unreachable("CM_RValue and CL_LValue don't match");
659 case Cl::CM_Function: return MLV_NotObjectType;
660 case Cl::CM_LValueCast:
662 case Cl::CM_NoSetterProperty: return MLV_NoSetterProperty;
663 case Cl::CM_ConstQualified: return MLV_ConstQualified;
664 case Cl::CM_ArrayType: return MLV_ArrayType;
665 case Cl::CM_IncompleteType: return MLV_IncompleteType;