[all-commits] [llvm/llvm-project] 31e14f: clang/Modules: Sink CompilerInstance::KnownModules...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Sun Nov 3 20:35:31 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 31e14f41a21f9016050a20f07d5da03db2e8c13e
      https://github.com/llvm/llvm-project/commit/31e14f41a21f9016050a20f07d5da03db2e8c13e
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2019-11-03 (Sun, 03 Nov 2019)

  Changed paths:
    M clang/include/clang/Frontend/CompilerInstance.h
    M clang/include/clang/Lex/ModuleMap.h
    M clang/lib/Frontend/CompilerInstance.cpp

  Log Message:
  -----------
  clang/Modules: Sink CompilerInstance::KnownModules into ModuleMap

Avoid use-after-frees when FrontendAction::BeginSourceFile is called
twice on the same CompilerInstance by sinking
CompilerInstance::KnownModules into ModuleMap.  On the way, rename the
map to CachedModuleLoads.  I considered (but rejected) merging this with
ModuleMap::Modules, since that only has top-level modules and this map
includes submodules.

This is an alternative to https://reviews.llvm.org/D58497.  Thanks to
nemanjai for the detailed analysis of the problem!




More information about the All-commits mailing list