[all-commits] [llvm/llvm-project] c0bcd1: [ASTImporter] Add basic support for comparing Stmt...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Sun Sep 13 09:25:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c0bcd11068fc13e45b253c6c315882097f94c121
      https://github.com/llvm/llvm-project/commit/c0bcd11068fc13e45b253c6c315882097f94c121
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-09-13 (Sun, 13 Sep 2020)

  Changed paths:
    M clang/include/clang/AST/ASTStructuralEquivalence.h
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/unittests/AST/StructuralEquivalenceTest.cpp

  Log Message:
  -----------
  [ASTImporter] Add basic support for comparing Stmts and compare function bodies

Right now the ASTImporter assumes for most Expr nodes that they are always equal
which leads to non-compatible declarations ending up being merged. This patch
adds the basic framework for comparing Stmts (and with that also Exprs) and
implements the custom checks for a few Stmt subclasses. I'll implement the
remaining subclasses in follow up patches (mostly because there are a lot of
subclasses and some of them require further changes like having GNU language in
the testing framework)

The motivation for this is that in LLDB we try to import libc++ source code and
some of the types we are importing there contain expressions (e.g. because they
use `enable_if<expr>`), so those declarations are currently merged even if they
are completely different (e.g. `enable_if<value> ...` and `enable_if<!value>
...` are currently considered equal which is clearly not true).

Reviewed By: martong, balazske

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




More information about the All-commits mailing list