diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-07-27 07:27:14 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-07-27 07:27:14 +0000 |
commit | 12216f1d4a0852accfd22cb6c313a90ecbc19c29 (patch) | |
tree | c9c33999aea49d46d1af6682916bd5fa739f15e4 /clang/lib/Serialization/ASTWriterStmt.cpp | |
parent | eeab694cea440fde55e11cdb07a84cdecf561c52 (diff) | |
download | bcm5719-llvm-12216f1d4a0852accfd22cb6c313a90ecbc19c29.tar.gz bcm5719-llvm-12216f1d4a0852accfd22cb6c313a90ecbc19c29.zip |
[AST] Sink 'part of explicit cast' down into ImplicitCastExpr
Summary:
As discussed in IRC with @rsmith, it is slightly not good to keep that in the `CastExpr` itself:
Given the explicit cast, which is represented in AST as an `ExplicitCastExpr` + `ImplicitCastExpr`'s,
only the `ImplicitCastExpr`'s will be marked as `PartOfExplicitCast`, but not the `ExplicitCastExpr` itself.
Thus, it is only ever `true` for `ImplicitCastExpr`'s, so we don't need to write/read/dump it for `ExplicitCastExpr`'s.
We don't need to worry that we write the `PartOfExplicitCast` in PCH after `CastExpr::path_iterator`,
since the `ExprImplicitCastAbbrev` is only used when the `NumBaseSpecs == 0`, i.e. there is no 'path'.
Reviewers: rsmith, rjmccall, erichkeane, aaron.ballman
Reviewed By: rsmith, erichkeane
Subscribers: vsk, cfe-commits, rsmith
Tags: #clang
Differential Revision: https://reviews.llvm.org/D49838
llvm-svn: 338108
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 79156dcc5ce..3efb6482dd4 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -665,7 +665,6 @@ void ASTStmtWriter::VisitCastExpr(CastExpr *E) { Record.push_back(E->path_size()); Record.AddStmt(E->getSubExpr()); Record.push_back(E->getCastKind()); // FIXME: stable encoding - Record.push_back(E->getIsPartOfExplicitCast()); for (CastExpr::path_iterator PI = E->path_begin(), PE = E->path_end(); PI != PE; ++PI) @@ -714,6 +713,7 @@ ASTStmtWriter::VisitBinaryConditionalOperator(BinaryConditionalOperator *E) { void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) { VisitCastExpr(E); + Record.push_back(E->isPartOfExplicitCast()); if (E->path_size() == 0) AbbrevToUse = Writer.getExprImplicitCastAbbrev(); |