Add explanatory comment.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 29 Sep 2016 03:29:28 +0000 (03:29 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 29 Sep 2016 03:29:28 +0000 (03:29 +0000)
llvm-svn: 282678

llvm/lib/LTO/LTOBackend.cpp

index 86ab8aac509857821cf93b4cbae16b838f6be9dd..c2fff4a684a75c76089334c8faa82503097fc696 100644 (file)
@@ -253,6 +253,10 @@ void splitCodeGen(Config &C, TargetMachine *TM, AddStreamFn AddStream,
             std::move(BC), ThreadCount++);
       },
       false);
+
+  // Because the inner lambda (which runs in a worker thread) captures our local
+  // variables, we need to wait for the worker threads to terminate before we
+  // can leave the function scope.
   CodegenThreadPool.wait();
 }