Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/ExprClassification.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if (!Ctx.getLangOpts().CPlusPlus) { | ||||
// Void "lvalues" are classified as addressable void values, which are void | // Void "lvalues" are classified as addressable void values, which are void | ||||
// expressions whose address can be taken. | // expressions whose address can be taken. | ||||
else if (TR->isVoidType() && !TR.hasQualifiers()) | else if (TR->isVoidType() && !TR.hasQualifiers()) | ||||
kind = (kind == Cl::CL_LValue ? Cl::CL_AddressableVoid : Cl::CL_Void); | kind = (kind == Cl::CL_LValue ? Cl::CL_AddressableVoid : Cl::CL_Void); | ||||
} | } | ||||
// Enable this assertion for testing. | // Enable this assertion for testing. | ||||
switch (kind) { | switch (kind) { | ||||
case Cl::CL_LValue: assert(getValueKind() == VK_LValue); break; | case Cl::CL_LValue: | ||||
case Cl::CL_XValue: assert(getValueKind() == VK_XValue); break; | assert(isLValue()); | ||||
break; | |||||
case Cl::CL_XValue: | |||||
assert(isXValue()); | |||||
break; | |||||
case Cl::CL_Function: | case Cl::CL_Function: | ||||
case Cl::CL_Void: | case Cl::CL_Void: | ||||
case Cl::CL_AddressableVoid: | case Cl::CL_AddressableVoid: | ||||
case Cl::CL_DuplicateVectorComponents: | case Cl::CL_DuplicateVectorComponents: | ||||
case Cl::CL_MemberFunction: | case Cl::CL_MemberFunction: | ||||
case Cl::CL_SubObjCPropertySetting: | case Cl::CL_SubObjCPropertySetting: | ||||
case Cl::CL_ClassTemporary: | case Cl::CL_ClassTemporary: | ||||
case Cl::CL_ArrayTemporary: | case Cl::CL_ArrayTemporary: | ||||
case Cl::CL_ObjCMessageRValue: | case Cl::CL_ObjCMessageRValue: | ||||
case Cl::CL_PRValue: | case Cl::CL_PRValue: | ||||
assert(getValueKind() == VK_PRValue); | assert(isPRValue()); | ||||
break; | break; | ||||
} | } | ||||
Cl::ModifiableType modifiable = Cl::CM_Untested; | Cl::ModifiableType modifiable = Cl::CM_Untested; | ||||
if (Loc) | if (Loc) | ||||
modifiable = IsModifiable(Ctx, this, kind, *Loc); | modifiable = IsModifiable(Ctx, this, kind, *Loc); | ||||
return Classification(kind, modifiable); | return Classification(kind, modifiable); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |