Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 8f351cf

Browse files
committed
[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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261480 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b9019e8 commit 8f351cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/scan-build-py/libscanbuild/report.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ def report_directory(hint, keep):
3535
keep -- a boolean value to keep or delete the empty report directory. """
3636

3737
stamp = time.strftime('scan-build-%Y-%m-%d-%H%M%S-', time.localtime())
38-
name = tempfile.mkdtemp(prefix=stamp, dir=hint)
38+
39+
parentdir = os.path.abspath(hint)
40+
if not os.path.exists(parentdir):
41+
os.makedirs(parentdir)
42+
43+
name = tempfile.mkdtemp(prefix=stamp, dir=parentdir)
3944

4045
logging.info('Report directory created: %s', name)
4146

0 commit comments

Comments
 (0)