Skip to content

Commit aef5d8f

Browse files
committed
[clang] NFC: Rename rvalue to prvalue
This renames the expression value categories from rvalue to prvalue, keeping nomenclature consistent with C++11 onwards. C++ has the most complicated taxonomy here, and every other language only uses a subset of it, so it's less confusing to use the C++ names consistently, and mentally remap to the C names when working on that context (prvalue -> rvalue, no xvalues, etc). Renames: * VK_RValue -> VK_PRValue * Expr::isRValue -> Expr::isPRValue * SK_QualificationConversionRValue -> SK_QualificationConversionPRValue * JSON AST Dumper Expression nodes value category: "rvalue" -> "prvalue" Signed-off-by: Matheus Izvekov <[email protected]> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D103720
1 parent f3fd36e commit aef5d8f

File tree

74 files changed

+1817
-1916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1817
-1916
lines changed

clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void UniqueptrResetReleaseCheck::check(const MatchFinder::MatchResult &Result) {
124124
AssignmentText = " = std::move(*";
125125
TrailingText = ")";
126126
NeedsUtilityInclude = true;
127-
} else if (!Right->isRValue()) {
127+
} else if (!Right->isPRValue()) {
128128
AssignmentText = " = std::move(";
129129
TrailingText = ")";
130130
NeedsUtilityInclude = true;

clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static bool usagesAreConst(ASTContext *Context, const UsageResult &Usages) {
429429
/// by reference.
430430
static bool usagesReturnRValues(const UsageResult &Usages) {
431431
for (const auto &U : Usages) {
432-
if (U.Expression && !U.Expression->isRValue())
432+
if (U.Expression && !U.Expression->isPRValue())
433433
return false;
434434
}
435435
return true;

clang/include/clang/AST/Expr.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,11 @@ class Expr : public ValueStmt {
266266
/// C++11 divides the concept of "r-value" into pure r-values
267267
/// ("pr-values") and so-called expiring values ("x-values"), which
268268
/// identify specific objects that can be safely cannibalized for
269-
/// their resources. This is an unfortunate abuse of terminology on
270-
/// the part of the C++ committee. In Clang, when we say "r-value",
271-
/// we generally mean a pr-value.
269+
/// their resources.
272270
bool isLValue() const { return getValueKind() == VK_LValue; }
273-
bool isRValue() const { return getValueKind() == VK_RValue; }
271+
bool isPRValue() const { return getValueKind() == VK_PRValue; }
274272
bool isXValue() const { return getValueKind() == VK_XValue; }
275-
bool isGLValue() const { return getValueKind() != VK_RValue; }
273+
bool isGLValue() const { return getValueKind() != VK_PRValue; }
276274

277275
enum LValueClassification {
278276
LV_Valid,
@@ -425,7 +423,7 @@ class Expr : public ValueStmt {
425423
? VK_LValue
426424
: (RT->getPointeeType()->isFunctionType()
427425
? VK_LValue : VK_XValue));
428-
return VK_RValue;
426+
return VK_PRValue;
429427
}
430428

431429
/// getValueKind - The value kind that this expression produces.
@@ -1588,8 +1586,8 @@ class CharacterLiteral : public Expr {
15881586
// type should be IntTy
15891587
CharacterLiteral(unsigned value, CharacterKind kind, QualType type,
15901588
SourceLocation l)
1591-
: Expr(CharacterLiteralClass, type, VK_RValue, OK_Ordinary), Value(value),
1592-
Loc(l) {
1589+
: Expr(CharacterLiteralClass, type, VK_PRValue, OK_Ordinary),
1590+
Value(value), Loc(l) {
15931591
CharacterLiteralBits.Kind = kind;
15941592
setDependence(ExprDependence::None);
15951593
}
@@ -1709,7 +1707,7 @@ class ImaginaryLiteral : public Expr {
17091707
Stmt *Val;
17101708
public:
17111709
ImaginaryLiteral(Expr *val, QualType Ty)
1712-
: Expr(ImaginaryLiteralClass, Ty, VK_RValue, OK_Ordinary), Val(val) {
1710+
: Expr(ImaginaryLiteralClass, Ty, VK_PRValue, OK_Ordinary), Val(val) {
17131711
setDependence(ExprDependence::None);
17141712
}
17151713

@@ -2547,7 +2545,8 @@ class UnaryExprOrTypeTraitExpr : public Expr {
25472545
UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKind, TypeSourceInfo *TInfo,
25482546
QualType resultType, SourceLocation op,
25492547
SourceLocation rp)
2550-
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_RValue, OK_Ordinary),
2548+
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_PRValue,
2549+
OK_Ordinary),
25512550
OpLoc(op), RParenLoc(rp) {
25522551
assert(ExprKind <= UETT_Last && "invalid enum value!");
25532552
UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
@@ -4287,7 +4286,7 @@ class AddrLabelExpr : public Expr {
42874286
public:
42884287
AddrLabelExpr(SourceLocation AALoc, SourceLocation LLoc, LabelDecl *L,
42894288
QualType t)
4290-
: Expr(AddrLabelExprClass, t, VK_RValue, OK_Ordinary), AmpAmpLoc(AALoc),
4289+
: Expr(AddrLabelExprClass, t, VK_PRValue, OK_Ordinary), AmpAmpLoc(AALoc),
42914290
LabelLoc(LLoc), Label(L) {
42924291
setDependence(ExprDependence::None);
42934292
}
@@ -4332,7 +4331,7 @@ class StmtExpr : public Expr {
43324331
public:
43334332
StmtExpr(CompoundStmt *SubStmt, QualType T, SourceLocation LParenLoc,
43344333
SourceLocation RParenLoc, unsigned TemplateDepth)
4335-
: Expr(StmtExprClass, T, VK_RValue, OK_Ordinary), SubStmt(SubStmt),
4334+
: Expr(StmtExprClass, T, VK_PRValue, OK_Ordinary), SubStmt(SubStmt),
43364335
LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
43374336
setDependence(computeDependence(this, TemplateDepth));
43384337
// FIXME: A templated statement expression should have an associated
@@ -4582,7 +4581,7 @@ class GNUNullExpr : public Expr {
45824581

45834582
public:
45844583
GNUNullExpr(QualType Ty, SourceLocation Loc)
4585-
: Expr(GNUNullExprClass, Ty, VK_RValue, OK_Ordinary), TokenLoc(Loc) {
4584+
: Expr(GNUNullExprClass, Ty, VK_PRValue, OK_Ordinary), TokenLoc(Loc) {
45864585
setDependence(ExprDependence::None);
45874586
}
45884587

@@ -4617,7 +4616,7 @@ class VAArgExpr : public Expr {
46174616
public:
46184617
VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo,
46194618
SourceLocation RPLoc, QualType t, bool IsMS)
4620-
: Expr(VAArgExprClass, t, VK_RValue, OK_Ordinary), Val(e),
4619+
: Expr(VAArgExprClass, t, VK_PRValue, OK_Ordinary), Val(e),
46214620
TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {
46224621
setDependence(computeDependence(this));
46234622
}
@@ -5309,7 +5308,7 @@ class DesignatedInitExpr final
53095308
class NoInitExpr : public Expr {
53105309
public:
53115310
explicit NoInitExpr(QualType ty)
5312-
: Expr(NoInitExprClass, ty, VK_RValue, OK_Ordinary) {
5311+
: Expr(NoInitExprClass, ty, VK_PRValue, OK_Ordinary) {
53135312
setDependence(computeDependence(this));
53145313
}
53155314

@@ -5405,7 +5404,7 @@ class ArrayInitLoopExpr : public Expr {
54055404

54065405
public:
54075406
explicit ArrayInitLoopExpr(QualType T, Expr *CommonInit, Expr *ElementInit)
5408-
: Expr(ArrayInitLoopExprClass, T, VK_RValue, OK_Ordinary),
5407+
: Expr(ArrayInitLoopExprClass, T, VK_PRValue, OK_Ordinary),
54095408
SubExprs{CommonInit, ElementInit} {
54105409
setDependence(computeDependence(this));
54115410
}
@@ -5456,7 +5455,7 @@ class ArrayInitIndexExpr : public Expr {
54565455

54575456
public:
54585457
explicit ArrayInitIndexExpr(QualType T)
5459-
: Expr(ArrayInitIndexExprClass, T, VK_RValue, OK_Ordinary) {
5458+
: Expr(ArrayInitIndexExprClass, T, VK_PRValue, OK_Ordinary) {
54605459
setDependence(ExprDependence::None);
54615460
}
54625461

@@ -5489,7 +5488,7 @@ class ArrayInitIndexExpr : public Expr {
54895488
class ImplicitValueInitExpr : public Expr {
54905489
public:
54915490
explicit ImplicitValueInitExpr(QualType ty)
5492-
: Expr(ImplicitValueInitExprClass, ty, VK_RValue, OK_Ordinary) {
5491+
: Expr(ImplicitValueInitExprClass, ty, VK_PRValue, OK_Ordinary) {
54935492
setDependence(computeDependence(this));
54945493
}
54955494

@@ -5894,7 +5893,7 @@ class ExtVectorElementExpr : public Expr {
58945893
ExtVectorElementExpr(QualType ty, ExprValueKind VK, Expr *base,
58955894
IdentifierInfo &accessor, SourceLocation loc)
58965895
: Expr(ExtVectorElementExprClass, ty, VK,
5897-
(VK == VK_RValue ? OK_Ordinary : OK_VectorComponent)),
5896+
(VK == VK_PRValue ? OK_Ordinary : OK_VectorComponent)),
58985897
Base(base), Accessor(&accessor), AccessorLoc(loc) {
58995898
setDependence(computeDependence(this));
59005899
}
@@ -5951,7 +5950,7 @@ class BlockExpr : public Expr {
59515950
BlockDecl *TheBlock;
59525951
public:
59535952
BlockExpr(BlockDecl *BD, QualType ty)
5954-
: Expr(BlockExprClass, ty, VK_RValue, OK_Ordinary), TheBlock(BD) {
5953+
: Expr(BlockExprClass, ty, VK_PRValue, OK_Ordinary), TheBlock(BD) {
59555954
setDependence(computeDependence(this));
59565955
}
59575956

clang/include/clang/AST/ExprCXX.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ class UserDefinedLiteral final : public CallExpr {
721721
class CXXBoolLiteralExpr : public Expr {
722722
public:
723723
CXXBoolLiteralExpr(bool Val, QualType Ty, SourceLocation Loc)
724-
: Expr(CXXBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary) {
724+
: Expr(CXXBoolLiteralExprClass, Ty, VK_PRValue, OK_Ordinary) {
725725
CXXBoolLiteralExprBits.Value = Val;
726726
CXXBoolLiteralExprBits.Loc = Loc;
727727
setDependence(ExprDependence::None);
@@ -759,7 +759,7 @@ class CXXBoolLiteralExpr : public Expr {
759759
class CXXNullPtrLiteralExpr : public Expr {
760760
public:
761761
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation Loc)
762-
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_RValue, OK_Ordinary) {
762+
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_PRValue, OK_Ordinary) {
763763
CXXNullPtrLiteralExprBits.Loc = Loc;
764764
setDependence(ExprDependence::None);
765765
}
@@ -799,7 +799,7 @@ class CXXStdInitializerListExpr : public Expr {
799799
friend class ASTStmtReader;
800800

801801
CXXStdInitializerListExpr(QualType Ty, Expr *SubExpr)
802-
: Expr(CXXStdInitializerListExprClass, Ty, VK_RValue, OK_Ordinary),
802+
: Expr(CXXStdInitializerListExprClass, Ty, VK_PRValue, OK_Ordinary),
803803
SubExpr(SubExpr) {
804804
setDependence(computeDependence(this));
805805
}
@@ -1142,7 +1142,7 @@ class CXXUuidofExpr : public Expr {
11421142
class CXXThisExpr : public Expr {
11431143
public:
11441144
CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit)
1145-
: Expr(CXXThisExprClass, Ty, VK_RValue, OK_Ordinary) {
1145+
: Expr(CXXThisExprClass, Ty, VK_PRValue, OK_Ordinary) {
11461146
CXXThisExprBits.IsImplicit = IsImplicit;
11471147
CXXThisExprBits.Loc = L;
11481148
setDependence(computeDependence(this));
@@ -1191,7 +1191,7 @@ class CXXThrowExpr : public Expr {
11911191
// null if not present.
11921192
CXXThrowExpr(Expr *Operand, QualType Ty, SourceLocation Loc,
11931193
bool IsThrownVariableInScope)
1194-
: Expr(CXXThrowExprClass, Ty, VK_RValue, OK_Ordinary), Operand(Operand) {
1194+
: Expr(CXXThrowExprClass, Ty, VK_PRValue, OK_Ordinary), Operand(Operand) {
11951195
CXXThrowExprBits.ThrowLoc = Loc;
11961196
CXXThrowExprBits.IsThrownVariableInScope = IsThrownVariableInScope;
11971197
setDependence(computeDependence(this));
@@ -1414,7 +1414,7 @@ class CXXBindTemporaryExpr : public Expr {
14141414
Stmt *SubExpr = nullptr;
14151415

14161416
CXXBindTemporaryExpr(CXXTemporary *temp, Expr *SubExpr)
1417-
: Expr(CXXBindTemporaryExprClass, SubExpr->getType(), VK_RValue,
1417+
: Expr(CXXBindTemporaryExprClass, SubExpr->getType(), VK_PRValue,
14181418
OK_Ordinary),
14191419
Temp(temp), SubExpr(SubExpr) {
14201420
setDependence(computeDependence(this));
@@ -1669,7 +1669,7 @@ class CXXInheritedCtorInitExpr : public Expr {
16691669
CXXInheritedCtorInitExpr(SourceLocation Loc, QualType T,
16701670
CXXConstructorDecl *Ctor, bool ConstructsVirtualBase,
16711671
bool InheritedFromVirtualBase)
1672-
: Expr(CXXInheritedCtorInitExprClass, T, VK_RValue, OK_Ordinary),
1672+
: Expr(CXXInheritedCtorInitExprClass, T, VK_PRValue, OK_Ordinary),
16731673
Constructor(Ctor), Loc(Loc),
16741674
ConstructsVirtualBase(ConstructsVirtualBase),
16751675
InheritedFromVirtualBase(InheritedFromVirtualBase) {
@@ -2100,7 +2100,7 @@ class CXXScalarValueInitExpr : public Expr {
21002100
/// expression.
21012101
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo,
21022102
SourceLocation RParenLoc)
2103-
: Expr(CXXScalarValueInitExprClass, Type, VK_RValue, OK_Ordinary),
2103+
: Expr(CXXScalarValueInitExprClass, Type, VK_PRValue, OK_Ordinary),
21042104
TypeInfo(TypeInfo) {
21052105
CXXScalarValueInitExprBits.RParenLoc = RParenLoc;
21062106
setDependence(computeDependence(this));
@@ -2408,7 +2408,7 @@ class CXXDeleteExpr : public Expr {
24082408
CXXDeleteExpr(QualType Ty, bool GlobalDelete, bool ArrayForm,
24092409
bool ArrayFormAsWritten, bool UsualArrayDeleteWantsSize,
24102410
FunctionDecl *OperatorDelete, Expr *Arg, SourceLocation Loc)
2411-
: Expr(CXXDeleteExprClass, Ty, VK_RValue, OK_Ordinary),
2411+
: Expr(CXXDeleteExprClass, Ty, VK_PRValue, OK_Ordinary),
24122412
OperatorDelete(OperatorDelete), Argument(Arg) {
24132413
CXXDeleteExprBits.GlobalDelete = GlobalDelete;
24142414
CXXDeleteExprBits.ArrayForm = ArrayForm;
@@ -2775,7 +2775,7 @@ class ArrayTypeTraitExpr : public Expr {
27752775
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att,
27762776
TypeSourceInfo *queried, uint64_t value, Expr *dimension,
27772777
SourceLocation rparen, QualType ty)
2778-
: Expr(ArrayTypeTraitExprClass, ty, VK_RValue, OK_Ordinary), ATT(att),
2778+
: Expr(ArrayTypeTraitExprClass, ty, VK_PRValue, OK_Ordinary), ATT(att),
27792779
Value(value), Dimension(dimension), Loc(loc), RParen(rparen),
27802780
QueriedType(queried) {
27812781
assert(att <= ATT_Last && "invalid enum value!");
@@ -2841,7 +2841,7 @@ class ExpressionTraitExpr : public Expr {
28412841

28422842
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried,
28432843
bool value, SourceLocation rparen, QualType resultType)
2844-
: Expr(ExpressionTraitExprClass, resultType, VK_RValue, OK_Ordinary),
2844+
: Expr(ExpressionTraitExprClass, resultType, VK_PRValue, OK_Ordinary),
28452845
ET(et), Value(value), Loc(loc), RParen(rparen),
28462846
QueriedExpression(queried) {
28472847
assert(et <= ET_Last && "invalid enum value!");
@@ -4003,7 +4003,7 @@ class CXXNoexceptExpr : public Expr {
40034003
public:
40044004
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val,
40054005
SourceLocation Keyword, SourceLocation RParen)
4006-
: Expr(CXXNoexceptExprClass, Ty, VK_RValue, OK_Ordinary),
4006+
: Expr(CXXNoexceptExprClass, Ty, VK_PRValue, OK_Ordinary),
40074007
Operand(Operand), Range(Keyword, RParen) {
40084008
CXXNoexceptExprBits.Value = Val == CT_Cannot;
40094009
setDependence(computeDependence(this, Val));
@@ -4161,7 +4161,7 @@ class SizeOfPackExpr final
41614161
SourceLocation PackLoc, SourceLocation RParenLoc,
41624162
Optional<unsigned> Length,
41634163
ArrayRef<TemplateArgument> PartialArgs)
4164-
: Expr(SizeOfPackExprClass, SizeType, VK_RValue, OK_Ordinary),
4164+
: Expr(SizeOfPackExprClass, SizeType, VK_PRValue, OK_Ordinary),
41654165
OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
41664166
Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
41674167
assert((!Length || PartialArgs.empty()) &&
@@ -4593,8 +4593,8 @@ class CXXFoldExpr : public Expr {
45934593
SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode,
45944594
SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc,
45954595
Optional<unsigned> NumExpansions)
4596-
: Expr(CXXFoldExprClass, T, VK_RValue, OK_Ordinary), LParenLoc(LParenLoc),
4597-
EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4596+
: Expr(CXXFoldExprClass, T, VK_PRValue, OK_Ordinary),
4597+
LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
45984598
NumExpansions(NumExpansions ? *NumExpansions + 1 : 0), Opcode(Opcode) {
45994599
SubExprs[SubExpr::Callee] = Callee;
46004600
SubExprs[SubExpr::LHS] = LHS;
@@ -4704,7 +4704,7 @@ class CoroutineSuspendExpr : public Expr {
47044704

47054705
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty,
47064706
Expr *Common)
4707-
: Expr(SC, Ty, VK_RValue, OK_Ordinary), KeywordLoc(KeywordLoc) {
4707+
: Expr(SC, Ty, VK_PRValue, OK_Ordinary), KeywordLoc(KeywordLoc) {
47084708
assert(Common->isTypeDependent() && Ty->isDependentType() &&
47094709
"wrong constructor for non-dependent co_await/co_yield expression");
47104710
SubExprs[SubExpr::Common] = Common;
@@ -4808,7 +4808,7 @@ class DependentCoawaitExpr : public Expr {
48084808
public:
48094809
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op,
48104810
UnresolvedLookupExpr *OpCoawait)
4811-
: Expr(DependentCoawaitExprClass, Ty, VK_RValue, OK_Ordinary),
4811+
: Expr(DependentCoawaitExprClass, Ty, VK_PRValue, OK_Ordinary),
48124812
KeywordLoc(KeywordLoc) {
48134813
// NOTE: A co_await expression is dependent on the coroutines promise
48144814
// type and may be dependent even when the `Op` expression is not.

clang/include/clang/AST/ExprObjC.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ObjCStringLiteral : public Expr {
5555

5656
public:
5757
ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)
58-
: Expr(ObjCStringLiteralClass, T, VK_RValue, OK_Ordinary), String(SL),
58+
: Expr(ObjCStringLiteralClass, T, VK_PRValue, OK_Ordinary), String(SL),
5959
AtLoc(L) {
6060
setDependence(ExprDependence::None);
6161
}
@@ -91,7 +91,7 @@ class ObjCBoolLiteralExpr : public Expr {
9191

9292
public:
9393
ObjCBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)
94-
: Expr(ObjCBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary), Value(val),
94+
: Expr(ObjCBoolLiteralExprClass, Ty, VK_PRValue, OK_Ordinary), Value(val),
9595
Loc(l) {
9696
setDependence(ExprDependence::None);
9797
}
@@ -134,7 +134,7 @@ class ObjCBoxedExpr : public Expr {
134134
friend class ASTStmtReader;
135135

136136
ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, SourceRange R)
137-
: Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary), SubExpr(E),
137+
: Expr(ObjCBoxedExprClass, T, VK_PRValue, OK_Ordinary), SubExpr(E),
138138
BoxingMethod(method), Range(R) {
139139
setDependence(computeDependence(this));
140140
}
@@ -458,7 +458,7 @@ class ObjCSelectorExpr : public Expr {
458458
public:
459459
ObjCSelectorExpr(QualType T, Selector selInfo, SourceLocation at,
460460
SourceLocation rp)
461-
: Expr(ObjCSelectorExprClass, T, VK_RValue, OK_Ordinary),
461+
: Expr(ObjCSelectorExprClass, T, VK_PRValue, OK_Ordinary),
462462
SelName(selInfo), AtLoc(at), RParenLoc(rp) {
463463
setDependence(ExprDependence::None);
464464
}
@@ -511,7 +511,7 @@ class ObjCProtocolExpr : public Expr {
511511

512512
ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol, SourceLocation at,
513513
SourceLocation protoLoc, SourceLocation rp)
514-
: Expr(ObjCProtocolExprClass, T, VK_RValue, OK_Ordinary),
514+
: Expr(ObjCProtocolExprClass, T, VK_PRValue, OK_Ordinary),
515515
TheProtocol(protocol), AtLoc(at), ProtoLoc(protoLoc), RParenLoc(rp) {
516516
setDependence(ExprDependence::None);
517517
}
@@ -1638,8 +1638,8 @@ class ObjCBridgedCastExpr final
16381638
ObjCBridgedCastExpr(SourceLocation LParenLoc, ObjCBridgeCastKind Kind,
16391639
CastKind CK, SourceLocation BridgeKeywordLoc,
16401640
TypeSourceInfo *TSInfo, Expr *Operand)
1641-
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue,
1642-
CK, Operand, 0, false, TSInfo),
1641+
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(),
1642+
VK_PRValue, CK, Operand, 0, false, TSInfo),
16431643
LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
16441644

16451645
/// Construct an empty Objective-C bridged cast.
@@ -1692,7 +1692,7 @@ class ObjCAvailabilityCheckExpr : public Expr {
16921692
public:
16931693
ObjCAvailabilityCheckExpr(VersionTuple VersionToCheck, SourceLocation AtLoc,
16941694
SourceLocation RParen, QualType Ty)
1695-
: Expr(ObjCAvailabilityCheckExprClass, Ty, VK_RValue, OK_Ordinary),
1695+
: Expr(ObjCAvailabilityCheckExprClass, Ty, VK_PRValue, OK_Ordinary),
16961696
VersionToCheck(VersionToCheck), AtLoc(AtLoc), RParen(RParen) {
16971697
setDependence(ExprDependence::None);
16981698
}

clang/include/clang/Basic/Specifiers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ namespace clang {
105105
/// The categorization of expression values, currently following the
106106
/// C++11 scheme.
107107
enum ExprValueKind {
108-
/// An r-value expression (a pr-value in the C++11 taxonomy)
108+
/// A pr-value expression (in the C++11 taxonomy)
109109
/// produces a temporary value.
110-
VK_RValue,
110+
VK_PRValue,
111111

112112
/// An l-value expression is a reference to an object with
113113
/// independent storage.

clang/include/clang/Sema/Initialization.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,8 @@ class InitializationSequence {
831831
/// function or via a constructor.
832832
SK_UserConversion,
833833

834-
/// Perform a qualification conversion, producing an rvalue.
835-
SK_QualificationConversionRValue,
834+
/// Perform a qualification conversion, producing a prvalue.
835+
SK_QualificationConversionPRValue,
836836

837837
/// Perform a qualification conversion, producing an xvalue.
838838
SK_QualificationConversionXValue,

0 commit comments

Comments
 (0)