]> granicus.if.org Git - clang/commit
[AST] Sink 'part of explicit cast' down into ImplicitCastExpr
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 27 Jul 2018 07:27:14 +0000 (07:27 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 27 Jul 2018 07:27:14 +0000 (07:27 +0000)
commit5a987ef0b0d883c8f33502e47b9b6f32e0546980
tree5d2e11b6c1393ec008a43970b62d2d835c4a222b
parent76de414d4346a0c564e0796b90b6520cadce1793
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338108 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Expr.h
include/clang/AST/Stmt.h
lib/AST/ASTDumper.cpp
lib/Sema/SemaCast.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp