[all-commits] [llvm/llvm-project] e4d178: [clang][Serialization] Don't duplicate the body of...

Bruno Ricci via All-commits all-commits at lists.llvm.org
Thu Jul 2 06:17:29 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e4d178a752444453f0ab8d2b9085087208aa8296
      https://github.com/llvm/llvm-project/commit/e4d178a752444453f0ab8d2b9085087208aa8296
  Author: Bruno Ricci <riccibrun at gmail.com>
  Date:   2020-07-02 (Thu, 02 Jul 2020)

  Changed paths:
    M clang/include/clang/AST/ExprCXX.h
    M clang/lib/AST/ExprCXX.cpp
    M clang/lib/Serialization/ASTReaderStmt.cpp
    M clang/lib/Serialization/ASTWriterStmt.cpp
    A clang/test/AST/ast-dump-lambda-body-not-duplicated.cpp

  Log Message:
  -----------
  [clang][Serialization] Don't duplicate the body of LambdaExpr during deserialization

05843dc6ab97a00cbde7aa4f08bf3692eb83109d changed the serialization of the body
of LambdaExpr to avoid a mutation in LambdaExpr::getBody and to avoid a missing
body in LambdaExpr::children.

Unfortunately this replaced one bug by another: we are now duplicating the body
during deserialization; that is after deserialization the identity:

E->getBody() == E->getCallOperator()->getBody() does not hold.

Fix that by instead lazily loading the body from the call operator when needed.

Differential Revision: https://reviews.llvm.org/D83009

Reviewed By: martong, aaron.ballman, vabridgers




More information about the All-commits mailing list