[all-commits] [llvm/llvm-project] f85ee6: [NFC] [AST] Move isSameEntity into ASTContext

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Wed Jan 26 18:31:13 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f85ee6d56a9371ccb8b3a63b6f9ed38ba8d071b7
      https://github.com/llvm/llvm-project/commit/f85ee6d56a9371ccb8b3a63b6f9ed38ba8d071b7
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp

  Log Message:
  -----------
  [NFC] [AST] Move isSameEntity into ASTContext

Currently we are trying to implement the semantics of C++ Modules. A big
challenge would be the ODR checking. Previously we did this in
ASTReader, it would handle the cases like:
```
module;
export module a_module;
import another_module; //  check the ODR consistency here
```
or
```
export module m;
import a_module;
import another_module; // check the ODR consistency here
```

However, it wouldn't handle the case:
```
import another_module; // When we check ODR here, everything looks fine.
```

In the case, the read process is ended. But we need to check the ODR
still. To reuse the facility we do in ASTReader, this patch moves the
corresponding codes into ASTContext. This should be good since there
were facilities like `hasSameTemplateName` and `hasSameType`.

Although the patch is a little bit big, all of the change should be
trivial.

Reviewed By: erichkeane

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




More information about the All-commits mailing list