aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-05-15 05:49:47 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-05-15 05:49:47 +0000
commitaf52f28d9d9f79789c7be958167a974166fa13ac (patch)
tree0f98793a0700ef2f1a87b99d5c11eb6bdfde9501 /llvm/lib/LTO/ThinLTOCodeGenerator.cpp
parentfedb0fd907ec39329217af5a89b49f431f9f02be (diff)
downloadllvm-af52f28d9d9f79789c7be958167a974166fa13ac.zip
llvm-af52f28d9d9f79789c7be958167a974166fa13ac.tar.gz
llvm-af52f28d9d9f79789c7be958167a974166fa13ac.tar.bz2
ThinLTOCodeGenerator: fix race condition found using TSAN
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 269588
Diffstat (limited to 'llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index 33d0a0c..2867c73 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -884,6 +884,11 @@ void ThinLTOCodeGenerator::run() {
auto GUIDPreservedSymbols =
computeGUIDPreservedSymbols(PreservedSymbols, TMBuilder.TheTriple);
+ // Make sure that every module has an entry in the ExportLists to enable
+ // threaded access to this map below
+ for (auto &DefinedGVSummaries : ModuleToDefinedGVSummaries)
+ ExportLists[DefinedGVSummaries.first()];
+
// Parallel optimizer + codegen
{
ThreadPool Pool(ThreadCount);