[all-commits] [llvm/llvm-project] fe47e8: [NFC] [ASTUnit] [Serialization] Transalte local de...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Thu Apr 25 00:56:47 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe47e8ff3ae7fc8975eaade6bfa6679737c28b93
      https://github.com/llvm/llvm-project/commit/fe47e8ff3ae7fc8975eaade6bfa6679737c28b93
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M clang/lib/Frontend/ASTUnit.cpp

  Log Message:
  -----------
  [NFC] [ASTUnit] [Serialization] Transalte local decl ID to global decl ID before consuming

Discovered from
https://github.com/llvm/llvm-project/commit/d86cc73bbfd9a22d9a0d498d72c9b2ee235128e9.

There is a potential issue of using DeclID in ASTUnit. ASTUnit may
record the declaration ID from ASTWriter. And after loading the
preamble, the ASTUnit may consume the recorded declaration ID directly
in ExternalASTSource. This is not good. According to the design, all
local declaration ID consumed in ASTReader need to be translated by
`ASTReader::getGlobaldeclID()`.

This will be problematic if we changed the encodings of declaration IDs or if we
make preamble to work more complexly.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list