diff options
author | John McCall <rjmccall@apple.com> | 2010-11-18 06:31:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-18 06:31:45 +0000 |
commit | f89e55ab1bfb3ea997f8b02997c611a02254eb2d (patch) | |
tree | cacb763638dfa30e56adfe71a8ab73cd8b19eb64 /lib/Serialization/ASTWriterStmt.cpp | |
parent | 6a02b609c2e23b28d24f9db4c8006137c6b55ae4 (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/ASTWriterStmt.cpp')
-rw-r--r-- | lib/Serialization/ASTWriterStmt.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp index efbfd94401..495c3d05ff 100644 --- a/lib/Serialization/ASTWriterStmt.cpp +++ b/lib/Serialization/ASTWriterStmt.cpp @@ -360,6 +360,8 @@ void ASTStmtWriter::VisitExpr(Expr *E) { Writer.AddTypeRef(E->getType(), Record); Record.push_back(E->isTypeDependent()); Record.push_back(E->isValueDependent()); + Record.push_back(E->getValueKind()); + Record.push_back(E->getObjectKind()); } void ASTStmtWriter::VisitPredefinedExpr(PredefinedExpr *E) { @@ -555,6 +557,8 @@ void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) { Record.push_back(FoundDecl.getAccess()); Writer.AddTypeRef(E->getType(), Record); + Record.push_back(E->getValueKind()); + Record.push_back(E->getObjectKind()); Writer.AddStmt(E->getBase()); Writer.AddDeclRef(E->getMemberDecl(), Record); Writer.AddSourceLocation(E->getMemberLoc(), Record); @@ -612,7 +616,6 @@ void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) { void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) { VisitCastExpr(E); - Record.push_back(E->getValueKind()); Code = serialization::EXPR_IMPLICIT_CAST; } @@ -1297,7 +1300,6 @@ void ASTStmtWriter::VisitCXXNoexceptExpr(CXXNoexceptExpr *E) { void ASTStmtWriter::VisitOpaqueValueExpr(OpaqueValueExpr *E) { VisitExpr(E); - Record.push_back(E->getValueKind()); Code = serialization::EXPR_OPAQUE_VALUE; } |