[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 <mizvekov@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D103720
This commit is contained in:
Matheus Izvekov 2021-06-04 23:15:23 +02:00
parent f3fd36e590
commit aef5d8fdc7
74 changed files with 1817 additions and 1916 deletions

View File

@ -124,7 +124,7 @@ void UniqueptrResetReleaseCheck::check(const MatchFinder::MatchResult &Result) {
AssignmentText = " = std::move(*";
TrailingText = ")";
NeedsUtilityInclude = true;
} else if (!Right->isRValue()) {
} else if (!Right->isPRValue()) {
AssignmentText = " = std::move(";
TrailingText = ")";
NeedsUtilityInclude = true;

View File

@ -429,7 +429,7 @@ static bool usagesAreConst(ASTContext *Context, const UsageResult &Usages) {
/// by reference.
static bool usagesReturnRValues(const UsageResult &Usages) {
for (const auto &U : Usages) {
if (U.Expression && !U.Expression->isRValue())
if (U.Expression && !U.Expression->isPRValue())
return false;
}
return true;

View File

@ -266,13 +266,11 @@ public:
/// C++11 divides the concept of "r-value" into pure r-values
/// ("pr-values") and so-called expiring values ("x-values"), which
/// identify specific objects that can be safely cannibalized for
/// their resources. This is an unfortunate abuse of terminology on
/// the part of the C++ committee. In Clang, when we say "r-value",
/// we generally mean a pr-value.
/// their resources.
bool isLValue() const { return getValueKind() == VK_LValue; }
bool isRValue() const { return getValueKind() == VK_RValue; }
bool isPRValue() const { return getValueKind() == VK_PRValue; }
bool isXValue() const { return getValueKind() == VK_XValue; }
bool isGLValue() const { return getValueKind() != VK_RValue; }
bool isGLValue() const { return getValueKind() != VK_PRValue; }
enum LValueClassification {
LV_Valid,
@ -425,7 +423,7 @@ public:
? VK_LValue
: (RT->getPointeeType()->isFunctionType()
? VK_LValue : VK_XValue));
return VK_RValue;
return VK_PRValue;
}
/// getValueKind - The value kind that this expression produces.
@ -1588,8 +1586,8 @@ public:
// type should be IntTy
CharacterLiteral(unsigned value, CharacterKind kind, QualType type,
SourceLocation l)
: Expr(CharacterLiteralClass, type, VK_RValue, OK_Ordinary), Value(value),
Loc(l) {
: Expr(CharacterLiteralClass, type, VK_PRValue, OK_Ordinary),
Value(value), Loc(l) {
CharacterLiteralBits.Kind = kind;
setDependence(ExprDependence::None);
}
@ -1709,7 +1707,7 @@ class ImaginaryLiteral : public Expr {
Stmt *Val;
public:
ImaginaryLiteral(Expr *val, QualType Ty)
: Expr(ImaginaryLiteralClass, Ty, VK_RValue, OK_Ordinary), Val(val) {
: Expr(ImaginaryLiteralClass, Ty, VK_PRValue, OK_Ordinary), Val(val) {
setDependence(ExprDependence::None);
}
@ -2547,7 +2545,8 @@ public:
UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKind, TypeSourceInfo *TInfo,
QualType resultType, SourceLocation op,
SourceLocation rp)
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_RValue, OK_Ordinary),
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_PRValue,
OK_Ordinary),
OpLoc(op), RParenLoc(rp) {
assert(ExprKind <= UETT_Last && "invalid enum value!");
UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
@ -4287,7 +4286,7 @@ class AddrLabelExpr : public Expr {
public:
AddrLabelExpr(SourceLocation AALoc, SourceLocation LLoc, LabelDecl *L,
QualType t)
: Expr(AddrLabelExprClass, t, VK_RValue, OK_Ordinary), AmpAmpLoc(AALoc),
: Expr(AddrLabelExprClass, t, VK_PRValue, OK_Ordinary), AmpAmpLoc(AALoc),
LabelLoc(LLoc), Label(L) {
setDependence(ExprDependence::None);
}
@ -4332,7 +4331,7 @@ class StmtExpr : public Expr {
public:
StmtExpr(CompoundStmt *SubStmt, QualType T, SourceLocation LParenLoc,
SourceLocation RParenLoc, unsigned TemplateDepth)
: Expr(StmtExprClass, T, VK_RValue, OK_Ordinary), SubStmt(SubStmt),
: Expr(StmtExprClass, T, VK_PRValue, OK_Ordinary), SubStmt(SubStmt),
LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
setDependence(computeDependence(this, TemplateDepth));
// FIXME: A templated statement expression should have an associated
@ -4582,7 +4581,7 @@ class GNUNullExpr : public Expr {
public:
GNUNullExpr(QualType Ty, SourceLocation Loc)
: Expr(GNUNullExprClass, Ty, VK_RValue, OK_Ordinary), TokenLoc(Loc) {
: Expr(GNUNullExprClass, Ty, VK_PRValue, OK_Ordinary), TokenLoc(Loc) {
setDependence(ExprDependence::None);
}
@ -4617,7 +4616,7 @@ class VAArgExpr : public Expr {
public:
VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo,
SourceLocation RPLoc, QualType t, bool IsMS)
: Expr(VAArgExprClass, t, VK_RValue, OK_Ordinary), Val(e),
: Expr(VAArgExprClass, t, VK_PRValue, OK_Ordinary), Val(e),
TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {
setDependence(computeDependence(this));
}
@ -5309,7 +5308,7 @@ public:
class NoInitExpr : public Expr {
public:
explicit NoInitExpr(QualType ty)
: Expr(NoInitExprClass, ty, VK_RValue, OK_Ordinary) {
: Expr(NoInitExprClass, ty, VK_PRValue, OK_Ordinary) {
setDependence(computeDependence(this));
}
@ -5405,7 +5404,7 @@ class ArrayInitLoopExpr : public Expr {
public:
explicit ArrayInitLoopExpr(QualType T, Expr *CommonInit, Expr *ElementInit)
: Expr(ArrayInitLoopExprClass, T, VK_RValue, OK_Ordinary),
: Expr(ArrayInitLoopExprClass, T, VK_PRValue, OK_Ordinary),
SubExprs{CommonInit, ElementInit} {
setDependence(computeDependence(this));
}
@ -5456,7 +5455,7 @@ class ArrayInitIndexExpr : public Expr {
public:
explicit ArrayInitIndexExpr(QualType T)
: Expr(ArrayInitIndexExprClass, T, VK_RValue, OK_Ordinary) {
: Expr(ArrayInitIndexExprClass, T, VK_PRValue, OK_Ordinary) {
setDependence(ExprDependence::None);
}
@ -5489,7 +5488,7 @@ public:
class ImplicitValueInitExpr : public Expr {
public:
explicit ImplicitValueInitExpr(QualType ty)
: Expr(ImplicitValueInitExprClass, ty, VK_RValue, OK_Ordinary) {
: Expr(ImplicitValueInitExprClass, ty, VK_PRValue, OK_Ordinary) {
setDependence(computeDependence(this));
}
@ -5894,7 +5893,7 @@ public:
ExtVectorElementExpr(QualType ty, ExprValueKind VK, Expr *base,
IdentifierInfo &accessor, SourceLocation loc)
: Expr(ExtVectorElementExprClass, ty, VK,
(VK == VK_RValue ? OK_Ordinary : OK_VectorComponent)),
(VK == VK_PRValue ? OK_Ordinary : OK_VectorComponent)),
Base(base), Accessor(&accessor), AccessorLoc(loc) {
setDependence(computeDependence(this));
}
@ -5951,7 +5950,7 @@ protected:
BlockDecl *TheBlock;
public:
BlockExpr(BlockDecl *BD, QualType ty)
: Expr(BlockExprClass, ty, VK_RValue, OK_Ordinary), TheBlock(BD) {
: Expr(BlockExprClass, ty, VK_PRValue, OK_Ordinary), TheBlock(BD) {
setDependence(computeDependence(this));
}

View File

@ -721,7 +721,7 @@ public:
class CXXBoolLiteralExpr : public Expr {
public:
CXXBoolLiteralExpr(bool Val, QualType Ty, SourceLocation Loc)
: Expr(CXXBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary) {
: Expr(CXXBoolLiteralExprClass, Ty, VK_PRValue, OK_Ordinary) {
CXXBoolLiteralExprBits.Value = Val;
CXXBoolLiteralExprBits.Loc = Loc;
setDependence(ExprDependence::None);
@ -759,7 +759,7 @@ public:
class CXXNullPtrLiteralExpr : public Expr {
public:
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation Loc)
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_RValue, OK_Ordinary) {
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_PRValue, OK_Ordinary) {
CXXNullPtrLiteralExprBits.Loc = Loc;
setDependence(ExprDependence::None);
}
@ -799,7 +799,7 @@ public:
friend class ASTStmtReader;
CXXStdInitializerListExpr(QualType Ty, Expr *SubExpr)
: Expr(CXXStdInitializerListExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(CXXStdInitializerListExprClass, Ty, VK_PRValue, OK_Ordinary),
SubExpr(SubExpr) {
setDependence(computeDependence(this));
}
@ -1142,7 +1142,7 @@ public:
class CXXThisExpr : public Expr {
public:
CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit)
: Expr(CXXThisExprClass, Ty, VK_RValue, OK_Ordinary) {
: Expr(CXXThisExprClass, Ty, VK_PRValue, OK_Ordinary) {
CXXThisExprBits.IsImplicit = IsImplicit;
CXXThisExprBits.Loc = L;
setDependence(computeDependence(this));
@ -1191,7 +1191,7 @@ public:
// null if not present.
CXXThrowExpr(Expr *Operand, QualType Ty, SourceLocation Loc,
bool IsThrownVariableInScope)
: Expr(CXXThrowExprClass, Ty, VK_RValue, OK_Ordinary), Operand(Operand) {
: Expr(CXXThrowExprClass, Ty, VK_PRValue, OK_Ordinary), Operand(Operand) {
CXXThrowExprBits.ThrowLoc = Loc;
CXXThrowExprBits.IsThrownVariableInScope = IsThrownVariableInScope;
setDependence(computeDependence(this));
@ -1414,7 +1414,7 @@ class CXXBindTemporaryExpr : public Expr {
Stmt *SubExpr = nullptr;
CXXBindTemporaryExpr(CXXTemporary *temp, Expr *SubExpr)
: Expr(CXXBindTemporaryExprClass, SubExpr->getType(), VK_RValue,
: Expr(CXXBindTemporaryExprClass, SubExpr->getType(), VK_PRValue,
OK_Ordinary),
Temp(temp), SubExpr(SubExpr) {
setDependence(computeDependence(this));
@ -1669,7 +1669,7 @@ public:
CXXInheritedCtorInitExpr(SourceLocation Loc, QualType T,
CXXConstructorDecl *Ctor, bool ConstructsVirtualBase,
bool InheritedFromVirtualBase)
: Expr(CXXInheritedCtorInitExprClass, T, VK_RValue, OK_Ordinary),
: Expr(CXXInheritedCtorInitExprClass, T, VK_PRValue, OK_Ordinary),
Constructor(Ctor), Loc(Loc),
ConstructsVirtualBase(ConstructsVirtualBase),
InheritedFromVirtualBase(InheritedFromVirtualBase) {
@ -2100,7 +2100,7 @@ public:
/// expression.
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo,
SourceLocation RParenLoc)
: Expr(CXXScalarValueInitExprClass, Type, VK_RValue, OK_Ordinary),
: Expr(CXXScalarValueInitExprClass, Type, VK_PRValue, OK_Ordinary),
TypeInfo(TypeInfo) {
CXXScalarValueInitExprBits.RParenLoc = RParenLoc;
setDependence(computeDependence(this));
@ -2408,7 +2408,7 @@ public:
CXXDeleteExpr(QualType Ty, bool GlobalDelete, bool ArrayForm,
bool ArrayFormAsWritten, bool UsualArrayDeleteWantsSize,
FunctionDecl *OperatorDelete, Expr *Arg, SourceLocation Loc)
: Expr(CXXDeleteExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(CXXDeleteExprClass, Ty, VK_PRValue, OK_Ordinary),
OperatorDelete(OperatorDelete), Argument(Arg) {
CXXDeleteExprBits.GlobalDelete = GlobalDelete;
CXXDeleteExprBits.ArrayForm = ArrayForm;
@ -2775,7 +2775,7 @@ public:
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att,
TypeSourceInfo *queried, uint64_t value, Expr *dimension,
SourceLocation rparen, QualType ty)
: Expr(ArrayTypeTraitExprClass, ty, VK_RValue, OK_Ordinary), ATT(att),
: Expr(ArrayTypeTraitExprClass, ty, VK_PRValue, OK_Ordinary), ATT(att),
Value(value), Dimension(dimension), Loc(loc), RParen(rparen),
QueriedType(queried) {
assert(att <= ATT_Last && "invalid enum value!");
@ -2841,7 +2841,7 @@ public:
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried,
bool value, SourceLocation rparen, QualType resultType)
: Expr(ExpressionTraitExprClass, resultType, VK_RValue, OK_Ordinary),
: Expr(ExpressionTraitExprClass, resultType, VK_PRValue, OK_Ordinary),
ET(et), Value(value), Loc(loc), RParen(rparen),
QueriedExpression(queried) {
assert(et <= ET_Last && "invalid enum value!");
@ -4003,7 +4003,7 @@ class CXXNoexceptExpr : public Expr {
public:
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val,
SourceLocation Keyword, SourceLocation RParen)
: Expr(CXXNoexceptExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(CXXNoexceptExprClass, Ty, VK_PRValue, OK_Ordinary),
Operand(Operand), Range(Keyword, RParen) {
CXXNoexceptExprBits.Value = Val == CT_Cannot;
setDependence(computeDependence(this, Val));
@ -4161,7 +4161,7 @@ class SizeOfPackExpr final
SourceLocation PackLoc, SourceLocation RParenLoc,
Optional<unsigned> Length,
ArrayRef<TemplateArgument> PartialArgs)
: Expr(SizeOfPackExprClass, SizeType, VK_RValue, OK_Ordinary),
: Expr(SizeOfPackExprClass, SizeType, VK_PRValue, OK_Ordinary),
OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
assert((!Length || PartialArgs.empty()) &&
@ -4593,8 +4593,8 @@ public:
SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode,
SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc,
Optional<unsigned> NumExpansions)
: Expr(CXXFoldExprClass, T, VK_RValue, OK_Ordinary), LParenLoc(LParenLoc),
EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
: Expr(CXXFoldExprClass, T, VK_PRValue, OK_Ordinary),
LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
NumExpansions(NumExpansions ? *NumExpansions + 1 : 0), Opcode(Opcode) {
SubExprs[SubExpr::Callee] = Callee;
SubExprs[SubExpr::LHS] = LHS;
@ -4704,7 +4704,7 @@ public:
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty,
Expr *Common)
: Expr(SC, Ty, VK_RValue, OK_Ordinary), KeywordLoc(KeywordLoc) {
: Expr(SC, Ty, VK_PRValue, OK_Ordinary), KeywordLoc(KeywordLoc) {
assert(Common->isTypeDependent() && Ty->isDependentType() &&
"wrong constructor for non-dependent co_await/co_yield expression");
SubExprs[SubExpr::Common] = Common;
@ -4808,7 +4808,7 @@ class DependentCoawaitExpr : public Expr {
public:
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op,
UnresolvedLookupExpr *OpCoawait)
: Expr(DependentCoawaitExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(DependentCoawaitExprClass, Ty, VK_PRValue, OK_Ordinary),
KeywordLoc(KeywordLoc) {
// NOTE: A co_await expression is dependent on the coroutines promise
// type and may be dependent even when the `Op` expression is not.

View File

@ -55,7 +55,7 @@ class ObjCStringLiteral : public Expr {
public:
ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)
: Expr(ObjCStringLiteralClass, T, VK_RValue, OK_Ordinary), String(SL),
: Expr(ObjCStringLiteralClass, T, VK_PRValue, OK_Ordinary), String(SL),
AtLoc(L) {
setDependence(ExprDependence::None);
}
@ -91,7 +91,7 @@ class ObjCBoolLiteralExpr : public Expr {
public:
ObjCBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)
: Expr(ObjCBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary), Value(val),
: Expr(ObjCBoolLiteralExprClass, Ty, VK_PRValue, OK_Ordinary), Value(val),
Loc(l) {
setDependence(ExprDependence::None);
}
@ -134,7 +134,7 @@ public:
friend class ASTStmtReader;
ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, SourceRange R)
: Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary), SubExpr(E),
: Expr(ObjCBoxedExprClass, T, VK_PRValue, OK_Ordinary), SubExpr(E),
BoxingMethod(method), Range(R) {
setDependence(computeDependence(this));
}
@ -458,7 +458,7 @@ class ObjCSelectorExpr : public Expr {
public:
ObjCSelectorExpr(QualType T, Selector selInfo, SourceLocation at,
SourceLocation rp)
: Expr(ObjCSelectorExprClass, T, VK_RValue, OK_Ordinary),
: Expr(ObjCSelectorExprClass, T, VK_PRValue, OK_Ordinary),
SelName(selInfo), AtLoc(at), RParenLoc(rp) {
setDependence(ExprDependence::None);
}
@ -511,7 +511,7 @@ public:
ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol, SourceLocation at,
SourceLocation protoLoc, SourceLocation rp)
: Expr(ObjCProtocolExprClass, T, VK_RValue, OK_Ordinary),
: Expr(ObjCProtocolExprClass, T, VK_PRValue, OK_Ordinary),
TheProtocol(protocol), AtLoc(at), ProtoLoc(protoLoc), RParenLoc(rp) {
setDependence(ExprDependence::None);
}
@ -1638,8 +1638,8 @@ public:
ObjCBridgedCastExpr(SourceLocation LParenLoc, ObjCBridgeCastKind Kind,
CastKind CK, SourceLocation BridgeKeywordLoc,
TypeSourceInfo *TSInfo, Expr *Operand)
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue,
CK, Operand, 0, false, TSInfo),
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(),
VK_PRValue, CK, Operand, 0, false, TSInfo),
LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
/// Construct an empty Objective-C bridged cast.
@ -1692,7 +1692,7 @@ class ObjCAvailabilityCheckExpr : public Expr {
public:
ObjCAvailabilityCheckExpr(VersionTuple VersionToCheck, SourceLocation AtLoc,
SourceLocation RParen, QualType Ty)
: Expr(ObjCAvailabilityCheckExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(ObjCAvailabilityCheckExprClass, Ty, VK_PRValue, OK_Ordinary),
VersionToCheck(VersionToCheck), AtLoc(AtLoc), RParen(RParen) {
setDependence(ExprDependence::None);
}

View File

@ -105,9 +105,9 @@ namespace clang {
/// The categorization of expression values, currently following the
/// C++11 scheme.
enum ExprValueKind {
/// An r-value expression (a pr-value in the C++11 taxonomy)
/// A pr-value expression (in the C++11 taxonomy)
/// produces a temporary value.
VK_RValue,
VK_PRValue,
/// An l-value expression is a reference to an object with
/// independent storage.

View File

@ -831,8 +831,8 @@ public:
/// function or via a constructor.
SK_UserConversion,
/// Perform a qualification conversion, producing an rvalue.
SK_QualificationConversionRValue,
/// Perform a qualification conversion, producing a prvalue.
SK_QualificationConversionPRValue,
/// Perform a qualification conversion, producing an xvalue.
SK_QualificationConversionXValue,

View File

@ -11287,11 +11287,11 @@ public:
/// ImpCastExprToType - If Expr is not of type 'Type', insert an implicit
/// cast. If there is already an implicit cast, merge into the existing one.
/// If isLvalue, the result of the cast is an lvalue.
ExprResult ImpCastExprToType(Expr *E, QualType Type, CastKind CK,
ExprValueKind VK = VK_RValue,
const CXXCastPath *BasePath = nullptr,
CheckedConversionKind CCK
= CCK_ImplicitConversion);
ExprResult
ImpCastExprToType(Expr *E, QualType Type, CastKind CK,
ExprValueKind VK = VK_PRValue,
const CXXCastPath *BasePath = nullptr,
CheckedConversionKind CCK = CCK_ImplicitConversion);
/// ScalarTypeToBooleanCastKind - Returns the cast kind corresponding
/// to the conversion from scalar type ScalarTy to the Boolean type.
@ -11576,7 +11576,7 @@ public:
CheckedConversionKind CCK);
ExprResult PerformQualificationConversion(
Expr *E, QualType Ty, ExprValueKind VK = VK_RValue,
Expr *E, QualType Ty, ExprValueKind VK = VK_PRValue,
CheckedConversionKind CCK = CCK_ImplicitConversion);
/// the following "Check" methods will return a valid/converted QualType

View File

@ -2234,7 +2234,7 @@ CXXMethodDecl *CXXMethodDecl::getDevirtualizedMethod(const Expr *Base,
// If the base expression (after skipping derived-to-base conversions) is a
// class prvalue, then we can devirtualize.
Base = Base->getBestDynamicClassTypeExpr();
if (Base->isRValue() && Base->getType()->isRecordType())
if (Base->isPRValue() && Base->getType()->isRecordType())
return this;
// If we don't even know what we would call, we can't devirtualize.

View File

@ -112,7 +112,7 @@ const Expr *Expr::skipRValueSubobjectAdjustments(
}
} else if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
if (BO->getOpcode() == BO_PtrMemD) {
assert(BO->getRHS()->isRValue());
assert(BO->getRHS()->isPRValue());
E = BO->getLHS();
const MemberPointerType *MPT =
BO->getRHS()->getType()->getAs<MemberPointerType>();
@ -509,7 +509,7 @@ SYCLUniqueStableNameExpr::SYCLUniqueStableNameExpr(SourceLocation OpLoc,
SourceLocation RParen,
QualType ResultTy,
TypeSourceInfo *TSI)
: Expr(SYCLUniqueStableNameExprClass, ResultTy, VK_RValue, OK_Ordinary),
: Expr(SYCLUniqueStableNameExprClass, ResultTy, VK_PRValue, OK_Ordinary),
OpLoc(OpLoc), LParen(LParen), RParen(RParen) {
setTypeSourceInfo(TSI);
setDependence(computeDependence(this));
@ -517,7 +517,7 @@ SYCLUniqueStableNameExpr::SYCLUniqueStableNameExpr(SourceLocation OpLoc,
SYCLUniqueStableNameExpr::SYCLUniqueStableNameExpr(EmptyShell Empty,
QualType ResultTy)
: Expr(SYCLUniqueStableNameExprClass, ResultTy, VK_RValue, OK_Ordinary) {}
: Expr(SYCLUniqueStableNameExprClass, ResultTy, VK_PRValue, OK_Ordinary) {}
SYCLUniqueStableNameExpr *
SYCLUniqueStableNameExpr::Create(const ASTContext &Ctx, SourceLocation OpLoc,
@ -878,7 +878,7 @@ void APNumericStorage::setIntValue(const ASTContext &C,
IntegerLiteral::IntegerLiteral(const ASTContext &C, const llvm::APInt &V,
QualType type, SourceLocation l)
: Expr(IntegerLiteralClass, type, VK_RValue, OK_Ordinary), Loc(l) {
: Expr(IntegerLiteralClass, type, VK_PRValue, OK_Ordinary), Loc(l) {
assert(type->isIntegerType() && "Illegal type in IntegerLiteral");
assert(V.getBitWidth() == C.getIntWidth(type) &&
"Integer type is not the correct size for constant.");
@ -900,7 +900,7 @@ IntegerLiteral::Create(const ASTContext &C, EmptyShell Empty) {
FixedPointLiteral::FixedPointLiteral(const ASTContext &C, const llvm::APInt &V,
QualType type, SourceLocation l,
unsigned Scale)
: Expr(FixedPointLiteralClass, type, VK_RValue, OK_Ordinary), Loc(l),
: Expr(FixedPointLiteralClass, type, VK_PRValue, OK_Ordinary), Loc(l),
Scale(Scale) {
assert(type->isFixedPointType() && "Illegal type in FixedPointLiteral");
assert(V.getBitWidth() == C.getTypeInfo(type).Width &&
@ -1004,7 +1004,7 @@ void CharacterLiteral::print(unsigned Val, CharacterKind Kind,
FloatingLiteral::FloatingLiteral(const ASTContext &C, const llvm::APFloat &V,
bool isexact, QualType Type, SourceLocation L)
: Expr(FloatingLiteralClass, Type, VK_RValue, OK_Ordinary), Loc(L) {
: Expr(FloatingLiteralClass, Type, VK_PRValue, OK_Ordinary), Loc(L) {
setSemantics(V.getSemantics());
FloatingLiteralBits.IsExact = isexact;
setValue(C, V);
@ -1599,7 +1599,7 @@ OffsetOfExpr::OffsetOfExpr(const ASTContext &C, QualType type,
SourceLocation OperatorLoc, TypeSourceInfo *tsi,
ArrayRef<OffsetOfNode> comps, ArrayRef<Expr *> exprs,
SourceLocation RParenLoc)
: Expr(OffsetOfExprClass, type, VK_RValue, OK_Ordinary),
: Expr(OffsetOfExprClass, type, VK_PRValue, OK_Ordinary),
OperatorLoc(OperatorLoc), RParenLoc(RParenLoc), TSInfo(tsi),
NumComps(comps.size()), NumExprs(exprs.size()) {
for (unsigned i = 0; i != comps.size(); ++i)
@ -1621,7 +1621,7 @@ IdentifierInfo *OffsetOfNode::getFieldName() const {
UnaryExprOrTypeTraitExpr::UnaryExprOrTypeTraitExpr(
UnaryExprOrTypeTrait ExprKind, Expr *E, QualType resultType,
SourceLocation op, SourceLocation rp)
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_RValue, OK_Ordinary),
: Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_PRValue, OK_Ordinary),
OpLoc(op), RParenLoc(rp) {
assert(ExprKind <= UETT_Last && "invalid enum value!");
UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
@ -1807,7 +1807,7 @@ bool CastExpr::CastConsistency() const {
auto Ty = getType();
auto SETy = getSubExpr()->getType();
assert(getValueKindForType(Ty) == Expr::getValueKindForType(SETy));
if (isRValue() && !Ty->isDependentType() && !SETy->isDependentType()) {
if (isPRValue() && !Ty->isDependentType() && !SETy->isDependentType()) {
Ty = Ty->getPointeeType();
SETy = SETy->getPointeeType();
}
@ -2182,7 +2182,7 @@ SourceLocExpr::SourceLocExpr(const ASTContext &Ctx, IdentKind Kind,
SourceLocation BLoc, SourceLocation RParenLoc,
DeclContext *ParentContext)
: Expr(SourceLocExprClass, getDecayedSourceLocExprType(Ctx, Kind),
VK_RValue, OK_Ordinary),
VK_PRValue, OK_Ordinary),
BuiltinLoc(BLoc), RParenLoc(RParenLoc), ParentContext(ParentContext) {
SourceLocExprBits.Kind = Kind;
setDependence(ExprDependence::None);
@ -2250,7 +2250,7 @@ APValue SourceLocExpr::EvaluateInContext(const ASTContext &Ctx,
InitListExpr::InitListExpr(const ASTContext &C, SourceLocation lbraceloc,
ArrayRef<Expr *> initExprs, SourceLocation rbraceloc)
: Expr(InitListExprClass, QualType(), VK_RValue, OK_Ordinary),
: Expr(InitListExprClass, QualType(), VK_PRValue, OK_Ordinary),
InitExprs(C, initExprs.size()), LBraceLoc(lbraceloc),
RBraceLoc(rbraceloc), AltForm(nullptr, true) {
sawArrayRangeDesignator(false);
@ -2320,7 +2320,7 @@ bool InitListExpr::isTransparent() const {
// Don't confuse aggregate initialization of a struct X { X &x; }; with a
// transparent struct copy.
if (!getInit(0)->isRValue() && getType()->isRecordType())
if (!getInit(0)->isPRValue() && getType()->isRecordType())
return false;
return getType().getCanonicalType() ==
@ -3909,7 +3909,7 @@ FieldDecl *Expr::getSourceBitField() {
while (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
if (ICE->getCastKind() == CK_LValueToRValue ||
(ICE->getValueKind() != VK_RValue && ICE->getCastKind() == CK_NoOp))
(ICE->getValueKind() != VK_PRValue && ICE->getCastKind() == CK_NoOp))
E = ICE->getSubExpr()->IgnoreParens();
else
break;
@ -3956,8 +3956,7 @@ bool Expr::refersToVectorElement() const {
const Expr *E = this->IgnoreParens();
while (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
if (ICE->getValueKind() != VK_RValue &&
ICE->getCastKind() == CK_NoOp)
if (ICE->getValueKind() != VK_PRValue && ICE->getCastKind() == CK_NoOp)
E = ICE->getSubExpr()->IgnoreParens();
else
break;
@ -4006,7 +4005,7 @@ bool Expr::isSameComparisonOperand(const Expr* E1, const Expr* E2) {
// template parameters.
const auto *DRE1 = cast<DeclRefExpr>(E1);
const auto *DRE2 = cast<DeclRefExpr>(E2);
return DRE1->isRValue() && DRE2->isRValue() &&
return DRE1->isPRValue() && DRE2->isPRValue() &&
DRE1->getDecl() == DRE2->getDecl();
}
case ImplicitCastExprClass: {
@ -4164,7 +4163,7 @@ void ExtVectorElementExpr::getEncodedElementAccess(
ShuffleVectorExpr::ShuffleVectorExpr(const ASTContext &C, ArrayRef<Expr *> args,
QualType Type, SourceLocation BLoc,
SourceLocation RP)
: Expr(ShuffleVectorExprClass, Type, VK_RValue, OK_Ordinary),
: Expr(ShuffleVectorExprClass, Type, VK_PRValue, OK_Ordinary),
BuiltinLoc(BLoc), RParenLoc(RP), NumExprs(args.size()) {
SubExprs = new (C) Stmt*[args.size()];
for (unsigned i = 0; i != args.size(); i++)
@ -4211,7 +4210,7 @@ GenericSelectionExpr::GenericSelectionExpr(
ArrayRef<TypeSourceInfo *> AssocTypes, ArrayRef<Expr *> AssocExprs,
SourceLocation DefaultLoc, SourceLocation RParenLoc,
bool ContainsUnexpandedParameterPack)
: Expr(GenericSelectionExprClass, Context.DependentTy, VK_RValue,
: Expr(GenericSelectionExprClass, Context.DependentTy, VK_PRValue,
OK_Ordinary),
NumAssocs(AssocExprs.size()), ResultIndex(ResultDependentIndex),
DefaultLoc(DefaultLoc), RParenLoc(RParenLoc) {
@ -4415,7 +4414,7 @@ DesignatedInitUpdateExpr::DesignatedInitUpdateExpr(const ASTContext &C,
SourceLocation lBraceLoc,
Expr *baseExpr,
SourceLocation rBraceLoc)
: Expr(DesignatedInitUpdateExprClass, baseExpr->getType(), VK_RValue,
: Expr(DesignatedInitUpdateExprClass, baseExpr->getType(), VK_PRValue,
OK_Ordinary) {
BaseAndUpdaterExprs[0] = baseExpr;
@ -4437,7 +4436,7 @@ SourceLocation DesignatedInitUpdateExpr::getEndLoc() const {
ParenListExpr::ParenListExpr(SourceLocation LParenLoc, ArrayRef<Expr *> Exprs,
SourceLocation RParenLoc)
: Expr(ParenListExprClass, QualType(), VK_RValue, OK_Ordinary),
: Expr(ParenListExprClass, QualType(), VK_PRValue, OK_Ordinary),
LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
ParenListExprBits.NumExprs = Exprs.size();
@ -4613,7 +4612,7 @@ PseudoObjectExpr *PseudoObjectExpr::Create(const ASTContext &C, Expr *syntax,
ExprValueKind VK;
if (resultIndex == NoResult) {
type = C.VoidTy;
VK = VK_RValue;
VK = VK_PRValue;
} else {
assert(resultIndex < semantics.size());
type = semantics[resultIndex]->getType();
@ -4673,7 +4672,7 @@ Stmt::const_child_range UnaryExprOrTypeTraitExpr::children() const {
AtomicExpr::AtomicExpr(SourceLocation BLoc, ArrayRef<Expr *> args, QualType t,
AtomicOp op, SourceLocation RP)
: Expr(AtomicExprClass, t, VK_RValue, OK_Ordinary),
: Expr(AtomicExprClass, t, VK_PRValue, OK_Ordinary),
NumSubExprs(args.size()), BuiltinLoc(BLoc), RParenLoc(RP), Op(op) {
assert(args.size() == getNumSubExprs(op) && "wrong number of subexpressions");
for (unsigned i = 0; i != args.size(); i++)

View File

@ -187,7 +187,7 @@ CXXNewExpr::CXXNewExpr(bool IsGlobalNew, FunctionDecl *OperatorNew,
Expr *Initializer, QualType Ty,
TypeSourceInfo *AllocatedTypeInfo, SourceRange Range,
SourceRange DirectInitRange)
: Expr(CXXNewExprClass, Ty, VK_RValue, OK_Ordinary),
: Expr(CXXNewExprClass, Ty, VK_PRValue, OK_Ordinary),
OperatorNew(OperatorNew), OperatorDelete(OperatorDelete),
AllocatedTypeInfo(AllocatedTypeInfo), Range(Range),
DirectInitRange(DirectInitRange) {
@ -321,7 +321,7 @@ CXXPseudoDestructorExpr::CXXPseudoDestructorExpr(
SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc,
TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc,
SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
: Expr(CXXPseudoDestructorExprClass, Context.BoundMemberTy, VK_RValue,
: Expr(CXXPseudoDestructorExprClass, Context.BoundMemberTy, VK_PRValue,
OK_Ordinary),
Base(static_cast<Stmt *>(Base)), IsArrow(isArrow),
OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
@ -951,9 +951,9 @@ CXXDefaultInitExpr::CXXDefaultInitExpr(const ASTContext &Ctx,
SourceLocation Loc, FieldDecl *Field,
QualType Ty, DeclContext *UsedContext)
: Expr(CXXDefaultInitExprClass, Ty.getNonLValueExprType(Ctx),
Ty->isLValueReferenceType()
? VK_LValue
: Ty->isRValueReferenceType() ? VK_XValue : VK_RValue,
Ty->isLValueReferenceType() ? VK_LValue
: Ty->isRValueReferenceType() ? VK_XValue
: VK_PRValue,
/*FIXME*/ OK_Ordinary),
Field(Field), UsedContext(UsedContext) {
CXXDefaultInitExprBits.Loc = Loc;
@ -1057,7 +1057,7 @@ CXXConstructExpr::CXXConstructExpr(
bool ListInitialization, bool StdInitListInitialization,
bool ZeroInitialization, ConstructionKind ConstructKind,
SourceRange ParenOrBraceRange)
: Expr(SC, Ty, VK_RValue, OK_Ordinary), Constructor(Ctor),
: Expr(SC, Ty, VK_PRValue, OK_Ordinary), Constructor(Ctor),
ParenOrBraceRange(ParenOrBraceRange), NumArgs(Args.size()) {
CXXConstructExprBits.Elidable = Elidable;
CXXConstructExprBits.HadMultipleCandidates = HadMultipleCandidates;
@ -1125,7 +1125,7 @@ LambdaExpr::LambdaExpr(QualType T, SourceRange IntroducerRange,
bool ExplicitResultType, ArrayRef<Expr *> CaptureInits,
SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack)
: Expr(LambdaExprClass, T, VK_RValue, OK_Ordinary),
: Expr(LambdaExprClass, T, VK_PRValue, OK_Ordinary),
IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
ClosingBrace(ClosingBrace) {
LambdaExprBits.NumCaptures = CaptureInits.size();
@ -1326,10 +1326,9 @@ CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(QualType T,
ArrayRef<Expr *> Args,
SourceLocation RParenLoc)
: Expr(CXXUnresolvedConstructExprClass, T,
(TSI->getType()->isLValueReferenceType()
? VK_LValue
: TSI->getType()->isRValueReferenceType() ? VK_XValue
: VK_RValue),
(TSI->getType()->isLValueReferenceType() ? VK_LValue
: TSI->getType()->isRValueReferenceType() ? VK_XValue
: VK_PRValue),
OK_Ordinary),
TSI(TSI), LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
CXXUnresolvedConstructExprBits.NumArgs = Args.size();
@ -1668,7 +1667,7 @@ bool MaterializeTemporaryExpr::isUsableInConstantExpressions(
TypeTraitExpr::TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind,
ArrayRef<TypeSourceInfo *> Args,
SourceLocation RParenLoc, bool Value)
: Expr(TypeTraitExprClass, T, VK_RValue, OK_Ordinary), Loc(Loc),
: Expr(TypeTraitExprClass, T, VK_PRValue, OK_Ordinary), Loc(Loc),
RParenLoc(RParenLoc) {
assert(Kind <= TT_Last && "invalid enum value!");
TypeTraitExprBits.Kind = Kind;

View File

@ -64,7 +64,9 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const {
case Cl::CL_ClassTemporary:
case Cl::CL_ArrayTemporary:
case Cl::CL_ObjCMessageRValue:
case Cl::CL_PRValue: assert(getValueKind() == VK_RValue); break;
case Cl::CL_PRValue:
assert(getValueKind() == VK_PRValue);
break;
}
Cl::ModifiableType modifiable = Cl::CM_Untested;
@ -89,7 +91,7 @@ static Cl::Kinds ClassifyExprValueKind(const LangOptions &Lang,
const Expr *E,
ExprValueKind Kind) {
switch (Kind) {
case VK_RValue:
case VK_PRValue:
return Lang.CPlusPlus ? ClassifyTemporary(E->getType()) : Cl::CL_PRValue;
case VK_LValue:
return Cl::CL_LValue;
@ -424,7 +426,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
// contains only one element. In that case, we look at that element
// for an exact classification. Init list creation takes care of the
// value kind for us, so we only need to fine-tune.
if (E->isRValue())
if (E->isPRValue())
return ClassifyExprValueKind(Lang, E, E->getValueKind());
assert(cast<InitListExpr>(E)->getNumInits() == 1 &&
"Only 1-element init lists can be glvalues.");

View File

@ -37,7 +37,7 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(
const ASTTemplateArgumentListInfo *ArgsAsWritten,
ArrayRef<TemplateArgument> ConvertedArgs,
const ConstraintSatisfaction *Satisfaction)
: Expr(ConceptSpecializationExprClass, C.BoolTy, VK_RValue, OK_Ordinary),
: Expr(ConceptSpecializationExprClass, C.BoolTy, VK_PRValue, OK_Ordinary),
ConceptReference(NNS, TemplateKWLoc, ConceptNameInfo, FoundDecl,
NamedConcept, ArgsAsWritten),
NumTemplateArgs(ConvertedArgs.size()),
@ -91,7 +91,7 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(
ArrayRef<TemplateArgument> ConvertedArgs,
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack)
: Expr(ConceptSpecializationExprClass, C.BoolTy, VK_RValue, OK_Ordinary),
: Expr(ConceptSpecializationExprClass, C.BoolTy, VK_PRValue, OK_Ordinary),
ConceptReference(NestedNameSpecifierLoc(), SourceLocation(),
DeclarationNameInfo(), NamedConcept, NamedConcept,
nullptr),
@ -146,7 +146,7 @@ RequiresExpr::RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc,
ArrayRef<ParmVarDecl *> LocalParameters,
ArrayRef<concepts::Requirement *> Requirements,
SourceLocation RBraceLoc)
: Expr(RequiresExprClass, C.BoolTy, VK_RValue, OK_Ordinary),
: Expr(RequiresExprClass, C.BoolTy, VK_PRValue, OK_Ordinary),
NumLocalParameters(LocalParameters.size()),
NumRequirements(Requirements.size()), Body(Body), RBraceLoc(RBraceLoc) {
RequiresExprBits.IsSatisfied = false;

View File

@ -101,7 +101,7 @@ namespace {
/// Given an expression, determine the type used to store the result of
/// evaluating that expression.
static QualType getStorageType(const ASTContext &Ctx, const Expr *E) {
if (E->isRValue())
if (E->isPRValue())
return E->getType();
return Ctx.getLValueReferenceType(E->getType());
}
@ -2300,7 +2300,7 @@ static bool CheckMemberPointerConstantExpression(EvalInfo &Info,
/// produce an appropriate diagnostic.
static bool CheckLiteralType(EvalInfo &Info, const Expr *E,
const LValue *This = nullptr) {
if (!E->isRValue() || E->getType()->isLiteralType(Info.Ctx))
if (!E->isPRValue() || E->getType()->isLiteralType(Info.Ctx))
return true;
// C++1y: A constant initializer for an object o [...] may also invoke
@ -2505,7 +2505,7 @@ static bool HandleConversionToBool(const APValue &Val, bool &Result) {
static bool EvaluateAsBooleanCondition(const Expr *E, bool &Result,
EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && "missing lvalue-to-rvalue conv in bool condition");
assert(E->isPRValue() && "missing lvalue-to-rvalue conv in bool condition");
APValue Val;
if (!Evaluate(Val, Info, E))
return false;
@ -4568,7 +4568,7 @@ static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal,
/// Build an lvalue for the object argument of a member function call.
static bool EvaluateObjectArgument(EvalInfo &Info, const Expr *Object,
LValue &This) {
if (Object->getType()->isPointerType() && Object->isRValue())
if (Object->getType()->isPointerType() && Object->isPRValue())
return EvaluatePointer(Object, This, Info);
if (Object->isGLValue())
@ -6368,7 +6368,7 @@ static bool HandleDestructionImpl(EvalInfo &Info, SourceLocation CallLoc,
// Invent an expression for location purposes.
// FIXME: We shouldn't need to do this.
OpaqueValueExpr LocE(CallLoc, Info.Ctx.IntTy, VK_RValue);
OpaqueValueExpr LocE(CallLoc, Info.Ctx.IntTy, VK_PRValue);
// For arrays, destroy elements right-to-left.
if (const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(T)) {
@ -7948,7 +7948,7 @@ public:
if (E->isArrow()) {
EvalOK = evaluatePointer(E->getBase(), Result);
BaseTy = E->getBase()->getType()->castAs<PointerType>()->getPointeeType();
} else if (E->getBase()->isRValue()) {
} else if (E->getBase()->isPRValue()) {
assert(E->getBase()->getType()->isRecordType());
EvalOK = EvaluateTemporary(E->getBase(), Result, this->Info);
BaseTy = E->getBase()->getType();
@ -8696,7 +8696,7 @@ public:
static bool EvaluatePointer(const Expr* E, LValue& Result, EvalInfo &Info,
bool InvalidBaseOK) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->hasPointerRepresentation());
assert(E->isPRValue() && E->getType()->hasPointerRepresentation());
return PointerExprEvaluator(Info, Result, InvalidBaseOK).Visit(E);
}
@ -9584,7 +9584,7 @@ public:
static bool EvaluateMemberPointer(const Expr *E, MemberPtr &Result,
EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isMemberPointerType());
assert(E->isPRValue() && E->getType()->isMemberPointerType());
return MemberPointerExprEvaluator(Info, Result).Visit(E);
}
@ -10074,7 +10074,7 @@ bool RecordExprEvaluator::VisitLambdaExpr(const LambdaExpr *E) {
static bool EvaluateRecord(const Expr *E, const LValue &This,
APValue &Result, EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isRecordType() &&
assert(E->isPRValue() && E->getType()->isRecordType() &&
"can't evaluate expression as a record rvalue");
return RecordExprEvaluator(Info, This, Result).Visit(E);
}
@ -10130,7 +10130,7 @@ public:
/// Evaluate an expression of record type as a temporary.
static bool EvaluateTemporary(const Expr *E, LValue &Result, EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isRecordType());
assert(E->isPRValue() && E->getType()->isRecordType());
return TemporaryExprEvaluator(Info, Result).Visit(E);
}
@ -10172,7 +10172,8 @@ namespace {
} // end anonymous namespace
static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) {
assert(E->isRValue() && E->getType()->isVectorType() &&"not a vector rvalue");
assert(E->isPRValue() && E->getType()->isVectorType() &&
"not a vector prvalue");
return VectorExprEvaluator(Info, Result).Visit(E);
}
@ -10418,7 +10419,8 @@ namespace {
static bool EvaluateArray(const Expr *E, const LValue &This,
APValue &Result, EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isArrayType() && "not an array rvalue");
assert(E->isPRValue() && E->getType()->isArrayType() &&
"not an array prvalue");
return ArrayExprEvaluator(Info, This, Result).Visit(E);
}
@ -10426,8 +10428,8 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This,
APValue &Result, const InitListExpr *ILE,
QualType AllocType) {
assert(!ILE->isValueDependent());
assert(ILE->isRValue() && ILE->getType()->isArrayType() &&
"not an array rvalue");
assert(ILE->isPRValue() && ILE->getType()->isArrayType() &&
"not an array prvalue");
return ArrayExprEvaluator(Info, This, Result)
.VisitInitListExpr(ILE, AllocType);
}
@ -10437,8 +10439,8 @@ static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This,
const CXXConstructExpr *CCE,
QualType AllocType) {
assert(!CCE->isValueDependent());
assert(CCE->isRValue() && CCE->getType()->isArrayType() &&
"not an array rvalue");
assert(CCE->isPRValue() && CCE->getType()->isArrayType() &&
"not an array prvalue");
return ArrayExprEvaluator(Info, This, Result)
.VisitCXXConstructExpr(CCE, This, &Result, AllocType);
}
@ -10815,7 +10817,7 @@ class FixedPointExprEvaluator
static bool EvaluateIntegerOrLValue(const Expr *E, APValue &Result,
EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isIntegralOrEnumerationType());
assert(E->isPRValue() && E->getType()->isIntegralOrEnumerationType());
return IntExprEvaluator(Info, Result).Visit(E);
}
@ -11184,7 +11186,7 @@ static QualType getObjectType(APValue::LValueBase B) {
///
/// Always returns an RValue with a pointer representation.
static const Expr *ignorePointerCastsAndParens(const Expr *E) {
assert(E->isRValue() && E->getType()->hasPointerRepresentation());
assert(E->isPRValue() && E->getType()->hasPointerRepresentation());
auto *NoParens = E->IgnoreParens();
auto *Cast = dyn_cast<CastExpr>(NoParens);
@ -11199,7 +11201,7 @@ static const Expr *ignorePointerCastsAndParens(const Expr *E) {
return NoParens;
auto *SubExpr = Cast->getSubExpr();
if (!SubExpr->getType()->hasPointerRepresentation() || !SubExpr->isRValue())
if (!SubExpr->getType()->hasPointerRepresentation() || !SubExpr->isPRValue())
return NoParens;
return ignorePointerCastsAndParens(SubExpr);
}
@ -12234,7 +12236,7 @@ public:
/// with integral or enumeration type.
static bool shouldEnqueue(const BinaryOperator *E) {
return E->getOpcode() == BO_Comma || E->isLogicalOp() ||
(E->isRValue() && E->getType()->isIntegralOrEnumerationType() &&
(E->isPRValue() && E->getType()->isIntegralOrEnumerationType() &&
E->getLHS()->getType()->isIntegralOrEnumerationType() &&
E->getRHS()->getType()->isIntegralOrEnumerationType());
}
@ -13593,7 +13595,7 @@ public:
static bool EvaluateFloat(const Expr* E, APFloat& Result, EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isRealFloatingType());
assert(E->isPRValue() && E->getType()->isRealFloatingType());
return FloatExprEvaluator(Info, Result).Visit(E);
}
@ -13846,7 +13848,7 @@ public:
static bool EvaluateComplex(const Expr *E, ComplexValue &Result,
EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isAnyComplexType());
assert(E->isPRValue() && E->getType()->isAnyComplexType());
return ComplexExprEvaluator(Info, Result).Visit(E);
}
@ -14374,7 +14376,7 @@ public:
static bool EvaluateAtomic(const Expr *E, const LValue *This, APValue &Result,
EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isAtomicType());
assert(E->isPRValue() && E->getType()->isAtomicType());
return AtomicExprEvaluator(Info, This, Result).Visit(E);
}
@ -14499,7 +14501,7 @@ bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {
static bool EvaluateVoid(const Expr *E, EvalInfo &Info) {
assert(!E->isValueDependent());
assert(E->isRValue() && E->getType()->isVoidType());
assert(E->isPRValue() && E->getType()->isVoidType());
return VoidExprEvaluator(Info).Visit(E);
}
@ -14599,7 +14601,7 @@ static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
if (!AllowNonLiteralTypes && !CheckLiteralType(Info, E, &This))
return false;
if (E->isRValue()) {
if (E->isPRValue()) {
// Evaluate arrays and record types in-place, so that later initializers can
// refer to earlier-initialized members of the object.
QualType T = E->getType();
@ -14669,8 +14671,8 @@ static bool FastEvaluateAsRValue(const Expr *Exp, Expr::EvalResult &Result,
// FIXME: Evaluating values of large array and record types can cause
// performance problems. Only do so in C++11 for now.
if (Exp->isRValue() && (Exp->getType()->isArrayType() ||
Exp->getType()->isRecordType()) &&
if (Exp->isPRValue() &&
(Exp->getType()->isArrayType() || Exp->getType()->isRecordType()) &&
!Ctx.getLangOpts().CPlusPlus11) {
IsConst = false;
return true;
@ -14893,7 +14895,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
// FIXME: Evaluating initializers for large array and record types can cause
// performance problems. Only do so in C++11 for now.
if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
if (isPRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
!Ctx.getLangOpts().CPlusPlus11)
return false;
@ -15183,7 +15185,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) {
// form "T x = { a };" is equivalent to "T x = a;".
// Unless we're initializing a reference, T is a scalar as it is known to be
// of integral or enumeration type.
if (E->isRValue())
if (E->isPRValue())
if (cast<InitListExpr>(E)->getNumInits() == 1)
return CheckICE(cast<InitListExpr>(E)->getInit(0), Ctx);
return ICEDiag(IK_NotICE, E->getBeginLoc());

View File

@ -27,7 +27,7 @@ using namespace clang;
ObjCArrayLiteral::ObjCArrayLiteral(ArrayRef<Expr *> Elements, QualType T,
ObjCMethodDecl *Method, SourceRange SR)
: Expr(ObjCArrayLiteralClass, T, VK_RValue, OK_Ordinary),
: Expr(ObjCArrayLiteralClass, T, VK_PRValue, OK_Ordinary),
NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method) {
Expr **SaveElements = getElements();
for (unsigned I = 0, N = Elements.size(); I != N; ++I)
@ -54,7 +54,7 @@ ObjCDictionaryLiteral::ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,
bool HasPackExpansions, QualType T,
ObjCMethodDecl *method,
SourceRange SR)
: Expr(ObjCDictionaryLiteralClass, T, VK_RValue, OK_Ordinary),
: Expr(ObjCDictionaryLiteralClass, T, VK_PRValue, OK_Ordinary),
NumElements(VK.size()), HasPackExpansions(HasPackExpansions), Range(SR),
DictWithObjectsMethod(method) {
KeyValuePair *KeyValues = getTrailingObjects<KeyValuePair>();
@ -281,7 +281,7 @@ QualType ObjCMessageExpr::getCallReturnType(ASTContext &Ctx) const {
return Ctx.getLValueReferenceType(QT);
case VK_XValue:
return Ctx.getRValueReferenceType(QT);
case VK_RValue:
case VK_PRValue:
return QT;
}
llvm_unreachable("Unsupported ExprValueKind");

View File

@ -59,7 +59,9 @@ void JSONNodeDumper::Visit(const Stmt *S) {
switch (E->getValueKind()) {
case VK_LValue: Category = "lvalue"; break;
case VK_XValue: Category = "xvalue"; break;
case VK_RValue: Category = "rvalue"; break;
case VK_PRValue:
Category = "prvalue";
break;
}
JOS.attribute("valueCategory", Category);
}

View File

@ -144,7 +144,7 @@ void TextNodeDumper::Visit(const Stmt *Node) {
{
ColorScope Color(OS, ShowColors, ValueKindColor);
switch (E->getValueKind()) {
case VK_RValue:
case VK_PRValue:
break;
case VK_LValue:
OS << " lvalue";

View File

@ -116,7 +116,7 @@ BinaryOperator *ASTMaker::makeAssignment(const Expr *LHS, const Expr *RHS,
QualType Ty) {
return BinaryOperator::Create(
C, const_cast<Expr *>(LHS), const_cast<Expr *>(RHS), BO_Assign, Ty,
VK_RValue, OK_Ordinary, SourceLocation(), FPOptionsOverride());
VK_PRValue, OK_Ordinary, SourceLocation(), FPOptionsOverride());
}
BinaryOperator *ASTMaker::makeComparison(const Expr *LHS, const Expr *RHS,
@ -125,7 +125,7 @@ BinaryOperator *ASTMaker::makeComparison(const Expr *LHS, const Expr *RHS,
BinaryOperator::isComparisonOp(Op));
return BinaryOperator::Create(
C, const_cast<Expr *>(LHS), const_cast<Expr *>(RHS), Op,
C.getLogicalOperationType(), VK_RValue, OK_Ordinary, SourceLocation(),
C.getLogicalOperationType(), VK_PRValue, OK_Ordinary, SourceLocation(),
FPOptionsOverride());
}
@ -169,7 +169,7 @@ ImplicitCastExpr *ASTMaker::makeImplicitCast(const Expr *Arg, QualType Ty,
/* CastKind=*/CK,
/* Expr=*/const_cast<Expr *>(Arg),
/* CXXCastPath=*/nullptr,
/* ExprValueKind=*/VK_RValue,
/* ExprValueKind=*/VK_PRValue,
/* FPFeatures */ FPOptionsOverride());
}
@ -264,7 +264,7 @@ static CallExpr *create_call_once_funcptr_call(ASTContext &C, ASTMaker M,
llvm_unreachable("Unexpected state");
}
return CallExpr::Create(C, SubExpr, CallArgs, C.VoidTy, VK_RValue,
return CallExpr::Create(C, SubExpr, CallArgs, C.VoidTy, VK_PRValue,
SourceLocation(), FPOptionsOverride());
}
@ -291,7 +291,7 @@ static CallExpr *create_call_once_lambda_call(ASTContext &C, ASTMaker M,
/*AstContext=*/C, OO_Call, callOperatorDeclRef,
/*Args=*/CallArgs,
/*QualType=*/C.VoidTy,
/*ExprValueType=*/VK_RValue,
/*ExprValueType=*/VK_PRValue,
/*SourceLocation=*/SourceLocation(),
/*FPFeatures=*/FPOptionsOverride());
}
@ -451,7 +451,7 @@ static Stmt *create_call_once(ASTContext &C, const FunctionDecl *D) {
CK_IntegralToBoolean),
/* opc=*/UO_LNot,
/* QualType=*/C.IntTy,
/* ExprValueKind=*/VK_RValue,
/* ExprValueKind=*/VK_PRValue,
/* ExprObjectKind=*/OK_Ordinary, SourceLocation(),
/* CanOverflow*/ false, FPOptionsOverride());
@ -513,13 +513,13 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) {
/*StmtClass=*/M.makeLvalueToRvalue(/*Expr=*/Block),
/*Args=*/None,
/*QualType=*/C.VoidTy,
/*ExprValueType=*/VK_RValue,
/*ExprValueType=*/VK_PRValue,
/*SourceLocation=*/SourceLocation(), FPOptionsOverride());
// (2) Create the assignment to the predicate.
Expr *DoneValue =
UnaryOperator::Create(C, M.makeIntegerLiteral(0, C.LongTy), UO_Not,
C.LongTy, VK_RValue, OK_Ordinary, SourceLocation(),
C.LongTy, VK_PRValue, OK_Ordinary, SourceLocation(),
/*CanOverflow*/ false, FPOptionsOverride());
BinaryOperator *B =
@ -580,7 +580,7 @@ static Stmt *create_dispatch_sync(ASTContext &C, const FunctionDecl *D) {
ASTMaker M(C);
DeclRefExpr *DR = M.makeDeclRefExpr(PV);
ImplicitCastExpr *ICE = M.makeLvalueToRvalue(DR, Ty);
CallExpr *CE = CallExpr::Create(C, ICE, None, C.VoidTy, VK_RValue,
CallExpr *CE = CallExpr::Create(C, ICE, None, C.VoidTy, VK_PRValue,
SourceLocation(), FPOptionsOverride());
return CE;
}

View File

@ -2170,7 +2170,7 @@ void BuildLockset::VisitDeclStmt(const DeclStmt *S) {
if (!CtorD || !CtorD->hasAttrs())
continue;
handleCall(E, CtorD, VD);
} else if (isa<CallExpr>(E) && E->isRValue()) {
} else if (isa<CallExpr>(E) && E->isPRValue()) {
// If the object is initialized by a function call that returns a
// scoped lockable by value, use the attributes on the copy or move
// constructor to figure out what effect that should have on the

View File

@ -1023,7 +1023,7 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo) {
type, VK_LValue, SourceLocation());
ImplicitCastExpr l2r(ImplicitCastExpr::OnStack, type, CK_LValueToRValue,
&declRef, VK_RValue, FPOptionsOverride());
&declRef, VK_PRValue, FPOptionsOverride());
// FIXME: Pass a specific location for the expr init so that the store is
// attributed to a reasonable location - otherwise it may be attributed to
// locations of subexpressions in the initialization.

View File

@ -200,7 +200,7 @@ llvm::Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) {
/// EmitIgnoredExpr - Emit code to compute the specified expression,
/// ignoring the result.
void CodeGenFunction::EmitIgnoredExpr(const Expr *E) {
if (E->isRValue())
if (E->isPRValue())
return (void) EmitAnyExpr(E, AggValueSlot::ignored(), true);
// Just emit it as an l-value and drop the result.
@ -5398,7 +5398,7 @@ static LValueOrRValue emitPseudoObjectExpr(CodeGenFunction &CGF,
// directly into the slot.
typedef CodeGenFunction::OpaqueValueMappingData OVMA;
OVMA opaqueData;
if (ov == resultExpr && ov->isRValue() && !forLValue &&
if (ov == resultExpr && ov->isPRValue() && !forLValue &&
CodeGenFunction::hasAggregateEvaluationKind(ov->getType())) {
CGF.EmitAggExpr(ov->getSourceExpr(), slot);
LValue LV = CGF.MakeAddrLValue(slot.getAddress(), ov->getType(),

View File

@ -1965,7 +1965,7 @@ bool CodeGenFunction::ShouldNullCheckClassCastValue(const CastExpr *CE) {
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(CE)) {
// And that glvalue casts are never null.
if (ICE->getValueKind() != VK_RValue)
if (ICE->getValueKind() != VK_PRValue)
return false;
}
@ -4854,7 +4854,7 @@ LValue CodeGenFunction::EmitObjCIsaExpr(const ObjCIsaExpr *E) {
Expr *BaseExpr = E->getBase();
Address Addr = Address::invalid();
if (BaseExpr->isRValue()) {
if (BaseExpr->isPRValue()) {
Addr = Address(EmitScalarExpr(BaseExpr), getPointerAlign());
} else {
Addr = EmitLValue(BaseExpr).getAddress(*this);

View File

@ -1522,7 +1522,7 @@ CodeGenFunction::generateObjCSetterBody(const ObjCImplementationDecl *classImpl,
DeclRefExpr self(getContext(), selfDecl, false, selfDecl->getType(),
VK_LValue, SourceLocation());
ImplicitCastExpr selfLoad(ImplicitCastExpr::OnStack, selfDecl->getType(),
CK_LValueToRValue, &self, VK_RValue,
CK_LValueToRValue, &self, VK_PRValue,
FPOptionsOverride());
ObjCIvarRefExpr ivarRef(ivar, ivar->getType().getNonReferenceType(),
SourceLocation(), SourceLocation(),
@ -1534,7 +1534,7 @@ CodeGenFunction::generateObjCSetterBody(const ObjCImplementationDecl *classImpl,
SourceLocation());
ImplicitCastExpr argLoad(ImplicitCastExpr::OnStack,
argType.getUnqualifiedType(), CK_LValueToRValue,
&arg, VK_RValue, FPOptionsOverride());
&arg, VK_PRValue, FPOptionsOverride());
// The property type can differ from the ivar type in some situations with
// Objective-C pointer types, we can always bit cast the RHS in these cases.
@ -1556,15 +1556,15 @@ CodeGenFunction::generateObjCSetterBody(const ObjCImplementationDecl *classImpl,
argCK = CK_BitCast;
}
ImplicitCastExpr argCast(ImplicitCastExpr::OnStack, ivarRef.getType(), argCK,
&argLoad, VK_RValue, FPOptionsOverride());
&argLoad, VK_PRValue, FPOptionsOverride());
Expr *finalArg = &argLoad;
if (!getContext().hasSameUnqualifiedType(ivarRef.getType(),
argLoad.getType()))
finalArg = &argCast;
BinaryOperator *assign = BinaryOperator::Create(
getContext(), &ivarRef, finalArg, BO_Assign, ivarRef.getType(), VK_RValue,
OK_Ordinary, SourceLocation(), FPOptionsOverride());
getContext(), &ivarRef, finalArg, BO_Assign, ivarRef.getType(),
VK_PRValue, OK_Ordinary, SourceLocation(), FPOptionsOverride());
EmitStmt(assign);
}
@ -3715,12 +3715,12 @@ CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(
StartFunction(FD, ReturnTy, Fn, FI, args);
DeclRefExpr DstExpr(C, &DstDecl, false, DestTy, VK_RValue, SourceLocation());
DeclRefExpr DstExpr(C, &DstDecl, false, DestTy, VK_PRValue, SourceLocation());
UnaryOperator *DST = UnaryOperator::Create(
C, &DstExpr, UO_Deref, DestTy->getPointeeType(), VK_LValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
DeclRefExpr SrcExpr(C, &SrcDecl, false, SrcTy, VK_RValue, SourceLocation());
DeclRefExpr SrcExpr(C, &SrcDecl, false, SrcTy, VK_PRValue, SourceLocation());
UnaryOperator *SRC = UnaryOperator::Create(
C, &SrcExpr, UO_Deref, SrcTy->getPointeeType(), VK_LValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
@ -3798,7 +3798,7 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(
StartFunction(FD, ReturnTy, Fn, FI, args);
DeclRefExpr SrcExpr(getContext(), &SrcDecl, false, SrcTy, VK_RValue,
DeclRefExpr SrcExpr(getContext(), &SrcDecl, false, SrcTy, VK_PRValue,
SourceLocation());
UnaryOperator *SRC = UnaryOperator::Create(
@ -3825,7 +3825,7 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(
CXXConstExpr->getConstructionKind(),
SourceRange());
DeclRefExpr DstExpr(getContext(), &DstDecl, false, DestTy, VK_RValue,
DeclRefExpr DstExpr(getContext(), &DstDecl, false, DestTy, VK_PRValue,
SourceLocation());
RValue DV = EmitAnyExpr(&DstExpr);

View File

@ -664,7 +664,7 @@ static void emitInitWithReductionInitializer(CodeGenFunction &CGF,
return;
}
}
OpaqueValueExpr OVE(DRD->getLocation(), Ty, VK_RValue);
OpaqueValueExpr OVE(DRD->getLocation(), Ty, VK_PRValue);
CodeGenFunction::OpaqueValueMapping OpaqueMap(CGF, &OVE, InitRVal);
CGF.EmitAnyExprToMem(&OVE, Private, Ty.getQualifiers(),
/*IsInitializer=*/false);
@ -4398,7 +4398,7 @@ CGOpenMPRuntime::emitTaskInit(CodeGenFunction &CGF, SourceLocation Loc,
OpaqueValueExpr OVE(
Loc,
C.getIntTypeForBitwidth(C.getTypeSize(C.getSizeType()), /*Signed=*/0),
VK_RValue);
VK_PRValue);
CodeGenFunction::OpaqueValueMapping OpaqueMap(CGF, &OVE,
RValue::get(NumOfElements));
KmpTaskAffinityInfoArrayTy =
@ -4892,7 +4892,7 @@ std::pair<llvm::Value *, Address> CGOpenMPRuntime::emitDependClause(
}
OpaqueValueExpr OVE(Loc,
C.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0),
VK_RValue);
VK_PRValue);
CodeGenFunction::OpaqueValueMapping OpaqueMap(CGF, &OVE,
RValue::get(NumOfElements));
KmpDependInfoArrayTy =

View File

@ -3673,11 +3673,11 @@ void CodeGenFunction::EmitSections(const OMPExecutableDirective &S) {
CodeGenFunction::OpaqueValueMapping OpaqueUB(CGF, &UBRefExpr, UB);
// Generate condition for loop.
BinaryOperator *Cond = BinaryOperator::Create(
C, &IVRefExpr, &UBRefExpr, BO_LE, C.BoolTy, VK_RValue, OK_Ordinary,
C, &IVRefExpr, &UBRefExpr, BO_LE, C.BoolTy, VK_PRValue, OK_Ordinary,
S.getBeginLoc(), FPOptionsOverride());
// Increment for loop counter.
UnaryOperator *Inc = UnaryOperator::Create(
C, &IVRefExpr, UO_PreInc, KmpInt32Ty, VK_RValue, OK_Ordinary,
C, &IVRefExpr, UO_PreInc, KmpInt32Ty, VK_PRValue, OK_Ordinary,
S.getBeginLoc(), true, FPOptionsOverride());
auto &&BodyGen = [CapturedStmt, CS, &S, &IV](CodeGenFunction &CGF) {
// Iterate through all sections and emit a switch construct:
@ -4571,7 +4571,7 @@ createImplicitFirstprivateForType(ASTContext &C, OMPTaskDataTy &Data,
PrivateVD->setInitStyle(VarDecl::CInit);
PrivateVD->setInit(ImplicitCastExpr::Create(C, ElemType, CK_LValueToRValue,
InitRef, /*BasePath=*/nullptr,
VK_RValue, FPOptionsOverride()));
VK_PRValue, FPOptionsOverride()));
Data.FirstprivateVars.emplace_back(OrigRef);
Data.FirstprivateCopies.emplace_back(PrivateRef);
Data.FirstprivateInits.emplace_back(InitRef);

View File

@ -585,7 +585,7 @@ namespace {
CStyleCastExpr* NoTypeInfoCStyleCastExpr(ASTContext *Ctx, QualType Ty,
CastKind Kind, Expr *E) {
TypeSourceInfo *TInfo = Ctx->getTrivialTypeSourceInfo(Ty, SourceLocation());
return CStyleCastExpr::Create(*Ctx, Ty, VK_RValue, Kind, E, nullptr,
return CStyleCastExpr::Create(*Ctx, Ty, VK_PRValue, Kind, E, nullptr,
FPOptionsOverride(), TInfo,
SourceLocation(), SourceLocation());
}
@ -2107,12 +2107,12 @@ RewriteModernObjC::SynthesizeCallToFunctionDecl(FunctionDecl *FD,
QualType pToFunc = Context->getPointerType(msgSendType);
ImplicitCastExpr *ICE =
ImplicitCastExpr::Create(*Context, pToFunc, CK_FunctionToPointerDecay,
DRE, nullptr, VK_RValue, FPOptionsOverride());
DRE, nullptr, VK_PRValue, FPOptionsOverride());
const auto *FT = msgSendType->castAs<FunctionType>();
CallExpr *Exp =
CallExpr::Create(*Context, ICE, Args, FT->getCallResultType(*Context),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
return Exp;
}
@ -2591,7 +2591,7 @@ Stmt *RewriteModernObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
DeclRefExpr(*Context, NewVD, false, strType, VK_LValue, SourceLocation());
Expr *Unop = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), DRE, UO_AddrOf,
Context->getPointerType(DRE->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(DRE->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
// cast to NSConstantString *
CastExpr *cast = NoTypeInfoCStyleCastExpr(Context, Exp->getType(),
@ -2694,7 +2694,7 @@ Stmt *RewriteModernObjC::RewriteObjCBoxedExpr(ObjCBoxedExpr *Exp) {
auto *FT = msgSendType->castAs<FunctionType>();
CallExpr *CE = CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
ReplaceStmt(Exp, CE);
return CE;
}
@ -2720,7 +2720,7 @@ Stmt *RewriteModernObjC::RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp) {
std::string NSArrayFName("__NSContainer_literal");
FunctionDecl *NSArrayFD = SynthBlockInitFunctionDecl(NSArrayFName);
DeclRefExpr *NSArrayDRE = new (Context) DeclRefExpr(
*Context, NSArrayFD, false, NSArrayFType, VK_RValue, SourceLocation());
*Context, NSArrayFD, false, NSArrayFType, VK_PRValue, SourceLocation());
SmallVector<Expr*, 16> InitExprs;
unsigned NumElements = Exp->getNumElements();
@ -2815,7 +2815,7 @@ Stmt *RewriteModernObjC::RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp) {
const FunctionType *FT = msgSendType->castAs<FunctionType>();
CallExpr *CE = CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
ReplaceStmt(Exp, CE);
return CE;
}
@ -2841,7 +2841,7 @@ Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral
std::string NSDictFName("__NSContainer_literal");
FunctionDecl *NSDictFD = SynthBlockInitFunctionDecl(NSDictFName);
DeclRefExpr *NSDictDRE = new (Context) DeclRefExpr(
*Context, NSDictFD, false, NSDictFType, VK_RValue, SourceLocation());
*Context, NSDictFD, false, NSDictFType, VK_PRValue, SourceLocation());
SmallVector<Expr*, 16> KeyExprs;
SmallVector<Expr*, 16> ValueExprs;
@ -2967,7 +2967,7 @@ Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral
const FunctionType *FT = msgSendType->castAs<FunctionType>();
CallExpr *CE = CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
ReplaceStmt(Exp, CE);
return CE;
}
@ -3177,7 +3177,7 @@ Expr *RewriteModernObjC::SynthMsgSendStretCallExpr(FunctionDecl *MsgSendStretFla
FunctionDecl::Create(*Context, TUDecl, SourceLocation(), SourceLocation(),
ID, FuncType, nullptr, SC_Extern, false, false);
DeclRefExpr *DRE = new (Context)
DeclRefExpr(*Context, FD, false, castType, VK_RValue, SourceLocation());
DeclRefExpr(*Context, FD, false, castType, VK_PRValue, SourceLocation());
CallExpr *STCE =
CallExpr::Create(*Context, DRE, MsgExprs, castType, VK_LValue,
SourceLocation(), FPOptionsOverride());
@ -3242,16 +3242,11 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
SmallVector<Expr*, 4> InitExprs;
// set the receiver to self, the first argument to all methods.
InitExprs.push_back(
NoTypeInfoCStyleCastExpr(Context, Context->getObjCIdType(),
CK_BitCast,
new (Context) DeclRefExpr(*Context,
CurMethodDef->getSelfDecl(),
false,
Context->getObjCIdType(),
VK_RValue,
SourceLocation()))
); // set the 'receiver'.
InitExprs.push_back(NoTypeInfoCStyleCastExpr(
Context, Context->getObjCIdType(), CK_BitCast,
new (Context) DeclRefExpr(*Context, CurMethodDef->getSelfDecl(), false,
Context->getObjCIdType(), VK_PRValue,
SourceLocation()))); // set the 'receiver'.
// (id)class_getSuperclass((Class)objc_getClass("CurrentClass"))
SmallVector<Expr*, 8> ClsExprs;
@ -3291,7 +3286,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
//
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
SuperRep = NoTypeInfoCStyleCastExpr(Context,
Context->getPointerType(superType),
@ -3309,7 +3304,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
// struct __rw_objc_super *
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
}
MsgExprs.push_back(SuperRep);
@ -3339,15 +3334,11 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
ObjCInterfaceDecl *ClassDecl = CurMethodDef->getClassInterface();
SmallVector<Expr*, 4> InitExprs;
InitExprs.push_back(
NoTypeInfoCStyleCastExpr(Context, Context->getObjCIdType(),
CK_BitCast,
new (Context) DeclRefExpr(*Context,
CurMethodDef->getSelfDecl(),
false,
Context->getObjCIdType(),
VK_RValue, SourceLocation()))
); // set the 'receiver'.
InitExprs.push_back(NoTypeInfoCStyleCastExpr(
Context, Context->getObjCIdType(), CK_BitCast,
new (Context) DeclRefExpr(*Context, CurMethodDef->getSelfDecl(), false,
Context->getObjCIdType(), VK_PRValue,
SourceLocation()))); // set the 'receiver'.
// (id)class_getSuperclass((Class)objc_getClass("CurrentClass"))
SmallVector<Expr*, 8> ClsExprs;
@ -3387,7 +3378,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
//
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
SuperRep = NoTypeInfoCStyleCastExpr(Context,
Context->getPointerType(superType),
@ -3399,9 +3390,8 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
SourceLocation());
TypeSourceInfo *superTInfo
= Context->getTrivialTypeSourceInfo(superType);
SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), superTInfo,
superType, VK_RValue, ILE,
false);
SuperRep = new (Context) CompoundLiteralExpr(
SourceLocation(), superTInfo, superType, VK_PRValue, ILE, false);
}
MsgExprs.push_back(SuperRep);
break;
@ -3543,7 +3533,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
const FunctionType *FT = msgSendType->castAs<FunctionType>();
CallExpr *CE = CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
Stmt *ReplacingStmt = CE;
if (MsgSendStretFlavor) {
// We have the method which returns a struct/union. Must also generate
@ -4580,11 +4570,9 @@ Stmt *RewriteModernObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp
Expr *RHSExp = CEXPR->getRHS();
Stmt *RHSStmt = SynthesizeBlockCall(Exp, RHSExp);
Expr *CONDExp = CEXPR->getCond();
ConditionalOperator *CondExpr =
new (Context) ConditionalOperator(CONDExp,
SourceLocation(), cast<Expr>(LHSStmt),
SourceLocation(), cast<Expr>(RHSStmt),
Exp->getType(), VK_RValue, OK_Ordinary);
ConditionalOperator *CondExpr = new (Context) ConditionalOperator(
CONDExp, SourceLocation(), cast<Expr>(LHSStmt), SourceLocation(),
cast<Expr>(RHSStmt), Exp->getType(), VK_PRValue, OK_Ordinary);
return CondExpr;
} else if (const ObjCIvarRefExpr *IRE = dyn_cast<ObjCIvarRefExpr>(BlockExp)) {
CPT = IRE->getType()->getAs<BlockPointerType>();
@ -4654,7 +4642,7 @@ Stmt *RewriteModernObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp
BlkExprs.push_back(*I);
}
CallExpr *CE =
CallExpr::Create(*Context, PE, BlkExprs, Exp->getType(), VK_RValue,
CallExpr::Create(*Context, PE, BlkExprs, Exp->getType(), VK_PRValue,
SourceLocation(), FPOptionsOverride());
return CE;
}
@ -5283,7 +5271,7 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
FD = SynthBlockInitFunctionDecl(Tag);
DeclRefExpr *DRE = new (Context)
DeclRefExpr(*Context, FD, false, FType, VK_RValue, SourceLocation());
DeclRefExpr(*Context, FD, false, FType, VK_PRValue, SourceLocation());
SmallVector<Expr*, 4> InitExprs;
@ -5305,7 +5293,7 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
const_cast<ASTContext &>(*Context),
new (Context) DeclRefExpr(*Context, NewVD, false, Context->VoidPtrTy,
VK_LValue, SourceLocation()),
UO_AddrOf, Context->getPointerType(Context->VoidPtrTy), VK_RValue,
UO_AddrOf, Context->getPointerType(Context->VoidPtrTy), VK_PRValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
InitExprs.push_back(DescRefExpr);
@ -5323,9 +5311,10 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (HasLocalVariableExternalStorage(*I)) {
QualType QT = (*I)->getType();
QT = Context->getPointerType(QT);
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf, QT, VK_RValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
Exp = UnaryOperator::Create(const_cast<ASTContext &>(*Context), Exp,
UO_AddrOf, QT, VK_PRValue, OK_Ordinary,
SourceLocation(), false,
FPOptionsOverride());
}
} else if (isTopLevelBlockPointerType((*I)->getType())) {
FD = SynthBlockInitFunctionDecl((*I)->getName());
@ -5340,9 +5329,10 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (HasLocalVariableExternalStorage(*I)) {
QualType QT = (*I)->getType();
QT = Context->getPointerType(QT);
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf, QT, VK_RValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
Exp = UnaryOperator::Create(const_cast<ASTContext &>(*Context), Exp,
UO_AddrOf, QT, VK_PRValue, OK_Ordinary,
SourceLocation(), false,
FPOptionsOverride());
}
}
@ -5382,7 +5372,7 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (!isNestedCapturedVar)
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf,
Context->getPointerType(Exp->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(Exp->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
Exp = NoTypeInfoCStyleCastExpr(Context, castT, CK_BitCast, Exp);
InitExprs.push_back(Exp);
@ -5409,7 +5399,7 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
NewRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), NewRep, UO_AddrOf,
Context->getPointerType(NewRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(NewRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
NewRep = NoTypeInfoCStyleCastExpr(Context, FType, CK_BitCast,
NewRep);
@ -7497,7 +7487,7 @@ Stmt *RewriteModernObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
VK_LValue, SourceLocation());
BinaryOperator *addExpr = BinaryOperator::Create(
*Context, castExpr, DRE, BO_Add,
Context->getPointerType(Context->CharTy), VK_RValue, OK_Ordinary,
Context->getPointerType(Context->CharTy), VK_PRValue, OK_Ordinary,
SourceLocation(), FPOptionsOverride());
// Don't forget the parens to enforce the proper binding.
ParenExpr *PE = new (Context) ParenExpr(SourceLocation(),

View File

@ -491,7 +491,7 @@ namespace {
CStyleCastExpr* NoTypeInfoCStyleCastExpr(ASTContext *Ctx, QualType Ty,
CastKind Kind, Expr *E) {
TypeSourceInfo *TInfo = Ctx->getTrivialTypeSourceInfo(Ty, SourceLocation());
return CStyleCastExpr::Create(*Ctx, Ty, VK_RValue, Kind, E, nullptr,
return CStyleCastExpr::Create(*Ctx, Ty, VK_PRValue, Kind, E, nullptr,
FPOptionsOverride(), TInfo,
SourceLocation(), SourceLocation());
}
@ -2024,13 +2024,13 @@ RewriteObjC::SynthesizeCallToFunctionDecl(FunctionDecl *FD,
QualType pToFunc = Context->getPointerType(msgSendType);
ImplicitCastExpr *ICE =
ImplicitCastExpr::Create(*Context, pToFunc, CK_FunctionToPointerDecay,
DRE, nullptr, VK_RValue, FPOptionsOverride());
DRE, nullptr, VK_PRValue, FPOptionsOverride());
const auto *FT = msgSendType->castAs<FunctionType>();
CallExpr *Exp =
CallExpr::Create(*Context, ICE, Args, FT->getCallResultType(*Context),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
return Exp;
}
@ -2518,7 +2518,7 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
DeclRefExpr(*Context, NewVD, false, strType, VK_LValue, SourceLocation());
Expr *Unop = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), DRE, UO_AddrOf,
Context->getPointerType(DRE->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(DRE->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
// cast to NSConstantString *
CastExpr *cast = NoTypeInfoCStyleCastExpr(Context, Exp->getType(),
@ -2617,7 +2617,7 @@ CallExpr *RewriteObjC::SynthMsgSendStretCallExpr(FunctionDecl *MsgSendStretFlavo
const auto *FT = msgSendType->castAs<FunctionType>();
CallExpr *STCE =
CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(), VK_RValue,
CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(), VK_PRValue,
SourceLocation(), FPOptionsOverride());
return STCE;
}
@ -2670,16 +2670,11 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
SmallVector<Expr*, 4> InitExprs;
// set the receiver to self, the first argument to all methods.
InitExprs.push_back(
NoTypeInfoCStyleCastExpr(Context, Context->getObjCIdType(),
CK_BitCast,
new (Context) DeclRefExpr(*Context,
CurMethodDef->getSelfDecl(),
false,
Context->getObjCIdType(),
VK_RValue,
SourceLocation()))
); // set the 'receiver'.
InitExprs.push_back(NoTypeInfoCStyleCastExpr(
Context, Context->getObjCIdType(), CK_BitCast,
new (Context) DeclRefExpr(*Context, CurMethodDef->getSelfDecl(), false,
Context->getObjCIdType(), VK_PRValue,
SourceLocation()))); // set the 'receiver'.
// (id)class_getSuperclass((Class)objc_getClass("CurrentClass"))
SmallVector<Expr*, 8> ClsExprs;
@ -2721,7 +2716,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
//
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
SuperRep = NoTypeInfoCStyleCastExpr(Context,
Context->getPointerType(superType),
@ -2739,7 +2734,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
// struct objc_super *
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
}
MsgExprs.push_back(SuperRep);
@ -2766,15 +2761,11 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
ObjCInterfaceDecl *ClassDecl = CurMethodDef->getClassInterface();
SmallVector<Expr*, 4> InitExprs;
InitExprs.push_back(
NoTypeInfoCStyleCastExpr(Context, Context->getObjCIdType(),
CK_BitCast,
new (Context) DeclRefExpr(*Context,
CurMethodDef->getSelfDecl(),
false,
Context->getObjCIdType(),
VK_RValue, SourceLocation()))
); // set the 'receiver'.
InitExprs.push_back(NoTypeInfoCStyleCastExpr(
Context, Context->getObjCIdType(), CK_BitCast,
new (Context) DeclRefExpr(*Context, CurMethodDef->getSelfDecl(), false,
Context->getObjCIdType(), VK_PRValue,
SourceLocation()))); // set the 'receiver'.
// (id)class_getSuperclass((Class)objc_getClass("CurrentClass"))
SmallVector<Expr*, 8> ClsExprs;
@ -2817,7 +2808,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
//
SuperRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), SuperRep, UO_AddrOf,
Context->getPointerType(SuperRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(SuperRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
SuperRep = NoTypeInfoCStyleCastExpr(Context,
Context->getPointerType(superType),
@ -2829,9 +2820,8 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
SourceLocation());
TypeSourceInfo *superTInfo
= Context->getTrivialTypeSourceInfo(superType);
SuperRep = new (Context) CompoundLiteralExpr(SourceLocation(), superTInfo,
superType, VK_RValue, ILE,
false);
SuperRep = new (Context) CompoundLiteralExpr(
SourceLocation(), superTInfo, superType, VK_PRValue, ILE, false);
}
MsgExprs.push_back(SuperRep);
break;
@ -2973,7 +2963,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
const auto *FT = msgSendType->castAs<FunctionType>();
CallExpr *CE = CallExpr::Create(*Context, PE, MsgExprs, FT->getReturnType(),
VK_RValue, EndLoc, FPOptionsOverride());
VK_PRValue, EndLoc, FPOptionsOverride());
Stmt *ReplacingStmt = CE;
if (MsgSendStretFlavor) {
// We have the method which returns a struct/union. Must also generate
@ -3003,14 +2993,12 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
Context->IntTy,
SourceLocation());
BinaryOperator *lessThanExpr = BinaryOperator::Create(
*Context, sizeofExpr, limit, BO_LE, Context->IntTy, VK_RValue,
*Context, sizeofExpr, limit, BO_LE, Context->IntTy, VK_PRValue,
OK_Ordinary, SourceLocation(), FPOptionsOverride());
// (sizeof(returnType) <= 8 ? objc_msgSend(...) : objc_msgSend_stret(...))
ConditionalOperator *CondExpr =
new (Context) ConditionalOperator(lessThanExpr,
SourceLocation(), CE,
SourceLocation(), STCE,
returnType, VK_RValue, OK_Ordinary);
ConditionalOperator *CondExpr = new (Context) ConditionalOperator(
lessThanExpr, SourceLocation(), CE, SourceLocation(), STCE, returnType,
VK_PRValue, OK_Ordinary);
ReplacingStmt = new (Context) ParenExpr(SourceLocation(), SourceLocation(),
CondExpr);
}
@ -3056,7 +3044,7 @@ Stmt *RewriteObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
*Context, VD, false, getProtocolType(), VK_LValue, SourceLocation());
Expr *DerefExpr = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), DRE, UO_AddrOf,
Context->getPointerType(DRE->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(DRE->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
CastExpr *castExpr = NoTypeInfoCStyleCastExpr(Context, DerefExpr->getType(),
CK_BitCast,
@ -3749,11 +3737,9 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
Expr *RHSExp = CEXPR->getRHS();
Stmt *RHSStmt = SynthesizeBlockCall(Exp, RHSExp);
Expr *CONDExp = CEXPR->getCond();
ConditionalOperator *CondExpr =
new (Context) ConditionalOperator(CONDExp,
SourceLocation(), cast<Expr>(LHSStmt),
SourceLocation(), cast<Expr>(RHSStmt),
Exp->getType(), VK_RValue, OK_Ordinary);
ConditionalOperator *CondExpr = new (Context) ConditionalOperator(
CONDExp, SourceLocation(), cast<Expr>(LHSStmt), SourceLocation(),
cast<Expr>(RHSStmt), Exp->getType(), VK_PRValue, OK_Ordinary);
return CondExpr;
} else if (const ObjCIvarRefExpr *IRE = dyn_cast<ObjCIvarRefExpr>(BlockExp)) {
CPT = IRE->getType()->getAs<BlockPointerType>();
@ -3823,7 +3809,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
BlkExprs.push_back(*I);
}
CallExpr *CE =
CallExpr::Create(*Context, PE, BlkExprs, Exp->getType(), VK_RValue,
CallExpr::Create(*Context, PE, BlkExprs, Exp->getType(), VK_PRValue,
SourceLocation(), FPOptionsOverride());
return CE;
}
@ -4422,7 +4408,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
// Simulate a constructor call...
FD = SynthBlockInitFunctionDecl(Tag);
DeclRefExpr *DRE = new (Context)
DeclRefExpr(*Context, FD, false, FType, VK_RValue, SourceLocation());
DeclRefExpr(*Context, FD, false, FType, VK_PRValue, SourceLocation());
SmallVector<Expr*, 4> InitExprs;
@ -4444,7 +4430,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
const_cast<ASTContext &>(*Context),
new (Context) DeclRefExpr(*Context, NewVD, false, Context->VoidPtrTy,
VK_LValue, SourceLocation()),
UO_AddrOf, Context->getPointerType(Context->VoidPtrTy), VK_RValue,
UO_AddrOf, Context->getPointerType(Context->VoidPtrTy), VK_PRValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
InitExprs.push_back(DescRefExpr);
@ -4462,9 +4448,10 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (HasLocalVariableExternalStorage(*I)) {
QualType QT = (*I)->getType();
QT = Context->getPointerType(QT);
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf, QT, VK_RValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
Exp = UnaryOperator::Create(const_cast<ASTContext &>(*Context), Exp,
UO_AddrOf, QT, VK_PRValue, OK_Ordinary,
SourceLocation(), false,
FPOptionsOverride());
}
} else if (isTopLevelBlockPointerType((*I)->getType())) {
FD = SynthBlockInitFunctionDecl((*I)->getName());
@ -4479,9 +4466,10 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (HasLocalVariableExternalStorage(*I)) {
QualType QT = (*I)->getType();
QT = Context->getPointerType(QT);
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf, QT, VK_RValue,
OK_Ordinary, SourceLocation(), false, FPOptionsOverride());
Exp = UnaryOperator::Create(const_cast<ASTContext &>(*Context), Exp,
UO_AddrOf, QT, VK_PRValue, OK_Ordinary,
SourceLocation(), false,
FPOptionsOverride());
}
}
InitExprs.push_back(Exp);
@ -4520,7 +4508,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
if (!isNestedCapturedVar)
Exp = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), Exp, UO_AddrOf,
Context->getPointerType(Exp->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(Exp->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
Exp = NoTypeInfoCStyleCastExpr(Context, castT, CK_BitCast, Exp);
InitExprs.push_back(Exp);
@ -4539,7 +4527,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
SourceLocation(), FPOptionsOverride());
NewRep = UnaryOperator::Create(
const_cast<ASTContext &>(*Context), NewRep, UO_AddrOf,
Context->getPointerType(NewRep->getType()), VK_RValue, OK_Ordinary,
Context->getPointerType(NewRep->getType()), VK_PRValue, OK_Ordinary,
SourceLocation(), false, FPOptionsOverride());
NewRep = NoTypeInfoCStyleCastExpr(Context, FType, CK_BitCast,
NewRep);

View File

@ -576,13 +576,14 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
const CXXCastPath *BasePath,
CheckedConversionKind CCK) {
#ifndef NDEBUG
if (VK == VK_RValue && !E->isRValue()) {
if (VK == VK_PRValue && !E->isPRValue()) {
switch (Kind) {
default:
llvm_unreachable(("can't implicitly cast lvalue to rvalue with this cast "
"kind: " +
std::string(CastExpr::getCastKindName(Kind)))
.c_str());
llvm_unreachable(
("can't implicitly cast glvalue to prvalue with this cast "
"kind: " +
std::string(CastExpr::getCastKindName(Kind)))
.c_str());
case CK_Dependent:
case CK_LValueToRValue:
case CK_ArrayToPointerDecay:
@ -592,8 +593,8 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
break;
}
}
assert((VK == VK_RValue || Kind == CK_Dependent || !E->isRValue()) &&
"can't cast rvalue to lvalue");
assert((VK == VK_PRValue || Kind == CK_Dependent || !E->isPRValue()) &&
"can't cast prvalue to glvalue");
#endif
diagnoseNullableToNonnullConversion(Ty, E->getType(), E->getBeginLoc());
@ -608,7 +609,7 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
// C++1z [conv.array]: The temporary materialization conversion is applied.
// We also use this to fuel C++ DR1213, which applies to C++11 onwards.
if (Kind == CK_ArrayToPointerDecay && getLangOpts().CPlusPlus &&
E->getValueKind() == VK_RValue) {
E->getValueKind() == VK_PRValue) {
// The temporary is an lvalue in C++98 and an xvalue otherwise.
ExprResult Materialized = CreateMaterializeTemporaryExpr(
E->getType(), E, !getLangOpts().CPlusPlus11);

View File

@ -747,7 +747,7 @@ static TryCastResult getCastAwayConstnessCastKind(CastAwayConstnessKind CACK,
void CastOperation::CheckDynamicCast() {
CheckNoDerefRAII NoderefCheck(*this);
if (ValueKind == VK_RValue)
if (ValueKind == VK_PRValue)
SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get());
else if (isPlaceholder())
SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get());
@ -815,7 +815,7 @@ void CastOperation::CheckDynamicCast() {
} else {
// If we're dynamic_casting from a prvalue to an rvalue reference, we need
// to materialize the prvalue before we bind the reference to it.
if (SrcExpr.get()->isRValue())
if (SrcExpr.get()->isPRValue())
SrcExpr = Self.CreateMaterializeTemporaryExpr(
SrcType, SrcExpr.get(), /*IsLValueReference*/ false);
SrcPointee = SrcType;
@ -914,7 +914,7 @@ void CastOperation::CheckDynamicCast() {
void CastOperation::CheckConstCast() {
CheckNoDerefRAII NoderefCheck(*this);
if (ValueKind == VK_RValue)
if (ValueKind == VK_PRValue)
SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get());
else if (isPlaceholder())
SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get());
@ -1126,7 +1126,7 @@ static bool checkCastFunctionType(Sema &Self, const ExprResult &SrcExpr,
/// like this:
/// char *bytes = reinterpret_cast\<char*\>(int_ptr);
void CastOperation::CheckReinterpretCast() {
if (ValueKind == VK_RValue && !isPlaceholder(BuiltinType::Overload))
if (ValueKind == VK_PRValue && !isPlaceholder(BuiltinType::Overload))
SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get());
else
checkNonOverloadPlaceholders();
@ -1198,7 +1198,7 @@ void CastOperation::CheckStaticCast() {
return;
}
if (ValueKind == VK_RValue && !DestType->isRecordType() &&
if (ValueKind == VK_PRValue && !DestType->isRecordType() &&
!isPlaceholder(BuiltinType::Overload)) {
SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get());
if (SrcExpr.isInvalid()) // if conversion failed, don't report another error
@ -1897,7 +1897,7 @@ static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr,
return TC_NotApplicable;
}
if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isRValue()) {
if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isPRValue()) {
if (!SrcType->isRecordType()) {
// Cannot const_cast non-class prvalue to rvalue reference type. But if
// this is C-style, static_cast can do this.
@ -2169,7 +2169,8 @@ static bool fixOverloadedReinterpretCastExpr(Sema &Self, QualType DestType,
// like it?
if (Self.ResolveAndFixSingleFunctionTemplateSpecialization(
Result,
Expr::getValueKindForType(DestType) == VK_RValue // Convert Fun to Ptr
Expr::getValueKindForType(DestType) ==
VK_PRValue // Convert Fun to Ptr
) &&
Result.isUsable())
return true;
@ -2659,7 +2660,7 @@ void CastOperation::CheckCXXCStyleCast(bool FunctionalStyle,
return;
}
if (ValueKind == VK_RValue && !DestType->isRecordType() &&
if (ValueKind == VK_PRValue && !DestType->isRecordType() &&
!isPlaceholder(BuiltinType::Overload)) {
SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get());
if (SrcExpr.isInvalid())
@ -3103,7 +3104,7 @@ void CastOperation::CheckBuiltinBitCast() {
return;
}
if (SrcExpr.get()->isRValue())
if (SrcExpr.get()->isPRValue())
SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(),
/*IsLValueReference=*/false);

View File

@ -6363,7 +6363,7 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
ExprResult Sema::SemaConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc) {
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
QualType DstTy = TInfo->getType();
QualType SrcTy = E->getType();

View File

@ -897,7 +897,7 @@ ExprResult Sema::BuildResolvedCoawaitExpr(SourceLocation Loc, Expr *E,
// If the expression is a temporary, materialize it as an lvalue so that we
// can use it multiple times.
if (E->getValueKind() == VK_RValue)
if (E->getValueKind() == VK_PRValue)
E = CreateMaterializeTemporaryExpr(E->getType(), E, true);
// The location of the `co_await` token cannot be used when constructing
@ -957,7 +957,7 @@ ExprResult Sema::BuildCoyieldExpr(SourceLocation Loc, Expr *E) {
// If the expression is a temporary, materialize it as an lvalue so that we
// can use it multiple times.
if (E->getValueKind() == VK_RValue)
if (E->getValueKind() == VK_PRValue)
E = CreateMaterializeTemporaryExpr(E->getType(), E, true);
// Build the await_ready, await_suspend, await_resume calls.

View File

@ -18407,7 +18407,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
!Context.hasSameType(NewTy, ECD->getInitExpr()->getType()))
ECD->setInitExpr(ImplicitCastExpr::Create(
Context, NewTy, CK_IntegralCast, ECD->getInitExpr(),
/*base paths*/ nullptr, VK_RValue, FPOptionsOverride()));
/*base paths*/ nullptr, VK_PRValue, FPOptionsOverride()));
if (getLangOpts().CPlusPlus)
// C++ [dcl.enum]p4: Following the closing brace of an
// enum-specifier, each enumerator has the type of its

View File

@ -3769,11 +3769,11 @@ void Sema::AddAnnotationAttr(Decl *D, const AttributeCommonInfo &CI,
E = ImplicitCastExpr::Create(Context,
Context.getPointerType(E->getType()),
clang::CK_FunctionToPointerDecay, E, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
if (E->isLValue())
E = ImplicitCastExpr::Create(Context, E->getType().getNonReferenceType(),
clang::CK_LValueToRValue, E, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
Expr::EvalResult Eval;
Notes.clear();

View File

@ -315,7 +315,7 @@ Sema::ActOnParamDefaultArgument(Decl *param, SourceLocation EqualLoc,
auto Fail = [&] {
Param->setInvalidDecl();
Param->setDefaultArg(new (Context) OpaqueValueExpr(
EqualLoc, Param->getType().getNonReferenceType(), VK_RValue));
EqualLoc, Param->getType().getNonReferenceType(), VK_PRValue));
};
// Default arguments are only permitted in C++
@ -380,10 +380,8 @@ void Sema::ActOnParamDefaultArgumentError(Decl *param,
ParmVarDecl *Param = cast<ParmVarDecl>(param);
Param->setInvalidDecl();
UnparsedDefaultArgLocs.erase(Param);
Param->setDefaultArg(new(Context)
OpaqueValueExpr(EqualLoc,
Param->getType().getNonReferenceType(),
VK_RValue));
Param->setDefaultArg(new (Context) OpaqueValueExpr(
EqualLoc, Param->getType().getNonReferenceType(), VK_PRValue));
}
/// CheckExtraCXXDefaultArguments - Check for any extra default
@ -8327,7 +8325,7 @@ private:
assert(!R->isUndeducedType() && "type should have been deduced already");
// Don't bother forming a no-op cast in the common case.
if (E->isRValue() && S.Context.hasSameType(E->getType(), R))
if (E->isPRValue() && S.Context.hasSameType(E->getType(), R))
return E;
return S.BuildCXXNamedCast(Loc, tok::kw_static_cast,
S.Context.getTrivialTypeSourceInfo(R, Loc), E,
@ -13823,11 +13821,11 @@ buildMemcpyForAssignmentOp(Sema &S, SourceLocation Loc, QualType T,
Expr *From = FromB.build(S, Loc);
From = UnaryOperator::Create(
S.Context, From, UO_AddrOf, S.Context.getPointerType(From->getType()),
VK_RValue, OK_Ordinary, Loc, false, S.CurFPFeatureOverrides());
VK_PRValue, OK_Ordinary, Loc, false, S.CurFPFeatureOverrides());
Expr *To = ToB.build(S, Loc);
To = UnaryOperator::Create(
S.Context, To, UO_AddrOf, S.Context.getPointerType(To->getType()),
VK_RValue, OK_Ordinary, Loc, false, S.CurFPFeatureOverrides());
VK_PRValue, OK_Ordinary, Loc, false, S.CurFPFeatureOverrides());
const Type *E = T->getBaseElementTypeUnsafe();
bool NeedsCollectableMemCpy =
@ -13849,7 +13847,7 @@ buildMemcpyForAssignmentOp(Sema &S, SourceLocation Loc, QualType T,
return StmtError();
ExprResult MemCpyRef = S.BuildDeclRefExpr(MemCpy, S.Context.BuiltinFnTy,
VK_RValue, Loc, nullptr);
VK_PRValue, Loc, nullptr);
assert(MemCpyRef.isUsable() && "Builtin reference cannot fail");
Expr *CallArgs[] = {
@ -14064,7 +14062,8 @@ buildSingleCopyAssignRecursively(Sema &S, SourceLocation Loc, QualType T,
Expr *Comparison = BinaryOperator::Create(
S.Context, IterationVarRefRVal.build(S, Loc),
IntegerLiteral::Create(S.Context, Upper, SizeType, Loc), BO_NE,
S.Context.BoolTy, VK_RValue, OK_Ordinary, Loc, S.CurFPFeatureOverrides());
S.Context.BoolTy, VK_PRValue, OK_Ordinary, Loc,
S.CurFPFeatureOverrides());
// Create the pre-increment of the iteration variable. We can determine
// whether the increment will overflow based on the value of the array
@ -15167,7 +15166,7 @@ void Sema::DefineImplicitLambdaToBlockPointerConversion(
if (!BuildBlock.isInvalid() && !getLangOpts().ObjCAutoRefCount)
BuildBlock = ImplicitCastExpr::Create(
Context, BuildBlock.get()->getType(), CK_CopyAndAutoreleaseBlockObject,
BuildBlock.get(), nullptr, VK_RValue, FPOptionsOverride());
BuildBlock.get(), nullptr, VK_PRValue, FPOptionsOverride());
if (BuildBlock.isInvalid()) {
Diag(CurrentLocation, diag::note_lambda_to_block_conv);

View File

@ -707,7 +707,7 @@ ExprResult Sema::DefaultLvalueConversion(Expr *E) {
// C++ [conv.lval]p3:
// If T is cv std::nullptr_t, the result is a null pointer constant.
CastKind CK = T->isNullPtrType() ? CK_NullToPointer : CK_LValueToRValue;
Res = ImplicitCastExpr::Create(Context, T, CK, E, nullptr, VK_RValue,
Res = ImplicitCastExpr::Create(Context, T, CK, E, nullptr, VK_PRValue,
CurFPFeatureOverrides());
// C11 6.3.2.1p2:
@ -716,7 +716,7 @@ ExprResult Sema::DefaultLvalueConversion(Expr *E) {
if (const AtomicType *Atomic = T->getAs<AtomicType>()) {
T = Atomic->getValueType().getUnqualifiedType();
Res = ImplicitCastExpr::Create(Context, T, CK_AtomicToNonAtomic, Res.get(),
nullptr, VK_RValue, FPOptionsOverride());
nullptr, VK_PRValue, FPOptionsOverride());
}
return Res;
@ -3249,7 +3249,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
QualType type = VD->getType();
if (type.isNull())
return ExprError();
ExprValueKind valueKind = VK_RValue;
ExprValueKind valueKind = VK_PRValue;
// In 'T ...V;', the type of the declaration 'V' is 'T...', but the type of
// a reference to 'V' is simply (unexpanded) 'T'. The type, like the value,
@ -3275,7 +3275,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
case Decl::UnresolvedUsingValue:
case Decl::OMPDeclareReduction:
case Decl::OMPDeclareMapper:
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
// Fields and indirect fields that got here must be for
@ -3316,7 +3316,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
// For non-references, we need to strip qualifiers just in case
// the template parameter was declared as 'const int' or whatever.
valueKind = VK_RValue;
valueKind = VK_PRValue;
type = type.getUnqualifiedType();
break;
}
@ -3330,7 +3330,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
if (!getLangOpts().CPlusPlus &&
!type.hasQualifiers() &&
type->isVoidType()) {
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
LLVM_FALLTHROUGH;
@ -3372,7 +3372,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
if (unsigned BID = cast<FunctionDecl>(VD)->getBuiltinID()) {
if (!Context.BuiltinInfo.isPredefinedLibFunction(BID)) {
type = Context.BuiltinFnTy;
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
}
@ -3383,7 +3383,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
// result type, make the entire expression __unknown_anytype.
if (fty->getReturnType() == Context.UnknownAnyTy) {
type = Context.UnknownAnyTy;
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
@ -3404,7 +3404,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
fty->getExtInfo());
// Functions are r-values in C.
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
@ -3427,7 +3427,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
= dyn_cast<FunctionProtoType>(VD->getType()))
if (proto->getReturnType() == Context.UnknownAnyTy) {
type = Context.UnknownAnyTy;
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
@ -3441,7 +3441,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
case Decl::CXXConversion:
case Decl::CXXDestructor:
case Decl::CXXConstructor:
valueKind = VK_RValue;
valueKind = VK_PRValue;
break;
}
@ -5541,14 +5541,14 @@ Sema::CreateBuiltinArraySubscriptExpr(Expr *Base, SourceLocation LLoc,
BaseExpr = LHSExp; // vectors: V[123]
IndexExpr = RHSExp;
// We apply C++ DR1213 to vector subscripting too.
if (getLangOpts().CPlusPlus11 && LHSExp->getValueKind() == VK_RValue) {
if (getLangOpts().CPlusPlus11 && LHSExp->getValueKind() == VK_PRValue) {
ExprResult Materialized = TemporaryMaterializationConversion(LHSExp);
if (Materialized.isInvalid())
return ExprError();
LHSExp = Materialized.get();
}
VK = LHSExp->getValueKind();
if (VK != VK_RValue)
if (VK != VK_PRValue)
OK = OK_VectorComponent;
ResultType = VTy->getElementType();
@ -5615,14 +5615,15 @@ Sema::CreateBuiltinArraySubscriptExpr(Expr *Base, SourceLocation LLoc,
// C forbids expressions of unqualified void type from being l-values.
// See IsCForbiddenLValueType.
if (!ResultType.hasQualifiers()) VK = VK_RValue;
if (!ResultType.hasQualifiers())
VK = VK_PRValue;
} else if (!ResultType->isDependentType() &&
RequireCompleteSizedType(
LLoc, ResultType,
diag::err_subscript_incomplete_or_sizeless_type, BaseExpr))
return ExprError();
assert(VK == VK_RValue || LangOpts.CPlusPlus ||
assert(VK == VK_PRValue || LangOpts.CPlusPlus ||
!ResultType.isCForbiddenLValueType());
if (LHSExp->IgnoreParenImpCasts()->getType()->isVariablyModifiedType() &&
@ -6429,7 +6430,7 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
}
return CallExpr::Create(Context, Fn, /*Args=*/{}, Context.VoidTy,
VK_RValue, RParenLoc, CurFPFeatureOverrides());
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
}
if (Fn->getType() == Context.PseudoObjectTy) {
ExprResult result = CheckPlaceholderExpr(Fn);
@ -6441,9 +6442,10 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
// in which case we won't do any semantic analysis now.
if (Fn->isTypeDependent() || Expr::hasAnyTypeDependentArguments(ArgExprs)) {
if (ExecConfig) {
return CUDAKernelCallExpr::Create(
Context, Fn, cast<CallExpr>(ExecConfig), ArgExprs,
Context.DependentTy, VK_RValue, RParenLoc, CurFPFeatureOverrides());
return CUDAKernelCallExpr::Create(Context, Fn,
cast<CallExpr>(ExecConfig), ArgExprs,
Context.DependentTy, VK_PRValue,
RParenLoc, CurFPFeatureOverrides());
} else {
tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(
@ -6451,7 +6453,7 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
Fn->getBeginLoc());
return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
VK_RValue, RParenLoc, CurFPFeatureOverrides());
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
}
}
@ -6480,7 +6482,7 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
if (!find.HasFormOfMemberPointer) {
if (Expr::hasAnyTypeDependentArguments(ArgExprs))
return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
VK_RValue, RParenLoc, CurFPFeatureOverrides());
VK_PRValue, RParenLoc, CurFPFeatureOverrides());
OverloadExpr *ovl = find.Expression;
if (UnresolvedLookupExpr *ULE = dyn_cast<UnresolvedLookupExpr>(ovl))
return BuildOverloadedCallExpr(
@ -6571,7 +6573,7 @@ ExprResult Sema::ActOnAsTypeExpr(Expr *E, ParsedType ParsedDestTy,
ExprResult Sema::BuildAsTypeExpr(Expr *E, QualType DestTy,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc) {
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
QualType SrcTy = E->getType();
if (!SrcTy->isDependentType() &&
@ -6703,11 +6705,11 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
assert(UsesADL == ADLCallKind::NotADL &&
"CUDAKernelCallExpr should not use ADL");
TheCall = CUDAKernelCallExpr::Create(Context, Fn, cast<CallExpr>(Config),
Args, ResultTy, VK_RValue, RParenLoc,
Args, ResultTy, VK_PRValue, RParenLoc,
CurFPFeatureOverrides(), NumParams);
} else {
TheCall =
CallExpr::Create(Context, Fn, Args, ResultTy, VK_RValue, RParenLoc,
CallExpr::Create(Context, Fn, Args, ResultTy, VK_PRValue, RParenLoc,
CurFPFeatureOverrides(), NumParams, UsesADL);
}
@ -6734,11 +6736,11 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
if (CorrectedTypos && Args.size() < NumParams) {
if (Config)
TheCall = CUDAKernelCallExpr::Create(
Context, Fn, cast<CallExpr>(Config), Args, ResultTy, VK_RValue,
Context, Fn, cast<CallExpr>(Config), Args, ResultTy, VK_PRValue,
RParenLoc, CurFPFeatureOverrides(), NumParams);
else
TheCall =
CallExpr::Create(Context, Fn, Args, ResultTy, VK_RValue, RParenLoc,
CallExpr::Create(Context, Fn, Args, ResultTy, VK_PRValue, RParenLoc,
CurFPFeatureOverrides(), NumParams, UsesADL);
}
// We can now handle the nulled arguments for the default arguments.
@ -6947,7 +6949,7 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo,
// obviously have a value kind derived from the kind of reference involved.
ExprValueKind VK =
(getLangOpts().CPlusPlus && !(isFileScope && literalType->isArrayType()))
? VK_RValue
? VK_PRValue
: VK_LValue;
if (isFileScope)
@ -7098,14 +7100,14 @@ Sema::BuildInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList,
/// Do an explicit extend of the given block pointer if we're in ARC.
void Sema::maybeExtendBlockObject(ExprResult &E) {
assert(E.get()->getType()->isBlockPointerType());
assert(E.get()->isRValue());
assert(E.get()->isPRValue());
// Only do this in an r-value context.
if (!getLangOpts().ObjCAutoRefCount) return;
E = ImplicitCastExpr::Create(
Context, E.get()->getType(), CK_ARCExtendBlockObject, E.get(),
/*base path*/ nullptr, VK_RValue, FPOptionsOverride());
/*base path*/ nullptr, VK_PRValue, FPOptionsOverride());
Cleanup.setExprNeedsCleanups(true);
}
@ -8261,7 +8263,7 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
if (getLangOpts().CPlusPlus)
return CXXCheckConditionalOperands(Cond, LHS, RHS, VK, OK, QuestionLoc);
VK = VK_RValue;
VK = VK_PRValue;
OK = OK_Ordinary;
if (Context.isDependenceAllowed() &&
@ -8799,8 +8801,8 @@ ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
// If the common expression is a class or array prvalue, materialize it
// so that we can safely refer to it multiple times.
if (commonExpr->isRValue() && (commonExpr->getType()->isRecordType() ||
commonExpr->getType()->isArrayType())) {
if (commonExpr->isPRValue() && (commonExpr->getType()->isRecordType() ||
commonExpr->getType()->isArrayType())) {
ExprResult MatExpr = TemporaryMaterializationConversion(commonExpr);
if (MatExpr.isInvalid())
return ExprError();
@ -8816,7 +8818,7 @@ ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
}
QualType LHSTy = LHSExpr->getType(), RHSTy = RHSExpr->getType();
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
ExprResult Cond = CondExpr, LHS = LHSExpr, RHS = RHSExpr;
QualType result = CheckConditionalOperands(Cond, LHS, RHS,
@ -9100,7 +9102,7 @@ Sema::CheckAssignmentConstraints(SourceLocation Loc,
// cast operations are required, so if CheckAssignmentConstraints
// adds casts to this they'll be wasted, but fortunately that doesn't
// usually happen on valid code.
OpaqueValueExpr RHSExpr(Loc, RHSType, VK_RValue);
OpaqueValueExpr RHSExpr(Loc, RHSType, VK_PRValue);
ExprResult RHSPtr = &RHSExpr;
CastKind K;
@ -9469,7 +9471,7 @@ static void ConstructTransparentUnion(Sema &S, ASTContext &C,
// union type from this initializer list.
TypeSourceInfo *unionTInfo = C.getTrivialTypeSourceInfo(UnionType);
EResult = new (C) CompoundLiteralExpr(SourceLocation(), unionTInfo, UnionType,
VK_RValue, Initializer, false);
VK_PRValue, Initializer, false);
}
Sema::AssignConvertType
@ -9608,7 +9610,7 @@ Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &CallerRHS,
CheckPointerConversion(RHS.get(), LHSType, Kind, Path,
/*IgnoreBaseAccess=*/false, Diagnose);
if (ConvertRHS)
RHS = ImpCastExprToType(RHS.get(), LHSType, Kind, VK_RValue, &Path);
RHS = ImpCastExprToType(RHS.get(), LHSType, Kind, VK_PRValue, &Path);
}
return Compatible;
}
@ -13354,7 +13356,7 @@ static QualType CheckIncrementDecrementOperand(Sema &S, Expr *Op,
OK = Op->getObjectKind();
return ResType;
} else {
VK = VK_RValue;
VK = VK_PRValue;
return ResType.getUnqualifiedType();
}
}
@ -13741,7 +13743,7 @@ static QualType CheckIndirectionOperand(Sema &S, Expr *Op, ExprValueKind &VK,
// ...except that certain expressions are never l-values in C.
if (!S.getLangOpts().CPlusPlus && Result.isCForbiddenLValueType())
VK = VK_RValue;
VK = VK_PRValue;
return Result;
}
@ -14010,7 +14012,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
// The following two variables are used for compound assignment operators
QualType CompLHSTy; // Type of LHS after promotions for computation
QualType CompResultTy; // Type of computation result
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
bool ConvertHalfVec = false;
@ -14629,7 +14631,7 @@ ExprResult Sema::BuildBinOp(Scope *S, SourceLocation OpLoc,
// assignment, but is not an lvalue.
return CompoundAssignOperator::Create(
Context, LHSExpr, RHSExpr, Opc,
LHSExpr->getType().getUnqualifiedType(), VK_RValue, OK_Ordinary,
LHSExpr->getType().getUnqualifiedType(), VK_PRValue, OK_Ordinary,
OpLoc, CurFPFeatureOverrides());
QualType ResultType;
switch (Opc) {
@ -14655,7 +14657,7 @@ ExprResult Sema::BuildBinOp(Scope *S, SourceLocation OpLoc,
break;
}
return BinaryOperator::Create(Context, LHSExpr, RHSExpr, Opc, ResultType,
VK_RValue, OK_Ordinary, OpLoc,
VK_PRValue, OK_Ordinary, OpLoc,
CurFPFeatureOverrides());
}
@ -14677,7 +14679,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
UnaryOperatorKind Opc,
Expr *InputExpr) {
ExprResult Input = InputExpr;
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
QualType resultType;
bool CanOverflow = false;
@ -14850,7 +14852,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
// complex l-values to ordinary l-values and all other values to r-values.
if (Input.isInvalid()) return ExprError();
if (Opc == UO_Real || Input.get()->getType()->isAnyComplexType()) {
if (Input.get()->getValueKind() != VK_RValue &&
if (Input.get()->getValueKind() != VK_PRValue &&
Input.get()->getObjectKind() == OK_Ordinary)
VK = Input.get()->getValueKind();
} else if (!getLangOpts().CPlusPlus) {
@ -15269,7 +15271,7 @@ ExprResult Sema::ActOnChooseExpr(SourceLocation BuiltinLoc,
SourceLocation RPLoc) {
assert((CondExpr && LHSExpr && RHSExpr) && "Missing type argument(s)");
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
ExprObjectKind OK = OK_Ordinary;
QualType resType;
bool CondIsTrue = false;
@ -19047,7 +19049,7 @@ namespace {
Expr *SubExpr = SubResult.get();
E->setSubExpr(SubExpr);
E->setType(S.Context.getPointerType(SubExpr->getType()));
assert(E->getValueKind() == VK_RValue);
assert(E->getValueKind() == VK_PRValue);
assert(E->getObjectKind() == OK_Ordinary);
return E;
}
@ -19057,7 +19059,7 @@ namespace {
E->setType(VD->getType());
assert(E->getValueKind() == VK_RValue);
assert(E->getValueKind() == VK_PRValue);
if (S.getLangOpts().CPlusPlus &&
!(isa<CXXMethodDecl>(VD) &&
cast<CXXMethodDecl>(VD)->isInstance()))
@ -19148,7 +19150,7 @@ namespace {
return ExprError();
}
assert(E->getValueKind() == VK_RValue);
assert(E->getValueKind() == VK_PRValue);
assert(E->getObjectKind() == OK_Ordinary);
E->setType(DestType);
@ -19308,7 +19310,7 @@ ExprResult RebuildUnknownAnyExpr::VisitObjCMessageExpr(ObjCMessageExpr *E) {
ExprResult RebuildUnknownAnyExpr::VisitImplicitCastExpr(ImplicitCastExpr *E) {
// The only case we should ever see here is a function-to-pointer decay.
if (E->getCastKind() == CK_FunctionToPointerDecay) {
assert(E->getValueKind() == VK_RValue);
assert(E->getValueKind() == VK_PRValue);
assert(E->getObjectKind() == OK_Ordinary);
E->setType(DestType);
@ -19322,7 +19324,7 @@ ExprResult RebuildUnknownAnyExpr::VisitImplicitCastExpr(ImplicitCastExpr *E) {
E->setSubExpr(Result.get());
return E;
} else if (E->getCastKind() == CK_LValueToRValue) {
assert(E->getValueKind() == VK_RValue);
assert(E->getValueKind() == VK_PRValue);
assert(E->getObjectKind() == OK_Ordinary);
assert(isa<BlockPointerType>(E->getType()));
@ -19354,8 +19356,8 @@ ExprResult RebuildUnknownAnyExpr::resolveDecl(Expr *E, ValueDecl *VD) {
DestType = Ptr->getPointeeType();
ExprResult Result = resolveDecl(E, VD);
if (Result.isInvalid()) return ExprError();
return S.ImpCastExprToType(Result.get(), Type,
CK_FunctionToPointerDecay, VK_RValue);
return S.ImpCastExprToType(Result.get(), Type, CK_FunctionToPointerDecay,
VK_PRValue);
}
if (!Type->isFunctionType()) {
@ -19397,13 +19399,13 @@ ExprResult RebuildUnknownAnyExpr::resolveDecl(Expr *E, ValueDecl *VD) {
if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD))
if (MD->isInstance()) {
ValueKind = VK_RValue;
ValueKind = VK_PRValue;
Type = S.Context.BoundMemberTy;
}
// Function references aren't l-values in C.
if (!S.getLangOpts().CPlusPlus)
ValueKind = VK_RValue;
ValueKind = VK_PRValue;
// - variables
} else if (isa<VarDecl>(VD)) {
@ -19602,7 +19604,7 @@ ExprResult Sema::CheckPlaceholderExpr(Expr *E) {
CK_BuiltinFnToFnPtr)
.get();
return CallExpr::Create(Context, E, /*Args=*/{}, Context.IntTy,
VK_RValue, SourceLocation(),
VK_PRValue, SourceLocation(),
FPOptionsOverride());
}
}

View File

@ -2238,7 +2238,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
SizeTy, SourceLocation());
// Otherwise, if we failed to constant-fold the allocation size, we'll
// just give up and pass-in something opaque, that isn't a null pointer.
OpaqueValueExpr OpaqueAllocationSize(SourceLocation(), SizeTy, VK_RValue,
OpaqueValueExpr OpaqueAllocationSize(SourceLocation(), SizeTy, VK_PRValue,
OK_Ordinary, /*SourceExpr=*/nullptr);
// Let's synthesize the alignment argument in case we will need it.
@ -2254,7 +2254,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
SizeTy, SourceLocation());
ImplicitCastExpr DesiredAlignment(ImplicitCastExpr::OnStack, AlignValT,
CK_IntegralCast, &AlignmentLiteral,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
// Adjust placement args by prepending conjured size and alignment exprs.
llvm::SmallVector<Expr *, 8> CallArgs;
@ -4188,7 +4188,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
if (const AtomicType *FromAtomic = FromType->getAs<AtomicType>()) {
FromType = FromAtomic->getValueType().getUnqualifiedType();
From = ImplicitCastExpr::Create(Context, FromType, CK_AtomicToNonAtomic,
From, /*BasePath=*/nullptr, VK_RValue,
From, /*BasePath=*/nullptr, VK_PRValue,
FPOptionsOverride());
}
break;
@ -4206,14 +4206,16 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
case ICK_Array_To_Pointer:
FromType = Context.getArrayDecayedType(FromType);
From = ImpCastExprToType(From, FromType, CK_ArrayToPointerDecay,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, FromType, CK_ArrayToPointerDecay, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_Function_To_Pointer:
FromType = Context.getPointerType(FromType);
From = ImpCastExprToType(From, FromType, CK_FunctionToPointerDecay,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
VK_PRValue, /*BasePath=*/nullptr, CCK)
.get();
break;
default:
@ -4255,18 +4257,21 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
assert(FromType->castAs<EnumType>()->getDecl()->isFixed() &&
SCS.Second == ICK_Integral_Promotion &&
"only enums with fixed underlying type can promote to bool");
From = ImpCastExprToType(From, ToType, CK_IntegralToBoolean,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_IntegralToBoolean, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
} else {
From = ImpCastExprToType(From, ToType, CK_IntegralCast,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_IntegralCast, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
}
break;
case ICK_Floating_Promotion:
case ICK_Floating_Conversion:
From = ImpCastExprToType(From, ToType, CK_FloatingCast,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_FloatingCast, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_Complex_Promotion:
@ -4284,18 +4289,21 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
} else {
CK = CK_IntegralComplexCast;
}
From = ImpCastExprToType(From, ToType, CK,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK, VK_PRValue, /*BasePath=*/nullptr,
CCK)
.get();
break;
}
case ICK_Floating_Integral:
if (ToType->isRealFloatingType())
From = ImpCastExprToType(From, ToType, CK_IntegralToFloating,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_IntegralToFloating, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
else
From = ImpCastExprToType(From, ToType, CK_FloatingToIntegral,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_FloatingToIntegral, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_Compatible_Conversion:
@ -4363,8 +4371,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
}
if (getLangOpts().allowsNonTrivialObjCLifetimeQualifiers())
CheckObjCConversion(SourceRange(), NewToType, From, CCK);
From = ImpCastExprToType(From, NewToType, Kind, VK_RValue, &BasePath, CCK)
.get();
From = ImpCastExprToType(From, NewToType, Kind, VK_PRValue, &BasePath, CCK)
.get();
break;
}
@ -4383,8 +4391,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
(void)isCompleteType(From->getExprLoc(), ToType);
}
From = ImpCastExprToType(From, ToType, Kind, VK_RValue, &BasePath, CCK)
.get();
From =
ImpCastExprToType(From, ToType, Kind, VK_PRValue, &BasePath, CCK).get();
break;
}
@ -4396,8 +4404,9 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
}
From = ImpCastExprToType(From, Context.BoolTy,
ScalarTypeToBooleanCastKind(FromType),
VK_RValue, /*BasePath=*/nullptr, CCK).get();
ScalarTypeToBooleanCastKind(FromType), VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_Derived_To_Base: {
@ -4414,12 +4423,13 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
}
case ICK_Vector_Conversion:
From = ImpCastExprToType(From, ToType, CK_BitCast,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_BitCast, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_SVE_Vector_Conversion:
From = ImpCastExprToType(From, ToType, CK_BitCast, VK_RValue,
From = ImpCastExprToType(From, ToType, CK_BitCast, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
@ -4427,8 +4437,9 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
case ICK_Vector_Splat: {
// Vector splat from any arithmetic type to a vector.
Expr *Elem = prepareVectorSplat(ToType, From).get();
From = ImpCastExprToType(Elem, ToType, CK_VectorSplat, VK_RValue,
/*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(Elem, ToType, CK_VectorSplat, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
}
@ -4462,22 +4473,27 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
// _Complex x -> x
From = ImpCastExprToType(From, ElType,
isFloatingComplex ? CK_FloatingComplexToReal
: CK_IntegralComplexToReal,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
isFloatingComplex ? CK_FloatingComplexToReal
: CK_IntegralComplexToReal,
VK_PRValue, /*BasePath=*/nullptr, CCK)
.get();
// x -> y
if (Context.hasSameUnqualifiedType(ElType, ToType)) {
// do nothing
} else if (ToType->isRealFloatingType()) {
From = ImpCastExprToType(From, ToType,
isFloatingComplex ? CK_FloatingCast : CK_IntegralToFloating,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
isFloatingComplex ? CK_FloatingCast
: CK_IntegralToFloating,
VK_PRValue, /*BasePath=*/nullptr, CCK)
.get();
} else {
assert(ToType->isIntegerType());
From = ImpCastExprToType(From, ToType,
isFloatingComplex ? CK_FloatingToIntegral : CK_IntegralCast,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
isFloatingComplex ? CK_FloatingToIntegral
: CK_IntegralCast,
VK_PRValue, /*BasePath=*/nullptr, CCK)
.get();
}
}
break;
@ -4492,7 +4508,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
CastKind Kind =
AddrSpaceL != AddrSpaceR ? CK_AddressSpaceConversion : CK_BitCast;
From = ImpCastExprToType(From, ToType.getUnqualifiedType(), Kind,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
VK_PRValue, /*BasePath=*/nullptr, CCK)
.get();
break;
}
@ -4538,8 +4555,9 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
if (CheckExceptionSpecCompatibility(From, ToType))
return ExprError();
From = ImpCastExprToType(From, ToType, CK_NoOp,
VK_RValue, /*BasePath=*/nullptr, CCK).get();
From = ImpCastExprToType(From, ToType, CK_NoOp, VK_PRValue,
/*BasePath=*/nullptr, CCK)
.get();
break;
case ICK_Qualification: {
@ -4582,13 +4600,14 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
assert(Context.hasSameType(
ToAtomicType->castAs<AtomicType>()->getValueType(), From->getType()));
From = ImpCastExprToType(From, ToAtomicType, CK_NonAtomicToAtomic,
VK_RValue, nullptr, CCK).get();
VK_PRValue, nullptr, CCK)
.get();
}
// Materialize a temporary if we're implicitly converting to a reference
// type. This is not required by the C++ rules but is necessary to maintain
// AST invariants.
if (ToType->isReferenceType() && From->isRValue()) {
if (ToType->isReferenceType() && From->isPRValue()) {
ExprResult Res = TemporaryMaterializationConversion(From);
if (Res.isInvalid())
return ExprError();
@ -5641,7 +5660,8 @@ ExprResult Sema::ActOnExpressionTrait(ExpressionTrait ET,
static bool EvaluateExpressionTrait(ExpressionTrait ET, Expr *E) {
switch (ET) {
case ET_IsLValueExpr: return E->isLValue();
case ET_IsRValueExpr: return E->isRValue();
case ET_IsRValueExpr:
return E->isPRValue();
}
llvm_unreachable("Expression trait not covered by switch");
}
@ -5676,7 +5696,7 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,
// temporary materialization conversion otherwise.
if (isIndirect)
LHS = DefaultLvalueConversion(LHS.get());
else if (LHS.get()->isRValue())
else if (LHS.get()->isPRValue())
LHS = TemporaryMaterializationConversion(LHS.get());
if (LHS.isInvalid())
return QualType();
@ -5746,7 +5766,7 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,
QualType UseType = Context.getQualifiedType(Class, LHSType.getQualifiers());
if (isIndirect)
UseType = Context.getPointerType(UseType);
ExprValueKind VK = isIndirect ? VK_RValue : LHS.get()->getValueKind();
ExprValueKind VK = isIndirect ? VK_PRValue : LHS.get()->getValueKind();
LHS = ImpCastExprToType(LHS.get(), UseType, CK_DerivedToBase, VK,
&BasePath);
}
@ -5808,7 +5828,7 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,
// result of an ->* expression is an lvalue if its second operand
// is a pointer to data member and a prvalue otherwise.
if (Result->isFunctionType()) {
VK = VK_RValue;
VK = VK_PRValue;
return Context.BoundMemberTy;
} else if (isIndirect) {
VK = VK_LValue;
@ -6121,7 +6141,7 @@ QualType Sema::CXXCheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
// pointers.
// Assume r-value.
VK = VK_RValue;
VK = VK_PRValue;
OK = OK_Ordinary;
bool IsVectorConditional =
isValidVectorForConditionalCondition(Context, Cond.get()->getType());
@ -6246,8 +6266,7 @@ QualType Sema::CXXCheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
// that instead?
ExprValueKind LVK = LHS.get()->getValueKind();
ExprValueKind RVK = RHS.get()->getValueKind();
if (!Context.hasSameType(LTy, RTy) &&
LVK == RVK && LVK != VK_RValue) {
if (!Context.hasSameType(LTy, RTy) && LVK == RVK && LVK != VK_PRValue) {
// DerivedToBase was already handled by the class-specific case above.
// FIXME: Should we allow ObjC conversions here?
const ReferenceConversions AllowedConversions =
@ -6282,7 +6301,7 @@ QualType Sema::CXXCheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
// We only extend this to bitfields, not to the crazy other kinds of
// l-values.
bool Same = Context.hasSameType(LTy, RTy);
if (Same && LVK == RVK && LVK != VK_RValue &&
if (Same && LVK == RVK && LVK != VK_PRValue &&
LHS.get()->isOrdinaryOrBitFieldObject() &&
RHS.get()->isOrdinaryOrBitFieldObject()) {
VK = LHS.get()->getValueKind();
@ -6853,7 +6872,7 @@ ExprResult Sema::MaybeBindToTemporary(Expr *E) {
assert(!isa<CXXBindTemporaryExpr>(E) && "Double-bound temporary?");
// If the result is a glvalue, we shouldn't bind it.
if (!E->isRValue())
if (!E->isPRValue())
return E;
// In ARC, calls that return a retainable type can return retained,
@ -6945,7 +6964,7 @@ ExprResult Sema::MaybeBindToTemporary(Expr *E) {
CastKind ck = (ReturnsRetained ? CK_ARCConsumeObject
: CK_ARCReclaimReturnedObject);
return ImplicitCastExpr::Create(Context, E->getType(), ck, E, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
}
if (E->getType().isDestructedType() == QualType::DK_nontrivial_c_struct)
@ -7738,7 +7757,7 @@ ExprResult Sema::BuildCXXMemberCallExpr(Expr *E, NamedDecl *FoundDecl,
NestedNameSpecifierLoc(), SourceLocation(), Method,
DeclAccessPair::make(FoundDecl, FoundDecl->getAccess()),
HadMultipleCandidates, DeclarationNameInfo(),
Context.BoundMemberTy, VK_RValue, OK_Ordinary);
Context.BoundMemberTy, VK_PRValue, OK_Ordinary);
QualType ResultType = Method->getReturnType();
ExprValueKind VK = Expr::getValueKindForType(ResultType);
@ -7825,7 +7844,7 @@ ExprResult Sema::IgnoredValueConversions(Expr *E) {
// [Except in specific positions,] an lvalue that does not have
// array type is converted to the value stored in the
// designated object (and is no longer an lvalue).
if (E->isRValue()) {
if (E->isPRValue()) {
// In C, function designators (i.e. expressions of function type)
// are r-values, but we still want to do function-to-pointer decay
// on them. This is both technically correct and convenient for

View File

@ -408,7 +408,8 @@ CheckExtVectorComponent(Sema &S, QualType baseType, ExprValueKind &VK,
if (CompSize == 1)
return vecType->getElementType();
if (HasRepeated) VK = VK_RValue;
if (HasRepeated)
VK = VK_PRValue;
QualType VT = S.Context.getExtVectorType(vecType->getElementType(), CompSize);
// Now look up the TypeDefDecl from the vector type. Without this,
@ -909,7 +910,8 @@ MemberExpr *Sema::BuildMemberExpr(
bool HadMultipleCandidates, const DeclarationNameInfo &MemberNameInfo,
QualType Ty, ExprValueKind VK, ExprObjectKind OK,
const TemplateArgumentListInfo *TemplateArgs) {
assert((!IsArrow || Base->isRValue()) && "-> base must be a pointer rvalue");
assert((!IsArrow || Base->isPRValue()) &&
"-> base must be a pointer prvalue");
MemberExpr *E =
MemberExpr::Create(Context, Base, IsArrow, OpLoc, NNS, TemplateKWLoc,
Member, FoundDecl, MemberNameInfo, TemplateArgs, Ty,
@ -963,14 +965,13 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
// C++1z [expr.ref]p2:
// For the first option (dot) the first expression shall be a glvalue [...]
if (!IsArrow && BaseExpr && BaseExpr->isRValue()) {
if (!IsArrow && BaseExpr && BaseExpr->isPRValue()) {
ExprResult Converted = TemporaryMaterializationConversion(BaseExpr);
if (Converted.isInvalid())
return ExprError();
BaseExpr = Converted.get();
}
const DeclarationNameInfo &MemberNameInfo = R.getLookupNameInfo();
DeclarationName MemberName = MemberNameInfo.getName();
SourceLocation MemberLoc = MemberNameInfo.getLoc();
@ -1118,7 +1119,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
ExprValueKind valueKind;
QualType type;
if (MemberFn->isInstance()) {
valueKind = VK_RValue;
valueKind = VK_PRValue;
type = Context.BoundMemberTy;
} else {
valueKind = VK_LValue;
@ -1134,7 +1135,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
if (EnumConstantDecl *Enum = dyn_cast<EnumConstantDecl>(MemberDecl)) {
return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Enum,
FoundDecl, /*HadMultipleCandidates=*/false,
MemberNameInfo, Enum->getType(), VK_RValue,
MemberNameInfo, Enum->getType(), VK_PRValue,
OK_Ordinary);
}
@ -1778,9 +1779,9 @@ Sema::BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow,
if (BaseExpr->getObjectKind() == OK_Ordinary)
VK = BaseExpr->getValueKind();
else
VK = VK_RValue;
VK = VK_PRValue;
}
if (VK != VK_RValue && Field->isBitField())
if (VK != VK_PRValue && Field->isBitField())
OK = OK_BitField;
// Figure out the type of the member; see C99 6.5.2.3p3, C++ [expr.ref]

View File

@ -1786,7 +1786,7 @@ bool Sema::CheckMessageArgumentTypes(
} else {
ReturnType = Context.getObjCIdType();
}
VK = VK_RValue;
VK = VK_PRValue;
return false;
}
@ -1873,7 +1873,7 @@ bool Sema::CheckMessageArgumentTypes(
// If we are type-erasing a block to a block-compatible
// Objective-C pointer type, we may need to extend the lifetime
// of the block object.
if (typeArgs && Args[i]->isRValue() && paramType->isBlockPointerType() &&
if (typeArgs && Args[i]->isPRValue() && paramType->isBlockPointerType() &&
Args[i]->getType()->isBlockPointerType() &&
origParamType->isObjCObjectPointerType()) {
ExprResult arg = Args[i];
@ -2634,7 +2634,7 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
Expr **Args = ArgsIn.data();
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
return ObjCMessageExpr::Create(
Context, ReceiverType, VK_RValue, LBracLoc, ReceiverTypeInfo, Sel,
Context, ReceiverType, VK_PRValue, LBracLoc, ReceiverTypeInfo, Sel,
SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs), RBracLoc,
isImplicit);
}
@ -2682,7 +2682,7 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
// Check the argument types and determine the result type.
QualType ReturnType;
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
unsigned NumArgs = ArgsIn.size();
Expr **Args = ArgsIn.data();
@ -2887,7 +2887,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
Expr **Args = ArgsIn.data();
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
return ObjCMessageExpr::Create(
Context, Context.DependentTy, VK_RValue, LBracLoc, Receiver, Sel,
Context, Context.DependentTy, VK_PRValue, LBracLoc, Receiver, Sel,
SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs),
RBracLoc, isImplicit);
}
@ -3226,7 +3226,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
unsigned NumArgs = ArgsIn.size();
Expr **Args = ArgsIn.data();
QualType ReturnType;
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
bool ClassMessage = (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType());
if (CheckMessageArgumentTypes(Receiver, ReceiverType,
@ -4473,7 +4473,7 @@ Sema::CheckObjCConversion(SourceRange castRange, QualType castType,
case ACC_plusOne:
castExpr = ImplicitCastExpr::Create(Context, castExpr->getType(),
CK_ARCConsumeObject, castExpr, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
Cleanup.setExprNeedsCleanups(true);
return ACR_okay;
}
@ -4700,7 +4700,7 @@ ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc,
case OBC_BridgeRetained:
// Produce the object before casting it.
SubExpr = ImplicitCastExpr::Create(Context, FromType, CK_ARCProduceObject,
SubExpr, nullptr, VK_RValue,
SubExpr, nullptr, VK_PRValue,
FPOptionsOverride());
break;
@ -4740,7 +4740,7 @@ ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc,
if (MustConsume) {
Cleanup.setExprNeedsCleanups(true);
Result = ImplicitCastExpr::Create(Context, T, CK_ARCConsumeObject, Result,
nullptr, VK_RValue, FPOptionsOverride());
nullptr, VK_PRValue, FPOptionsOverride());
}
return Result;

View File

@ -132,8 +132,8 @@ bool ConversionFixItGenerator::tryToFixConversion(const Expr *FullExpr,
if (!Expr->isLValue() || Expr->getObjectKind() != OK_Ordinary)
return false;
CanConvert = CompareTypes(S.Context.getPointerType(FromQTy), ToQTy,
S, Begin, VK_RValue);
CanConvert = CompareTypes(S.Context.getPointerType(FromQTy), ToQTy, S,
Begin, VK_PRValue);
if (CanConvert) {
if (const UnaryOperator *UO = dyn_cast<UnaryOperator>(Expr)) {

View File

@ -151,7 +151,7 @@ bool Sema::IsStringInit(Expr *Init, const ArrayType *AT) {
static void updateStringLiteralType(Expr *E, QualType Ty) {
while (true) {
E->setType(Ty);
E->setValueKind(VK_RValue);
E->setValueKind(VK_PRValue);
if (isa<StringLiteral>(E) || isa<ObjCEncodeExpr>(E)) {
break;
} else if (ParenExpr *PE = dyn_cast<ParenExpr>(E)) {
@ -173,7 +173,7 @@ static void updateStringLiteralType(Expr *E, QualType Ty) {
/// as an rvalue.
static void updateGNUCompoundLiteralRValue(Expr *E) {
while (true) {
E->setValueKind(VK_RValue);
E->setValueKind(VK_PRValue);
if (isa<CompoundLiteralExpr>(E)) {
break;
} else if (ParenExpr *PE = dyn_cast<ParenExpr>(E)) {
@ -2924,9 +2924,9 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
Expr *Init = new (Context) IntegerLiteral(
Context, CodeUnit, PromotedCharTy, SubExpr->getExprLoc());
if (CharTy != PromotedCharTy)
Init =
ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast, Init,
nullptr, VK_RValue, FPOptionsOverride());
Init = ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast,
Init, nullptr, VK_PRValue,
FPOptionsOverride());
StructuredList->updateInit(Context, i, Init);
}
} else {
@ -2947,9 +2947,9 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
Expr *Init = new (Context) IntegerLiteral(
Context, CodeUnit, PromotedCharTy, SubExpr->getExprLoc());
if (CharTy != PromotedCharTy)
Init =
ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast, Init,
nullptr, VK_RValue, FPOptionsOverride());
Init = ImplicitCastExpr::Create(Context, CharTy, CK_IntegralCast,
Init, nullptr, VK_PRValue,
FPOptionsOverride());
StructuredList->updateInit(Context, i, Init);
}
}
@ -3465,7 +3465,7 @@ void InitializationSequence::Step::Destroy() {
case SK_FinalCopy:
case SK_ExtraneousCopyToTemporary:
case SK_UserConversion:
case SK_QualificationConversionRValue:
case SK_QualificationConversionPRValue:
case SK_QualificationConversionXValue:
case SK_QualificationConversionLValue:
case SK_FunctionReferenceConversion:
@ -3584,7 +3584,9 @@ void InitializationSequence::AddDerivedToBaseCastStep(QualType BaseType,
ExprValueKind VK) {
Step S;
switch (VK) {
case VK_RValue: S.Kind = SK_CastDerivedToBaseRValue; break;
case VK_PRValue:
S.Kind = SK_CastDerivedToBaseRValue;
break;
case VK_XValue: S.Kind = SK_CastDerivedToBaseXValue; break;
case VK_LValue: S.Kind = SK_CastDerivedToBaseLValue; break;
}
@ -3631,10 +3633,10 @@ InitializationSequence::AddUserConversionStep(FunctionDecl *Function,
void InitializationSequence::AddQualificationConversionStep(QualType Ty,
ExprValueKind VK) {
Step S;
S.Kind = SK_QualificationConversionRValue; // work around a gcc warning
S.Kind = SK_QualificationConversionPRValue; // work around a gcc warning
switch (VK) {
case VK_RValue:
S.Kind = SK_QualificationConversionRValue;
case VK_PRValue:
S.Kind = SK_QualificationConversionPRValue;
break;
case VK_XValue:
S.Kind = SK_QualificationConversionXValue;
@ -4073,10 +4075,10 @@ static void TryConstructorInitialization(Sema &S,
Entity.getKind() != InitializedEntity::EK_Delegating &&
Entity.getKind() !=
InitializedEntity::EK_LambdaToBlockConversionBlockElement &&
UnwrappedArgs.size() == 1 && UnwrappedArgs[0]->isRValue() &&
UnwrappedArgs.size() == 1 && UnwrappedArgs[0]->isPRValue() &&
S.Context.hasSameUnqualifiedType(UnwrappedArgs[0]->getType(), DestType)) {
// Convert qualifications if necessary.
Sequence.AddQualificationConversionStep(DestType, VK_RValue);
Sequence.AddQualificationConversionStep(DestType, VK_PRValue);
if (ILE)
Sequence.RewrapReferenceInitList(DestType, ILE);
return;
@ -4162,7 +4164,7 @@ static void TryConstructorInitialization(Sema &S,
Sequence.AddUserConversionStep(CD, Best->FoundDecl, ConvType,
HadMultipleCandidates);
if (!S.Context.hasSameType(ConvType, DestType))
Sequence.AddQualificationConversionStep(DestType, VK_RValue);
Sequence.AddQualificationConversionStep(DestType, VK_PRValue);
if (IsListInit)
Sequence.RewrapReferenceInitList(Entity.getType(), ILE);
return;
@ -4486,7 +4488,7 @@ static void TryListInitialization(Sema &S,
ImplicitConversionSequence ICS;
ICS.setStandard();
ICS.Standard.setAsIdentityConversion();
if (!E->isRValue())
if (!E->isPRValue())
ICS.Standard.First = ICK_Lvalue_To_Rvalue;
// If E is of a floating-point type, then the conversion is ill-formed
// due to narrowing, but go through the motions in order to produce the
@ -4671,7 +4673,7 @@ static OverloadingResult TryRefInitWithConversionFunction(
else
cv3T3 = T1;
ExprValueKind VK = VK_RValue;
ExprValueKind VK = VK_PRValue;
if (cv3T3->isLValueReferenceType())
VK = VK_LValue;
else if (const auto *RRef = cv3T3->getAs<RValueReferenceType>())
@ -4702,7 +4704,7 @@ static OverloadingResult TryRefInitWithConversionFunction(
// Every implicit conversion results in a prvalue, except for a glvalue
// derived-to-base conversion, which we handle below.
cv3T3 = ICS.Standard.getToType(2);
VK = VK_RValue;
VK = VK_PRValue;
}
// If the converted initializer is a prvalue, its type T4 is adjusted to
@ -4714,7 +4716,7 @@ static OverloadingResult TryRefInitWithConversionFunction(
QualType cv1T4 = S.Context.getQualifiedType(cv3T3, cv1T1.getQualifiers());
if (cv1T4.getQualifiers() != cv3T3.getQualifiers())
Sequence.AddQualificationConversionStep(cv1T4, VK);
Sequence.AddReferenceBindingStep(cv1T4, VK == VK_RValue);
Sequence.AddReferenceBindingStep(cv1T4, VK == VK_PRValue);
VK = IsLValueRef ? VK_LValue : VK_XValue;
if (RefConv & Sema::ReferenceConversions::DerivedToBase)
@ -4929,7 +4931,7 @@ static void TryReferenceInitializationCore(Sema &S,
(InitCategory.isPRValue() &&
(S.getLangOpts().CPlusPlus17 || T2->isRecordType() ||
T2->isArrayType())))) {
ExprValueKind ValueKind = InitCategory.isXValue() ? VK_XValue : VK_RValue;
ExprValueKind ValueKind = InitCategory.isXValue() ? VK_XValue : VK_PRValue;
if (InitCategory.isPRValue() && T2->isRecordType()) {
// The corresponding bullet in C++03 [dcl.init.ref]p5 gives the
// compiler the freedom to perform a copy here or bind to the
@ -4961,7 +4963,7 @@ static void TryReferenceInitializationCore(Sema &S,
QualType cv1T4 = S.Context.getQualifiedType(cv2T2, T1QualsIgnoreAS);
if (T1QualsIgnoreAS != T2QualsIgnoreAS)
Sequence.AddQualificationConversionStep(cv1T4, ValueKind);
Sequence.AddReferenceBindingStep(cv1T4, ValueKind == VK_RValue);
Sequence.AddReferenceBindingStep(cv1T4, ValueKind == VK_PRValue);
ValueKind = isLValueRef ? VK_LValue : VK_XValue;
// Add addr space conversion if required.
if (T1Quals.getAddressSpace() != T2Quals.getAddressSpace()) {
@ -5364,7 +5366,7 @@ static void TryUserDefinedConversion(Sema &S,
if (!S.getLangOpts().CPlusPlus17)
Sequence.AddFinalCopy(DestType);
else if (DestType.hasQualifiers())
Sequence.AddQualificationConversionStep(DestType, VK_RValue);
Sequence.AddQualificationConversionStep(DestType, VK_PRValue);
return;
}
@ -5388,7 +5390,7 @@ static void TryUserDefinedConversion(Sema &S,
!S.Context.hasSameUnqualifiedType(ConvType, DestType))
Sequence.AddFinalCopy(DestType);
else if (!S.Context.hasSameType(ConvType, DestType))
Sequence.AddQualificationConversionStep(DestType, VK_RValue);
Sequence.AddQualificationConversionStep(DestType, VK_PRValue);
return;
}
@ -5493,7 +5495,7 @@ static InvalidICRKind isInvalidICRSource(ASTContext &C, Expr *e,
/// Check whether the given expression is a valid operand for an
/// indirect copy/restore.
static void checkIndirectCopyRestoreSource(Sema &S, Expr *src) {
assert(src->isRValue());
assert(src->isPRValue());
bool isWeakAccess = false;
InvalidICRKind iik = isInvalidICRSource(S.Context, src, false, isWeakAccess);
// If isWeakAccess to true, there will be an implicit
@ -5830,7 +5832,7 @@ void InitializationSequence::InitializeFrom(Sema &S,
Entity.getType()) &&
canPerformArrayCopy(Entity)) {
// If source is a prvalue, use it directly.
if (Initializer->getValueKind() == VK_RValue) {
if (Initializer->getValueKind() == VK_PRValue) {
AddArrayInitStep(DestType, /*IsGNUExtension*/false);
return;
}
@ -7880,7 +7882,7 @@ static void CheckMoveOnConstruction(Sema &S, const Expr *InitExpr,
} else {
DiagID = diag::warn_pessimizing_move_on_initialization;
const Expr *ArgStripped = Arg->IgnoreImplicit()->IgnoreParens();
if (!ArgStripped->isRValue() || !ArgStripped->getType()->isRecordType())
if (!ArgStripped->isPRValue() || !ArgStripped->getType()->isRecordType())
return;
}
@ -7950,7 +7952,7 @@ ExprResult Sema::TemporaryMaterializationConversion(Expr *E) {
// FIXME: This means that AST consumers need to deal with "prvalues" that
// denote materialized temporaries. Maybe we should add another ValueKind
// for "xvalue pretending to be a prvalue" for C++98 support.
if (!E->isRValue() || !getLangOpts().CPlusPlus11)
if (!E->isPRValue() || !getLangOpts().CPlusPlus11)
return E;
// C++1z [conv.rval]/1: T shall be a complete type.
@ -7969,7 +7971,7 @@ ExprResult Sema::PerformQualificationConversion(Expr *E, QualType Ty,
CastKind CK = CK_NoOp;
if (VK == VK_RValue) {
if (VK == VK_PRValue) {
auto PointeeTy = Ty->getPointeeType();
auto ExprPointeeTy = E->getType()->getPointeeType();
if (!PointeeTy.isNull() &&
@ -8114,7 +8116,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
case SK_UserConversion:
case SK_QualificationConversionLValue:
case SK_QualificationConversionXValue:
case SK_QualificationConversionRValue:
case SK_QualificationConversionPRValue:
case SK_FunctionReferenceConversion:
case SK_AtomicConversion:
case SK_ConversionSequence:
@ -8205,11 +8207,10 @@ ExprResult InitializationSequence::Perform(Sema &S,
return ExprError();
ExprValueKind VK =
Step->Kind == SK_CastDerivedToBaseLValue ?
VK_LValue :
(Step->Kind == SK_CastDerivedToBaseXValue ?
VK_XValue :
VK_RValue);
Step->Kind == SK_CastDerivedToBaseLValue
? VK_LValue
: (Step->Kind == SK_CastDerivedToBaseXValue ? VK_XValue
: VK_PRValue);
CurInit = ImplicitCastExpr::Create(S.Context, Step->Type,
CK_DerivedToBase, CurInit.get(),
&BasePath, VK, FPOptionsOverride());
@ -8241,7 +8242,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
case SK_BindReferenceToTemporary: {
// Make sure the "temporary" is actually an rvalue.
assert(CurInit.get()->isRValue() && "not a temporary");
assert(CurInit.get()->isPRValue() && "not a temporary");
// Check exception specifications
if (S.CheckExceptionSpecCompatibility(CurInit.get(), DestType))
@ -8382,13 +8383,13 @@ ExprResult InitializationSequence::Perform(Sema &S,
case SK_QualificationConversionLValue:
case SK_QualificationConversionXValue:
case SK_QualificationConversionRValue: {
case SK_QualificationConversionPRValue: {
// Perform a qualification conversion; these can never go wrong.
ExprValueKind VK =
Step->Kind == SK_QualificationConversionLValue
? VK_LValue
: (Step->Kind == SK_QualificationConversionXValue ? VK_XValue
: VK_RValue);
: VK_PRValue);
CurInit = S.PerformQualificationConversion(CurInit.get(), Step->Type, VK);
break;
}
@ -8401,9 +8402,9 @@ ExprResult InitializationSequence::Perform(Sema &S,
break;
case SK_AtomicConversion: {
assert(CurInit.get()->isRValue() && "cannot convert glvalue to atomic");
assert(CurInit.get()->isPRValue() && "cannot convert glvalue to atomic");
CurInit = S.ImpCastExprToType(CurInit.get(), Step->Type,
CK_NonAtomicToAtomic, VK_RValue);
CK_NonAtomicToAtomic, VK_PRValue);
break;
}
@ -8706,7 +8707,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
case SK_ProduceObjCObject:
CurInit = ImplicitCastExpr::Create(
S.Context, Step->Type, CK_ARCProduceObject, CurInit.get(), nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
break;
case SK_StdInitializerList: {
@ -8762,7 +8763,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
if (!Var->hasGlobalStorage()) {
CurInit = ImplicitCastExpr::Create(
S.Context, Step->Type, CK_LValueToRValue, Init,
/*BasePath=*/nullptr, VK_RValue, FPOptionsOverride());
/*BasePath=*/nullptr, VK_PRValue, FPOptionsOverride());
break;
}
// Case 1a
@ -9648,8 +9649,8 @@ void InitializationSequence::dump(raw_ostream &OS) const {
OS << "user-defined conversion via " << *S->Function.Function;
break;
case SK_QualificationConversionRValue:
OS << "qualification conversion (rvalue)";
case SK_QualificationConversionPRValue:
OS << "qualification conversion (prvalue)";
break;
case SK_QualificationConversionXValue:

View File

@ -686,7 +686,7 @@ static void adjustBlockReturnsToEnum(Sema &S, ArrayRef<ReturnStmt*> returns,
Expr *E = (cleanups ? cleanups->getSubExpr() : retValue);
E = ImplicitCastExpr::Create(S.Context, returnType, CK_IntegralCast, E,
/*base path*/ nullptr, VK_RValue,
/*base path*/ nullptr, VK_PRValue,
FPOptionsOverride());
if (cleanups) {
cleanups->setSubExpr(E);

View File

@ -3159,7 +3159,7 @@ Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember(CXXRecordDecl *RD,
ArgType.addVolatile();
// This isn't /really/ specified by the standard, but it's implied
// we should be working from an RValue in the case of move to ensure
// we should be working from a PRValue in the case of move to ensure
// that we prefer to bind to rvalue references, and an LValue in the
// case of copy to ensure we don't bind to rvalue references.
// Possibly an XValue is actually correct in the case of move, but
@ -3168,7 +3168,7 @@ Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember(CXXRecordDecl *RD,
if (SM == CXXCopyConstructor || SM == CXXCopyAssignment)
VK = VK_LValue;
else
VK = VK_RValue;
VK = VK_PRValue;
}
OpaqueValueExpr FakeArg(LookupLoc, ArgType, VK);
@ -3185,8 +3185,8 @@ Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember(CXXRecordDecl *RD,
if (VolatileThis)
ThisTy.addVolatile();
Expr::Classification Classification =
OpaqueValueExpr(LookupLoc, ThisTy,
RValueThis ? VK_RValue : VK_LValue).Classify(Context);
OpaqueValueExpr(LookupLoc, ThisTy, RValueThis ? VK_PRValue : VK_LValue)
.Classify(Context);
// Now we perform lookup on the name we computed earlier and do overload
// resolution. Lookup is only performed directly into the class since there

View File

@ -1458,7 +1458,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
MarkDeclRefReferenced(SelfExpr);
Expr *LoadSelfExpr = ImplicitCastExpr::Create(
Context, SelfDecl->getType(), CK_LValueToRValue, SelfExpr, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
Expr *IvarRefExpr =
new (Context) ObjCIvarRefExpr(Ivar,
Ivar->getUsageType(SelfDecl->getType()),
@ -1521,7 +1521,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
MarkDeclRefReferenced(SelfExpr);
Expr *LoadSelfExpr = ImplicitCastExpr::Create(
Context, SelfDecl->getType(), CK_LValueToRValue, SelfExpr, nullptr,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
Expr *lhs =
new (Context) ObjCIvarRefExpr(Ivar,
Ivar->getUsageType(SelfDecl->getType()),

View File

@ -6714,7 +6714,8 @@ void Sema::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(
auto *VariantFuncRef = DeclRefExpr::Create(
Context, NestedNameSpecifierLoc(), SourceLocation(), FD,
/* RefersToEnclosingVariableOrCapture */ false,
/* NameLoc */ FD->getLocation(), FD->getType(), ExprValueKind::VK_RValue);
/* NameLoc */ FD->getLocation(), FD->getType(),
ExprValueKind::VK_PRValue);
OMPDeclareVariantScope &DVScope = OMPDeclareVariantScopes.back();
auto *OMPDeclareVariantA = OMPDeclareVariantAttr::CreateImplicit(
@ -10612,9 +10613,9 @@ bool OpenMPAtomicUpdateChecker::checkStatement(Stmt *S, unsigned DiagId,
// OpaqueValueExpr(expr)' or 'OpaqueValueExpr(expr) binop
// OpaqueValueExpr(x)' and then cast it to the type of the 'x' expression.
auto *OVEX = new (SemaRef.getASTContext())
OpaqueValueExpr(X->getExprLoc(), X->getType(), VK_RValue);
OpaqueValueExpr(X->getExprLoc(), X->getType(), VK_PRValue);
auto *OVEExpr = new (SemaRef.getASTContext())
OpaqueValueExpr(E->getExprLoc(), E->getType(), VK_RValue);
OpaqueValueExpr(E->getExprLoc(), E->getType(), VK_PRValue);
ExprResult Update =
SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr,
IsXLHSInRHSPart ? OVEExpr : OVEX);
@ -16685,7 +16686,8 @@ static bool actOnOMPReductionKindClause(
// (type of the variable or single array element).
PrivateTy = Context.getVariableArrayType(
Type,
new (Context) OpaqueValueExpr(ELoc, Context.getSizeType(), VK_RValue),
new (Context)
OpaqueValueExpr(ELoc, Context.getSizeType(), VK_PRValue),
ArrayType::Normal, /*IndexTypeQuals=*/0, SourceRange());
} else if (!ASE && !OASE &&
Context.getAsArrayType(D->getType().getNonReferenceType())) {
@ -16857,11 +16859,11 @@ static bool actOnOMPReductionKindClause(
QualType Params[] = {PtrRedTy, PtrRedTy};
QualType FnTy = Context.getFunctionType(Context.VoidTy, Params, EPI);
auto *OVE = new (Context) OpaqueValueExpr(
ELoc, Context.getPointerType(FnTy), VK_RValue, OK_Ordinary,
ELoc, Context.getPointerType(FnTy), VK_PRValue, OK_Ordinary,
S.DefaultLvalueConversion(DeclareReductionRef.get()).get());
Expr *Args[] = {LHS.get(), RHS.get()};
ReductionOp =
CallExpr::Create(Context, OVE, Args, Context.VoidTy, VK_RValue, ELoc,
CallExpr::Create(Context, OVE, Args, Context.VoidTy, VK_PRValue, ELoc,
S.CurFPFeatureOverrides());
} else {
BinaryOperatorKind CombBOK = getRelatedCompoundReductionOp(BOK);
@ -16925,7 +16927,7 @@ static bool actOnOMPReductionKindClause(
} else {
// Build temp array for prefix sum.
auto *Dim = new (S.Context)
OpaqueValueExpr(ELoc, S.Context.getSizeType(), VK_RValue);
OpaqueValueExpr(ELoc, S.Context.getSizeType(), VK_PRValue);
QualType ArrayTy =
S.Context.getVariableArrayType(PrivateTy, Dim, ArrayType::Normal,
/*IndexTypeQuals=*/0, {ELoc, ELoc});
@ -16938,7 +16940,7 @@ static bool actOnOMPReductionKindClause(
TempArrayElem =
S.DefaultFunctionArrayLvalueConversion(TempArrayRes.get());
auto *Idx = new (S.Context)
OpaqueValueExpr(ELoc, S.Context.getSizeType(), VK_RValue);
OpaqueValueExpr(ELoc, S.Context.getSizeType(), VK_PRValue);
TempArrayElem = S.CreateBuiltinArraySubscriptExpr(TempArrayElem.get(),
ELoc, Idx, ELoc);
}

View File

@ -5434,8 +5434,8 @@ Sema::PerformObjectArgumentInitialization(Expr *From,
DestType = ImplicitParamRecordType;
FromClassification = From->Classify(Context);
// When performing member access on an rvalue, materialize a temporary.
if (From->isRValue()) {
// When performing member access on a prvalue, materialize a temporary.
if (From->isPRValue()) {
From = CreateMaterializeTemporaryExpr(FromRecordType, From,
Method->getRefQualifier() !=
RefQualifierKind::RQ_RValue);
@ -7371,7 +7371,7 @@ void Sema::AddConversionCandidate(
ImplicitCastExpr ConversionFn(ImplicitCastExpr::OnStack,
Context.getPointerType(Conversion->getType()),
CK_FunctionToPointerDecay, &ConversionRef,
VK_RValue, FPOptionsOverride());
VK_PRValue, FPOptionsOverride());
QualType ConversionType = Conversion->getConversionType();
if (!isCompleteType(From->getBeginLoc(), ConversionType)) {
@ -12983,7 +12983,7 @@ bool Sema::buildOverloadedCallSet(Scope *S, Expr *Fn,
// lookup to instantiation time to be able to search into type dependent
// base classes.
CallExpr *CE =
CallExpr::Create(Context, Fn, Args, Context.DependentTy, VK_RValue,
CallExpr::Create(Context, Fn, Args, Context.DependentTy, VK_PRValue,
RParenLoc, CurFPFeatureOverrides());
CE->markDependentForPostponedNameLookup();
*Result = CE;
@ -13241,7 +13241,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
if (Input->isTypeDependent()) {
if (Fns.empty())
return UnaryOperator::Create(Context, Input, Opc, Context.DependentTy,
VK_RValue, OK_Ordinary, OpLoc, false,
VK_PRValue, OK_Ordinary, OpLoc, false,
CurFPFeatureOverrides());
CXXRecordDecl *NamingClass = nullptr; // lookup ignores member operators
@ -13250,7 +13250,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
if (Fn.isInvalid())
return ExprError();
return CXXOperatorCallExpr::Create(Context, Op, Fn.get(), ArgsArray,
Context.DependentTy, VK_RValue, OpLoc,
Context.DependentTy, VK_PRValue, OpLoc,
CurFPFeatureOverrides());
}
@ -13498,9 +13498,9 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
Context, Args[0], Args[1], Opc, Context.DependentTy, VK_LValue,
OK_Ordinary, OpLoc, CurFPFeatureOverrides(), Context.DependentTy,
Context.DependentTy);
return BinaryOperator::Create(Context, Args[0], Args[1], Opc,
Context.DependentTy, VK_RValue, OK_Ordinary,
OpLoc, CurFPFeatureOverrides());
return BinaryOperator::Create(
Context, Args[0], Args[1], Opc, Context.DependentTy, VK_PRValue,
OK_Ordinary, OpLoc, CurFPFeatureOverrides());
}
// FIXME: save results of ADL from here?
@ -13513,7 +13513,7 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
if (Fn.isInvalid())
return ExprError();
return CXXOperatorCallExpr::Create(Context, Op, Fn.get(), Args,
Context.DependentTy, VK_RValue, OpLoc,
Context.DependentTy, VK_PRValue, OpLoc,
CurFPFeatureOverrides());
}
@ -13992,7 +13992,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
// Can't add any actual overloads yet
return CXXOperatorCallExpr::Create(Context, OO_Subscript, Fn.get(), Args,
Context.DependentTy, VK_RValue, RLoc,
Context.DependentTy, VK_PRValue, RLoc,
CurFPFeatureOverrides());
}
@ -14215,7 +14215,7 @@ ExprResult Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE,
Type);
};
if (isa<CXXPseudoDestructorExpr>(NakedMemExpr))
return CallExpr::Create(Context, MemExprE, Args, Context.VoidTy, VK_RValue,
return CallExpr::Create(Context, MemExprE, Args, Context.VoidTy, VK_PRValue,
RParenLoc, CurFPFeatureOverrides());
UnbridgedCastsSet UnbridgedCasts;
@ -14600,7 +14600,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
// Record usage of conversion in an implicit cast.
Call = ImplicitCastExpr::Create(
Context, Call.get()->getType(), CK_UserDefinedConversion, Call.get(),
nullptr, VK_RValue, CurFPFeatureOverrides());
nullptr, VK_PRValue, CurFPFeatureOverrides());
return BuildCallExpr(S, Call.get(), LParenLoc, Args, RParenLoc);
}
@ -15068,7 +15068,7 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
(void)isCompleteType(UnOp->getOperatorLoc(), MemPtrType);
return UnaryOperator::Create(
Context, SubExpr, UO_AddrOf, MemPtrType, VK_RValue, OK_Ordinary,
Context, SubExpr, UO_AddrOf, MemPtrType, VK_PRValue, OK_Ordinary,
UnOp->getOperatorLoc(), false, CurFPFeatureOverrides());
}
}
@ -15077,10 +15077,10 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
if (SubExpr == UnOp->getSubExpr())
return UnOp;
return UnaryOperator::Create(Context, SubExpr, UO_AddrOf,
Context.getPointerType(SubExpr->getType()),
VK_RValue, OK_Ordinary, UnOp->getOperatorLoc(),
false, CurFPFeatureOverrides());
return UnaryOperator::Create(
Context, SubExpr, UO_AddrOf, Context.getPointerType(SubExpr->getType()),
VK_PRValue, OK_Ordinary, UnOp->getOperatorLoc(), false,
CurFPFeatureOverrides());
}
if (UnresolvedLookupExpr *ULE = dyn_cast<UnresolvedLookupExpr>(E)) {
@ -15135,7 +15135,7 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
valueKind = VK_LValue;
type = Fn->getType();
} else {
valueKind = VK_RValue;
valueKind = VK_PRValue;
type = Context.BoundMemberTy;
}

View File

@ -835,7 +835,7 @@ ExprResult ObjCPropertyOpBuilder::buildRValueOperation(Expr *op) {
// As a special case, if the method returns 'id', try to get
// a better type from the property.
if (RefExpr->isExplicitProperty() && result.get()->isRValue()) {
if (RefExpr->isExplicitProperty() && result.get()->isPRValue()) {
QualType receiverType = RefExpr->getReceiverType(S.Context);
QualType propType = RefExpr->getExplicitProperty()
->getUsageType(receiverType);
@ -1554,7 +1554,7 @@ ExprResult Sema::checkPseudoObjectIncDec(Scope *Sc, SourceLocation opcLoc,
// Do nothing if the operand is dependent.
if (op->isTypeDependent())
return UnaryOperator::Create(Context, op, opcode, Context.DependentTy,
VK_RValue, OK_Ordinary, opcLoc, false,
VK_PRValue, OK_Ordinary, opcLoc, false,
CurFPFeatureOverrides());
assert(UnaryOperator::isIncrementDecrementOp(opcode));
@ -1585,7 +1585,7 @@ ExprResult Sema::checkPseudoObjectAssignment(Scope *S, SourceLocation opcLoc,
// Do nothing if either argument is dependent.
if (LHS->isTypeDependent() || RHS->isTypeDependent())
return BinaryOperator::Create(Context, LHS, RHS, opcode,
Context.DependentTy, VK_RValue, OK_Ordinary,
Context.DependentTy, VK_PRValue, OK_Ordinary,
opcLoc, CurFPFeatureOverrides());
// Filter out non-overload placeholder types in the RHS.

View File

@ -867,7 +867,7 @@ StmtResult Sema::ActOnIfStmt(SourceLocation IfLoc, bool IsConstexpr,
Cond = ConditionResult(
*this, nullptr,
MakeFullExpr(new (Context) OpaqueValueExpr(SourceLocation(),
Context.BoolTy, VK_RValue),
Context.BoolTy, VK_PRValue),
IfLoc),
false);
@ -2271,7 +2271,7 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc,
// If the type contained 'auto', deduce the 'auto' to 'id'.
if (FirstType->getContainedAutoType()) {
OpaqueValueExpr OpaqueId(D->getLocation(), Context.getObjCIdType(),
VK_RValue);
VK_PRValue);
Expr *DeducedInit = &OpaqueId;
if (DeduceAutoType(D->getTypeSourceInfo(), DeducedInit, FirstType) ==
DAR_Failed)

View File

@ -735,7 +735,7 @@ void Sema::FillInlineAsmIdentifierInfo(Expr *Res,
Expr::EvalResult Eval;
if (T->isFunctionType() || T->isDependentType())
return Info.setLabel(Res);
if (Res->isRValue()) {
if (Res->isPRValue()) {
bool IsEnum = isa<clang::EnumType>(T);
if (DeclRefExpr *DRE = dyn_cast<clang::DeclRefExpr>(Res))
if (DRE->getDecl()->getKind() == Decl::EnumConstant)

View File

@ -1256,8 +1256,8 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NTTP,
}
// FIXME: Concepts: This should be the type of the placeholder, but this is
// unclear in the wording right now.
DeclRefExpr *Ref = BuildDeclRefExpr(NTTP, NTTP->getType(), VK_RValue,
NTTP->getLocation());
DeclRefExpr *Ref =
BuildDeclRefExpr(NTTP, NTTP->getType(), VK_PRValue, NTTP->getLocation());
if (!Ref)
return true;
ExprResult ImmediatelyDeclaredConstraint =
@ -2405,9 +2405,9 @@ private:
NewDefArg = new (SemaRef.Context)
OpaqueValueExpr(OldParam->getDefaultArg()->getBeginLoc(),
ParamTy.getNonLValueExprType(SemaRef.Context),
ParamTy->isLValueReferenceType() ? VK_LValue :
ParamTy->isRValueReferenceType() ? VK_XValue :
VK_RValue);
ParamTy->isLValueReferenceType() ? VK_LValue
: ParamTy->isRValueReferenceType() ? VK_XValue
: VK_PRValue);
}
ParmVarDecl *NewParam = ParmVarDecl::Create(SemaRef.Context, DC,
@ -6903,8 +6903,9 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
Arg = PE->getPattern();
ExprResult E = ImpCastExprToType(
Arg, ParamType.getNonLValueExprType(Context), CK_Dependent,
ParamType->isLValueReferenceType() ? VK_LValue :
ParamType->isRValueReferenceType() ? VK_XValue : VK_RValue);
ParamType->isLValueReferenceType() ? VK_LValue
: ParamType->isRValueReferenceType() ? VK_XValue
: VK_PRValue);
if (E.isInvalid())
return ExprError();
if (PE) {
@ -7632,7 +7633,7 @@ Sema::BuildExpressionFromIntegralTemplateArgument(const TemplateArgument &Arg,
if (OrigT->isEnumeralType()) {
// FIXME: This is a hack. We need a better way to handle substituted
// non-type template parameters.
E = CStyleCastExpr::Create(Context, OrigT, VK_RValue, CK_IntegralCast, E,
E = CStyleCastExpr::Create(Context, OrigT, VK_PRValue, CK_IntegralCast, E,
nullptr, CurFPFeatureOverrides(),
Context.getTrivialTypeSourceInfo(OrigT, Loc),
Loc, Loc);

View File

@ -1475,8 +1475,8 @@ TemplateInstantiator::TransformTemplateParmRefExpr(DeclRefExpr *E,
ExprType.addConst();
return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(
ExprType, TargetType->isReferenceType() ? VK_LValue : VK_RValue, NTTP,
E->getLocation(), Arg);
ExprType, TargetType->isReferenceType() ? VK_LValue : VK_PRValue,
NTTP, E->getLocation(), Arg);
}
Arg = getPackSubstitutedTemplateArgument(getSema(), Arg);

View File

@ -474,7 +474,7 @@ static void instantiateOMPDeclareVariantAttr(
SourceLocation(), SubstFD,
/* RefersToEnclosingVariableOrCapture */ false,
/* NameLoc */ SubstFD->getLocation(),
SubstFD->getType(), ExprValueKind::VK_RValue);
SubstFD->getType(), ExprValueKind::VK_PRValue);
}
}
}

View File

@ -2397,7 +2397,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
}
// Do lvalue-to-rvalue conversions on the array size expression.
if (ArraySize && !ArraySize->isRValue()) {
if (ArraySize && !ArraySize->isPRValue()) {
ExprResult Result = DefaultLvalueConversion(ArraySize);
if (Result.isInvalid())
return QualType();
@ -8886,7 +8886,7 @@ QualType Sema::getDecltypeForParenthesizedExpr(Expr *E) {
case VK_LValue:
return Context.getLValueReferenceType(T);
// - otherwise, decltype(e) is the type of e.
case VK_RValue:
case VK_PRValue:
return T;
}
llvm_unreachable("Unknown value kind");

View File

@ -3599,7 +3599,7 @@ public:
FunctionDecl *Builtin = cast<FunctionDecl>(Lookup.front());
Expr *Callee = new (SemaRef.Context)
DeclRefExpr(SemaRef.Context, Builtin, false,
SemaRef.Context.BuiltinFnTy, VK_RValue, BuiltinLoc);
SemaRef.Context.BuiltinFnTy, VK_PRValue, BuiltinLoc);
QualType CalleePtrTy = SemaRef.Context.getPointerType(Builtin->getType());
Callee = SemaRef.ImpCastExprToType(Callee, CalleePtrTy,
CK_BuiltinFnToFnPtr).get();
@ -13282,7 +13282,7 @@ TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *E) {
auto *VD = cast<ValueDecl>(Pack);
ExprResult DRE = getSema().BuildDeclRefExpr(
VD, VD->getType().getNonLValueExprType(getSema().Context),
VD->getType()->isReferenceType() ? VK_LValue : VK_RValue,
VD->getType()->isReferenceType() ? VK_LValue : VK_PRValue,
E->getPackLoc());
if (DRE.isInvalid())
return ExprError();

View File

@ -472,7 +472,7 @@ void MoveChecker::checkPostCall(const CallEvent &Call,
const MemRegion *BaseRegion = ArgRegion->getBaseRegion();
// Skip temp objects because of their short lifetime.
if (BaseRegion->getAs<CXXTempObjectRegion>() ||
AFC->getArgExpr(0)->isRValue())
AFC->getArgExpr(0)->isPRValue())
return;
// If it has already been reported do not need to modify the state.

View File

@ -2013,7 +2013,7 @@ static void trackRValueExpression(const ExplodedNode *InputNode, const Expr *E,
PathSensitiveBugReport &report,
bugreporter::TrackingKind TKind,
bool EnableNullFPSuppression) {
assert(E->isRValue() && "The expression is not an rvalue!");
assert(E->isPRValue() && "The expression is not a prvalue!");
const ExplodedNode *RVNode = findNodeForExpression(InputNode, E);
if (!RVNode)
return;
@ -2187,7 +2187,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode,
}
}
if (Inner->isRValue())
if (Inner->isPRValue())
trackRValueExpression(LVNode, Inner, report, TKind,
EnableNullFPSuppression);

View File

@ -86,7 +86,7 @@ QualType CallEvent::getResultType() const {
case VK_XValue:
ResultTy = Ctx.getRValueReferenceType(ResultTy);
break;
case VK_RValue:
case VK_PRValue:
// No adjustment is necessary.
break;
}

View File

@ -903,7 +903,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 835,
@ -947,7 +946,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -968,7 +967,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -976,7 +975,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 875,
@ -1108,7 +1106,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1003,
@ -1243,7 +1240,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1283,7 +1280,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1113,
@ -1388,7 +1384,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1410,7 +1406,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "desugaredQualType": "enum Enum",
// CHECK-NEXT: "qualType": "enum Enum"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1454,7 +1450,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1168,
@ -1623,7 +1618,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1351,
@ -1668,7 +1662,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1689,7 +1683,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1697,7 +1691,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1383,
@ -1783,7 +1776,6 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "tls": "static"
// CHECK-NEXT: }
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1458,
@ -1829,13 +1821,12 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1505,

View File

@ -349,7 +349,6 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 490,
@ -490,7 +489,7 @@ void f() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -500,7 +499,6 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 562,
@ -1676,7 +1674,6 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1184,
@ -1768,7 +1765,7 @@ void f() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(int, ...)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
@ -1795,7 +1792,7 @@ void f() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(int, ...)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1890,7 +1887,7 @@ void f() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1962,7 +1959,6 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1296,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -183,7 +183,6 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 232,
@ -278,7 +277,7 @@ int main() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -286,7 +285,6 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 271,
@ -316,7 +314,6 @@ int main() {
// CHECK-NEXT: "pure": true
// CHECK-NEXT: }
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 343,
@ -410,7 +407,7 @@ int main() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "100"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -434,7 +431,6 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 399,
@ -649,7 +645,6 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 504,
@ -747,7 +742,7 @@ int main() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -755,7 +750,6 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 545,

View File

@ -29,7 +29,6 @@ void func(int val) {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// using --filters=IfStmt
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -65,7 +64,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -86,7 +85,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -141,7 +140,6 @@ void func(int val) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -178,7 +176,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -199,7 +197,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -271,7 +269,6 @@ void func(int val) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -308,7 +305,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -329,7 +326,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -419,7 +416,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -440,7 +437,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -514,7 +511,6 @@ void func(int val) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -551,7 +547,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "true",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -572,7 +568,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "==",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -593,7 +589,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: },
// CHECK-NEXT: {
@ -614,7 +610,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -641,7 +637,6 @@ void func(int val) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -722,7 +717,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -747,7 +742,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -768,7 +763,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -823,7 +818,6 @@ void func(int val) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -904,7 +898,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -929,7 +923,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -950,7 +944,7 @@ void func(int val) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {

View File

@ -26,7 +26,7 @@ id TestCompoundLiteral(id a) {
// CHECK-NEXT: "qualType": "id",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {

View File

@ -5012,7 +5012,6 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1675,
@ -5155,7 +5154,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -5163,7 +5162,6 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1725,

View File

@ -147,7 +147,6 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "struct"
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 123,
@ -366,7 +365,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -387,7 +386,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -438,7 +437,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -459,7 +458,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -511,7 +510,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -532,7 +531,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -568,7 +567,6 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 206,
@ -1418,7 +1416,6 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "union"
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 388,
@ -1638,7 +1635,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1659,7 +1656,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1710,7 +1707,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1731,7 +1728,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1783,7 +1780,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1804,7 +1801,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1840,7 +1837,6 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 470,

View File

@ -150,7 +150,6 @@ void TestLineNumbers(void) {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// using --filters=VarDecl,CompoundStmt
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 99,
@ -196,13 +195,12 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 121,
@ -247,7 +245,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "+",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -268,7 +266,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: },
// CHECK-NEXT: {
@ -289,7 +287,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -309,7 +307,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -319,7 +317,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -398,7 +395,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -479,7 +476,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 198,
@ -524,7 +520,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -544,7 +540,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: },
// CHECK-NEXT: {
@ -565,7 +561,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -585,7 +581,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -608,7 +604,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -628,7 +624,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -651,7 +647,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -659,7 +655,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -739,7 +734,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -760,7 +755,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -832,7 +827,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -858,7 +853,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": true,
// CHECK-NEXT: "opcode": "++",
// CHECK-NEXT: "canOverflow": false,
@ -912,7 +907,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": true,
// CHECK-NEXT: "opcode": "++",
// CHECK-NEXT: "inner": [
@ -965,7 +960,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "-",
// CHECK-NEXT: "canOverflow": false,
@ -988,7 +983,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1009,7 +1004,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1065,7 +1060,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "-",
// CHECK-NEXT: "inner": [
@ -1087,7 +1082,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1141,7 +1136,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "~",
// CHECK-NEXT: "canOverflow": false,
@ -1164,7 +1159,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1185,7 +1180,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1241,7 +1236,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "~",
// CHECK-NEXT: "canOverflow": false,
@ -1264,7 +1259,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1302,7 +1297,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1337,7 +1331,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1357,7 +1351,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1427,7 +1421,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1453,7 +1447,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1473,7 +1467,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1543,7 +1537,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1569,7 +1563,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1595,7 +1589,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1615,7 +1609,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1677,7 +1671,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1711,7 +1705,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1737,7 +1731,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1757,7 +1751,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1827,7 +1821,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1860,7 +1854,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1886,7 +1880,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "100"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1955,7 +1949,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1975,7 +1969,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2045,7 +2039,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2059,7 +2053,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -2170,7 +2163,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2238,7 +2231,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "label1",
// CHECK-NEXT: "labelDeclId": "0x{{.*}}"
// CHECK-NEXT: }
@ -2281,7 +2274,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const void *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2302,7 +2295,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2342,7 +2335,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -2395,7 +2387,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2482,7 +2474,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2502,7 +2494,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2563,7 +2555,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2583,7 +2575,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2625,7 +2617,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2645,7 +2637,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "2"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2745,7 +2737,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2765,7 +2757,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "3"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2788,7 +2780,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2808,7 +2800,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "5"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -2839,7 +2831,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -2892,7 +2883,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2979,7 +2970,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3068,7 +3059,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3175,7 +3166,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3281,7 +3272,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3368,7 +3359,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3460,7 +3451,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3548,7 +3539,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3622,7 +3613,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -3675,7 +3665,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3781,7 +3771,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3897,7 +3887,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -3923,7 +3913,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "<",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3944,7 +3934,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3995,7 +3985,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -4018,7 +4008,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "++",
// CHECK-NEXT: "inner": [
@ -4108,7 +4098,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4160,7 +4150,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4211,7 +4201,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4302,7 +4292,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4353,7 +4343,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4402,7 +4392,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4423,7 +4413,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "!",
// CHECK-NEXT: "canOverflow": false,
@ -4446,7 +4436,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4543,7 +4533,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4636,7 +4626,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4685,7 +4675,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4706,7 +4696,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "!",
// CHECK-NEXT: "canOverflow": false,
@ -4729,7 +4719,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "_Bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4830,7 +4820,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -4884,7 +4873,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: },
// CHECK-NEXT: {
@ -4994,7 +4983,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -5014,7 +5003,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (*)(int)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5035,7 +5024,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
@ -5065,7 +5054,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -5075,7 +5064,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -5111,7 +5099,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -5191,7 +5179,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -5216,7 +5204,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5256,7 +5244,6 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -5401,7 +5388,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]

View File

@ -277,7 +277,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 198,
@ -384,7 +383,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (*)()"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "&",
// CHECK-NEXT: "canOverflow": false,
@ -501,7 +500,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "4"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -511,7 +510,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 266,
@ -792,7 +790,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 378,
@ -951,7 +948,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "operatorNewDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
@ -982,7 +979,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "operatorDeleteDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
@ -1010,7 +1007,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1113,7 +1110,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isArray": true,
// CHECK-NEXT: "operatorNewDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1142,7 +1139,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1163,7 +1160,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "2"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -1191,7 +1188,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isArray": true,
// CHECK-NEXT: "isArrayAsWritten": true,
// CHECK-NEXT: "operatorDeleteDecl": {
@ -1221,7 +1218,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1324,7 +1321,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isGlobal": true,
// CHECK-NEXT: "operatorNewDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1356,7 +1353,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isGlobal": true,
// CHECK-NEXT: "operatorDeleteDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -1385,7 +1382,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1425,7 +1422,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@ -1883,7 +1879,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 598,
@ -2042,7 +2037,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "T *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: "valueCategory": "prvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
@ -2067,7 +2062,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2106,7 +2101,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 766,
@ -2267,7 +2261,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2340,7 +2334,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "T"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: "valueCategory": "prvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: },
@ -2363,7 +2357,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2436,7 +2430,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "T"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "list": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2457,7 +2451,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: "valueCategory": "prvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
@ -2482,7 +2476,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2525,7 +2519,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -2545,7 +2539,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isPostfix": false,
// CHECK-NEXT: "opcode": "&",
// CHECK-NEXT: "canOverflow": false,
@ -2602,7 +2596,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "T"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: "valueCategory": "prvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
@ -2613,7 +2607,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1049,
@ -2774,7 +2767,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -2869,7 +2862,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue"
// CHECK-NEXT: "valueCategory": "prvalue"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
@ -2880,7 +2873,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1214,
@ -2987,7 +2979,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "U [3]"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "array_filler": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -3007,7 +2999,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "U"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "field": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
@ -3035,7 +3027,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "U"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "field": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
@ -3063,7 +3055,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -3079,7 +3071,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1261,
@ -3233,7 +3224,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3290,7 +3281,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1315,
@ -3444,7 +3434,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -3469,7 +3459,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3490,7 +3480,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3583,7 +3573,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "true",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3604,7 +3594,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "==",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3625,7 +3615,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "sizeof",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3699,7 +3689,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3720,7 +3710,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -3787,7 +3777,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "true",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3808,7 +3798,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "==",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3829,7 +3819,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "sizeof",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3903,7 +3893,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -3924,7 +3914,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -3974,7 +3964,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1529,
@ -4100,7 +4089,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -4169,7 +4158,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4224,7 +4213,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralToBoolean",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4245,7 +4234,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4558,7 +4547,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4659,7 +4648,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "+",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4680,7 +4669,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4731,7 +4720,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -4758,7 +4747,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "!=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4780,7 +4769,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4834,7 +4823,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -4987,7 +4976,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5032,7 +5021,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5157,7 +5146,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: "qualType": "void () noexcept"
// CHECK-NEXT: },
@ -5329,7 +5318,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -5349,7 +5338,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<bound member function type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "begin",
// CHECK-NEXT: "isArrow": false,
// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
@ -5477,7 +5466,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -5497,7 +5486,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<bound member function type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "end",
// CHECK-NEXT: "isArrow": false,
// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
@ -5579,7 +5568,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "!=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5601,7 +5590,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5655,7 +5644,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5808,7 +5797,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -5853,7 +5842,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6119,7 +6108,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6220,7 +6209,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "+",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6241,7 +6230,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6292,7 +6281,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "10"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -6319,7 +6308,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "opcode": "!=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6341,7 +6330,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6395,7 +6384,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6548,7 +6537,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6593,7 +6582,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6660,7 +6649,6 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1737,
@ -6802,7 +6790,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "resultDependent": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6878,7 +6866,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -6904,7 +6892,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -6930,7 +6918,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<dependent type>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "resultDependent": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -6999,7 +6987,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]

View File

@ -21,7 +21,6 @@ void TestObjCAtCatchStmt() {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 143,
@ -113,7 +112,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
@ -140,7 +139,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -208,7 +207,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -254,7 +253,6 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 185,
@ -346,7 +344,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
@ -373,7 +371,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -441,7 +439,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -487,7 +485,6 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 252,

View File

@ -60,7 +60,6 @@ void i();
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// CHECK: "kind": "TranslationUnitDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@ -1063,7 +1062,7 @@ void i();
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NonTypeTemplateParmDecl",

View File

@ -21,7 +21,6 @@ void MaterializeTemp() {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// using --filters=ExprWithCleanups
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -89,7 +88,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -110,7 +109,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "temp": "0x{{.*}}",
// CHECK-NEXT: "dtor": {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -139,7 +138,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@ -155,7 +154,6 @@ void MaterializeTemp() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -222,7 +220,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FloatingToIntegral",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -243,7 +241,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "double"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@ -253,7 +251,6 @@ void MaterializeTemp() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -271,7 +268,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -291,7 +288,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
@ -311,7 +308,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (*)(const int &)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -384,7 +381,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FloatingToIntegral",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -405,7 +402,7 @@ void MaterializeTemp() {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "float"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {

View File

@ -2,7 +2,6 @@
using TestContainsErrors = int[sizeof(undef())];
// CHECK: "kind": "TypeAliasDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 130,
@ -63,7 +62,7 @@ using TestContainsErrors = int[sizeof(undef())];
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned long"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "name": "sizeof",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {

View File

@ -37,7 +37,6 @@ signed char cstylecast_3(signed int x) {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// using --filters=ImplicitCastExpr,CStyleCastExpr
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -54,7 +53,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -75,7 +74,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -111,7 +110,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -128,7 +126,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -149,7 +147,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -185,7 +183,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -202,7 +199,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -223,7 +220,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -259,7 +256,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -276,7 +272,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -297,7 +293,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -333,7 +329,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -350,7 +345,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -371,7 +366,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -408,7 +403,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -425,7 +419,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -446,7 +440,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -483,7 +477,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -500,7 +493,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -521,7 +514,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -558,7 +551,6 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -575,7 +567,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -596,7 +588,7 @@ signed char cstylecast_3(signed int x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [

View File

@ -78,7 +78,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// using --filters=ImplicitCastExpr,CStyleCastExpr,CXXStaticCastExpr,CXXFunctionalCastExpr
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -95,7 +94,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -116,7 +115,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -152,7 +151,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -169,7 +167,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -190,7 +188,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -226,7 +224,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -243,7 +240,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -264,7 +261,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -300,7 +297,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -317,7 +313,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -338,7 +334,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -374,7 +370,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -391,7 +386,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -412,7 +407,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -434,7 +429,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -473,7 +468,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -490,7 +484,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -511,7 +505,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -533,7 +527,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -572,7 +566,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -589,7 +582,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -610,7 +603,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -632,7 +625,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -671,7 +664,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -688,7 +680,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -709,7 +701,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -731,7 +723,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -770,7 +762,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -787,7 +778,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -808,7 +799,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -830,7 +821,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -869,7 +860,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -886,7 +876,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -907,7 +897,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -929,7 +919,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -968,7 +958,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -985,7 +974,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1006,7 +995,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1028,7 +1017,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1067,7 +1056,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1084,7 +1072,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1105,7 +1093,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "signed char"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1127,7 +1115,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1166,7 +1154,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1185,7 +1172,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1208,7 +1195,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1232,7 +1219,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedInt",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1275,7 +1262,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1294,7 +1280,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1317,7 +1303,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1341,7 +1327,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedInt",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1384,7 +1370,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1403,7 +1388,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1426,7 +1411,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "UnsignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1450,7 +1435,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedInt",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1493,7 +1478,6 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@ -1512,7 +1496,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "NoOp",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@ -1535,7 +1519,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedChar",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [
@ -1559,7 +1543,7 @@ SignedChar cxxfunctionalcast_3(SignedInt x) {
// CHECK-NEXT: "qualType": "SignedInt",
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "isPartOfExplicitCast": true,
// CHECK-NEXT: "inner": [