aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderStmt.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-18 06:31:45 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-18 06:31:45 +0000
commitf89e55ab1bfb3ea997f8b02997c611a02254eb2d (patch)
treecacb763638dfa30e56adfe71a8ab73cd8b19eb64 /lib/Serialization/ASTReaderStmt.cpp
parent6a02b609c2e23b28d24f9db4c8006137c6b55ae4 (diff)
Calculate the value kind of an expression when it's created and
store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r--lib/Serialization/ASTReaderStmt.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp
index 26077c5fb7..6d578f616e 100644
--- a/lib/Serialization/ASTReaderStmt.cpp
+++ b/lib/Serialization/ASTReaderStmt.cpp
@@ -59,7 +59,7 @@ namespace clang {
/// \brief The number of record fields required for the Expr class
/// itself.
- static const unsigned NumExprFields = NumStmtFields + 3;
+ static const unsigned NumExprFields = NumStmtFields + 5;
/// \brief Read and initialize a ExplicitTemplateArgumentList structure.
void ReadExplicitTemplateArgumentList(ExplicitTemplateArgumentList &ArgList,
@@ -400,6 +400,8 @@ void ASTStmtReader::VisitExpr(Expr *E) {
E->setType(Reader.GetType(Record[Idx++]));
E->setTypeDependent(Record[Idx++]);
E->setValueDependent(Record[Idx++]);
+ E->setValueKind(static_cast<ExprValueKind>(Record[Idx++]));
+ E->setObjectKind(static_cast<ExprObjectKind>(Record[Idx++]));
assert(Idx == NumExprFields && "Incorrect expression field count");
}
@@ -625,7 +627,6 @@ void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
void ASTStmtReader::VisitImplicitCastExpr(ImplicitCastExpr *E) {
VisitCastExpr(E);
- E->setValueKind(static_cast<ExprValueKind>(Record[Idx++]));
}
void ASTStmtReader::VisitExplicitCastExpr(ExplicitCastExpr *E) {
@@ -1284,7 +1285,6 @@ void ASTStmtReader::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) {
void ASTStmtReader::VisitOpaqueValueExpr(OpaqueValueExpr *E) {
VisitExpr(E);
- E->setValueKind(static_cast<ExprValueKind>(Record[Idx++]));
}
Stmt *ASTReader::ReadStmt(PerFileData &F) {
@@ -1523,6 +1523,8 @@ Stmt *ASTReader::ReadStmtFromStream(PerFileData &F) {
DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
QualType T = GetType(Record[Idx++]);
+ ExprValueKind VK = static_cast<ExprValueKind>(Record[Idx++]);
+ ExprObjectKind OK = static_cast<ExprObjectKind>(Record[Idx++]);
Expr *Base = ReadSubExpr();
ValueDecl *MemberD = cast<ValueDecl>(GetDecl(Record[Idx++]));
SourceLocation MemberLoc = ReadSourceLocation(F, Record, Idx);
@@ -1531,7 +1533,7 @@ Stmt *ASTReader::ReadStmtFromStream(PerFileData &F) {
S = MemberExpr::Create(*Context, Base, IsArrow, NNS, QualifierRange,
MemberD, FoundDecl, MemberNameInfo,
- NumTemplateArgs ? &ArgInfo : 0, T);
+ NumTemplateArgs ? &ArgInfo : 0, T, VK, OK);
ReadDeclarationNameLoc(F, cast<MemberExpr>(S)->MemberDNLoc,
MemberD->getDeclName(), Record, Idx);
break;