[all-commits] [llvm/llvm-project] a2d805: [clang][modules] Delay creating `IdentifierInfo` f...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Oct 18 02:50:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2d805c020a1658b04ed7e606ee67e234a9d5b56
      https://github.com/llvm/llvm-project/commit/a2d805c020a1658b04ed7e606ee67e234a9d5b56
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-10-18 (Mon, 18 Oct 2021)

  Changed paths:
    M clang/lib/Frontend/CompilerInstance.cpp
    A clang/test/Modules/Inputs/module-name-used-by-objc-bridge/Interface.h
    A clang/test/Modules/Inputs/module-name-used-by-objc-bridge/InterfaceBridge.h
    A clang/test/Modules/Inputs/module-name-used-by-objc-bridge/module.modulemap
    A clang/test/Modules/module-name-used-by-objc-bridge.m

  Log Message:
  -----------
  [clang][modules] Delay creating `IdentifierInfo` for names of explicit modules

When using explicit Clang modules, some declarations might unexpectedly become invisible.

This is caused by the mechanism that loads PCM files passed via `-fmodule-file=<path>` and creates an `IdentifierInfo` for the module name. The `IdentifierInfo` creation takes place when the `ASTReader` is in a weird state, with modules that are loaded but not yet set up properly. This patch delays the creation of `IdentifierInfo` until the `ASTReader` is done with reading the PCM.

Note that the `-fmodule-file=<name>=<path>` form of the argument doesn't suffer from this issue, since it doesn't create `IdentifierInfo` for the module name.

Reviewed By: dexonsmith

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




More information about the All-commits mailing list