diff options
author | Anton Yartsev <anton.yartsev@gmail.com> | 2016-02-21 17:04:26 +0000 |
---|---|---|
committer | Anton Yartsev <anton.yartsev@gmail.com> | 2016-02-21 17:04:26 +0000 |
commit | 6e135f45a8666874d1600659cd1b1bd6bb49b06e (patch) | |
tree | bdd62522ec08fede45c6b4456e99ff2bae57f0f8 | |
parent | 55afdfd3844d2475f5b5165fb45c52873292cfa3 (diff) | |
download | bcm5719-llvm-6e135f45a8666874d1600659cd1b1bd6bb49b06e.tar.gz bcm5719-llvm-6e135f45a8666874d1600659cd1b1bd6bb49b06e.zip |
[analyzer][scan-build] Non-existing directory for scan-build output.
Makes scan-build successfully accept non-existing output directories provided via "-o" option. The directory is created in this case. This behavior is conforming to the old perl scan-build implementation.
(http://reviews.llvm.org/D17091)
llvm-svn: 261480
-rw-r--r-- | clang/tools/scan-build-py/libscanbuild/report.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/tools/scan-build-py/libscanbuild/report.py b/clang/tools/scan-build-py/libscanbuild/report.py index efc0a55de61..5c33319e206 100644 --- a/clang/tools/scan-build-py/libscanbuild/report.py +++ b/clang/tools/scan-build-py/libscanbuild/report.py @@ -35,7 +35,12 @@ def report_directory(hint, keep): keep -- a boolean value to keep or delete the empty report directory. """ stamp = time.strftime('scan-build-%Y-%m-%d-%H%M%S-', time.localtime()) - name = tempfile.mkdtemp(prefix=stamp, dir=hint) + + parentdir = os.path.abspath(hint) + if not os.path.exists(parentdir): + os.makedirs(parentdir) + + name = tempfile.mkdtemp(prefix=stamp, dir=parentdir) logging.info('Report directory created: %s', name) |