HomePhabricator

clang/Modules: Sink CompilerInstance::KnownModules into ModuleMap

Authored by dexonsmith on Nov 3 2019, 7:29 PM.

Description

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!

Details

Committed
dexonsmithNov 3 2019, 7:57 PM
Parents
rG858b15cb9cf6: [compiler-rt] [msan] Correct the __libc_thr_keycreate prototype
Branches
Unknown
Tags
Unknown