[all-commits] [llvm/llvm-project] 7ac737: [HeaderSearch] Fix processing #import-ed headers m...

Volodymyr Sapsai via All-commits all-commits at lists.llvm.org
Thu Aug 20 17:42:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ac737e56bee721fb3535006140362c6e08726bb
      https://github.com/llvm/llvm-project/commit/7ac737e56bee721fb3535006140362c6e08726bb
  Author: Volodymyr Sapsai <vsapsai at apple.com>
  Date:   2020-08-20 (Thu, 20 Aug 2020)

  Changed paths:
    M clang/lib/Lex/HeaderSearch.cpp
    A clang/test/Modules/Inputs/import-once/ImportOnce.framework/Headers/ImportOnce.h
    A clang/test/Modules/Inputs/import-once/ImportOnce.framework/Modules/module.modulemap
    A clang/test/Modules/Inputs/import-once/IndirectImporter.framework/Headers/IndirectImporter.h
    A clang/test/Modules/Inputs/import-once/IndirectImporter.framework/Modules/module.modulemap
    A clang/test/Modules/Inputs/import-once/Unrelated.framework/Headers/Unrelated.h
    A clang/test/Modules/Inputs/import-once/Unrelated.framework/Modules/module.modulemap
    A clang/test/Modules/import-once.m

  Log Message:
  -----------
  [HeaderSearch] Fix processing #import-ed headers multiple times with modules enabled.

HeaderSearch was marking requested HeaderFileInfo as Resolved only based on
the presence of ExternalSource. As the result, using any module was enough
to set ExternalSource and headers unknown to this module would have
HeaderFileInfo with empty fields, including `isImport = 0`, `NumIncludes = 0`.
Such HeaderFileInfo was preserved without changes regardless of how the
header was used in other modules and caused incorrect result in
`HeaderSearch::ShouldEnterIncludeFile`.

Fix by marking HeaderFileInfo as Resolved only if ExternalSource knows
about this header.

rdar://problem/62126911

Reviewed By: bruno

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




More information about the All-commits mailing list