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) {
141 return Cl::CL_LValue;
147 : Cl::CL_LValue;
191 return Cl::CL_PRValue;
203 return Cl::CL_LValue;
210 ? Cl::CL_PRValue : Cl::CL_LValue;
223 return Cl::CL_LValue;
234 Cl::Kinds K = ClassifyInternal(Ctx, Op);
235 if (K != Cl::CL_LValue) return K;
238 return Cl::CL_SubObjCPropertySetting;
239 return Cl::CL_LValue;
247 return Lang.CPlusPlus ? Cl::CL_LValue : Cl::CL_PRValue;
250 return Cl::CL_PRValue;
276 return Cl::CL_PRValue;
284 return Cl::CL_PRValue;
301 return Cl::CL_DuplicateVectorComponents;
303 return Cl::CL_LValue;
331 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
339 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
346 if (!Lang.CPlusPlus) return Cl::CL_PRValue;
356 Cl::Kinds kind = ClassifyUnnamed(Ctx, Method->getReturnType());
357 return (kind == Cl::CL_PRValue) ? Cl::CL_ObjCMessageRValue : kind;
359 return Cl::CL_PRValue;
367 return Cl::CL_ClassTemporary;
379 return Cl::CL_PRValue;
383 return Cl::CL_LValue;
390 ? Cl::CL_LValue
391 : Cl::CL_XValue;
413 static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) {
422 return Cl::CL_MemberFunction;
435 return islvalue ? Cl::CL_LValue : Cl::CL_PRValue;
441 static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) {
443 if (!Ctx.getLangOpts().CPlusPlus) return Cl::CL_PRValue;
450 return Cl::CL_LValue;
455 return RV->getPointeeType()->isFunctionType() ? Cl::CL_LValue : Cl::CL_XValue;
458 static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) {
461 ? Cl::CL_PRValue : Cl::CL_LValue);
469 return Cl::CL_LValue;
473 return Cl::CL_SubObjCPropertySetting;
483 return Cl::CL_LValue;
488 return Cl::CL_LValue;
496 return Cl::CL_LValue;
499 return Cl::CL_SubObjCPropertySetting;
508 return Method->isStatic() ? Cl::CL_LValue : Cl::CL_MemberFunction;
512 return Cl::CL_PRValue;
515 static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
522 ? Cl::CL_PRValue : Cl::CL_LValue);
535 ? Cl::CL_MemberFunction
543 ? Cl::CL_MemberFunction
544 : Cl::CL_LValue;
547 return Cl::CL_PRValue;
550 static Cl::Kinds ClassifyConditional(ASTContext &Ctx, const Expr *True,
569 return Cl::CL_PRValue;
577 Cl::Kinds LCl = ClassifyInternal(Ctx, True),
579 return LCl == RCl ? LCl : Cl::CL_PRValue;
582 static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E,
583 Cl::Kinds Kind, SourceLocation &Loc) {
586 if (Kind == Cl::CL_PRValue) {
593 return Cl::CM_LValueCast;
597 if (Kind != Cl::CL_LValue)
598 return Cl::CM_RValue;
603 return Cl::CM_Function;
610 return Cl::CM_NoSetterProperty;
616 return Cl::CM_ConstQualified;
618 return Cl::CM_ConstAddrSpace;
622 return Cl::CM_ArrayType;
625 return Cl::CM_IncompleteType;
630 return Cl::CM_ConstQualified;
632 return Cl::CM_Modifiable;
638 case Cl::CL_LValue: return LV_Valid;
639 case Cl::CL_XValue: return LV_InvalidExpression;
640 case Cl::CL_Function: return LV_NotObjectType;
641 case Cl::CL_Void: return LV_InvalidExpression;
642 case Cl::CL_AddressableVoid: return LV_IncompleteVoidType;
643 case Cl::CL_DuplicateVectorComponents: return LV_DuplicateVectorComponents;
644 case Cl::CL_MemberFunction: return LV_MemberFunction;
645 case Cl::CL_SubObjCPropertySetting: return LV_SubObjCPropertySetting;
646 case Cl::CL_ClassTemporary: return LV_ClassTemporary;
647 case Cl::CL_ArrayTemporary: return LV_ArrayTemporary;
648 case Cl::CL_ObjCMessageRValue: return LV_InvalidMessageExpression;
649 case Cl::CL_PRValue: return LV_InvalidExpression;
659 case Cl::CL_LValue: break;
660 case Cl::CL_XValue: return MLV_InvalidExpression;
661 case Cl::CL_Function: return MLV_NotObjectType;
662 case Cl::CL_Void: return MLV_InvalidExpression;
663 case Cl::CL_AddressableVoid: return MLV_IncompleteVoidType;
664 case Cl::CL_DuplicateVectorComponents: return MLV_DuplicateVectorComponents;
665 case Cl::CL_MemberFunction: return MLV_MemberFunction;
666 case Cl::CL_SubObjCPropertySetting: return MLV_SubObjCPropertySetting;
667 case Cl::CL_ClassTemporary: return MLV_ClassTemporary;
668 case Cl::CL_ArrayTemporary: return MLV_ArrayTemporary;
669 case Cl::CL_ObjCMessageRValue: return MLV_InvalidMessageExpression;
670 case Cl::CL_PRValue:
671 return VC.getModifiable() == Cl::CM_LValueCast ?
674 assert(VC.getKind() == Cl::CL_LValue && "Unhandled kind");
676 case Cl::CM_Untested: llvm_unreachable("Did not test modifiability");
677 case Cl::CM_Modifiable: return MLV_Valid;
678 case Cl::CM_RValue: llvm_unreachable("CM_RValue and CL_LValue don't match");
679 case Cl::CM_Function: return MLV_NotObjectType;
680 case Cl::CM_LValueCast:
682 case Cl::CM_NoSetterProperty: return MLV_NoSetterProperty;
683 case Cl::CM_ConstQualified: return MLV_ConstQualified;
684 case Cl::CM_ConstAddrSpace: return MLV_ConstAddrSpace;
685 case Cl::CM_ArrayType: return MLV_ArrayType;
686 case Cl::CM_IncompleteType: return MLV_IncompleteType;