[PATCH] D118223: [NFC] [AST] Move isSame* check in ASTReader to ASTContext

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 26 01:22:19 PST 2022


ChuanqiXu created this revision.
ChuanqiXu added reviewers: rsmith, aaron.ballman, urnathan, erichkeane.
ChuanqiXu added a project: clang.
ChuanqiXu requested review of this revision.
Herald added a subscriber: cfe-commits.

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 case for something like:

  C++
  module;
  #include "something"
  export module a_module;
  import another_module; //  check the ODR consistency here

or

  C++
  export module m;
  import a_module;
  import another_module; // check the ODR consistency here

However, it wouldn't handle the case:

  import another_module; // check ODR here, everything looks fine.
  #include "something" // Oops, we don't check for ODR now

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118223

Files:
  clang/include/clang/AST/ASTContext.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/Serialization/ASTReaderDecl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118223.403164.patch
Type: text/x-patch
Size: 33846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220126/a55c32d3/attachment-0001.bin>


More information about the cfe-commits mailing list