scan-build-py: fix multiprocessing error
authorLawrence D'Anna <lawrence_danna@apple.com>
Sat, 5 Sep 2020 18:09:21 +0000 (11:09 -0700)
committerLawrence D'Anna <lawrence_danna@apple.com>
Sat, 5 Sep 2020 18:10:14 +0000 (11:10 -0700)
commit0c642828612dbde30decff6fb080af4de9a173bd
treed82fee21ed96f0542d88782b9ddb6778b0929b2b
parentbef38e86b4e702a0c42e243d323fb7c09875e649
scan-build-py: fix multiprocessing error

Recent versions of python3's multiprocessing module will blow up with
a Runtime error from this code, saying:

  An attempt has been made to start a new process before the
  current process has finished its bootstrapping phase

This is becuae the wrappers in bin/ are not using the  `__name__ == "__main__"`   idiom correctly.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D87051
clang/tools/scan-build-py/bin/analyze-build
clang/tools/scan-build-py/bin/intercept-build
clang/tools/scan-build-py/bin/scan-build