[all-commits] [llvm/llvm-project] ba6c71: [AST] Use RecoveryExpr to model a DeclRefExpr whic...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Mar 3 01:34:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba6c71b1377e8c99b62b2115a8519df74465f53c
      https://github.com/llvm/llvm-project/commit/ba6c71b1377e8c99b62b2115a8519df74465f53c
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2022-03-03 (Thu, 03 Mar 2022)

  Changed paths:
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/AST/ast-dump-recovery.cpp
    M clang/test/Sema/ms-inline-asm.c
    M clang/test/SemaCXX/constructor-initializer.cpp
    M clang/test/SemaCXX/copy-assignment.cpp

  Log Message:
  -----------
  [AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl.

Previously, we didin't build a DeclRefExpr which refers to an invalid declaration.

In this patch, we handle this case by building an empty RecoveryExpr,
which will preserve more broken code (AST parent nodes that contain the
RecoveryExpr is preserved in the AST).

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




More information about the All-commits mailing list