- Add optimization pass: Eliminate dead constants.
- Fixes issues:
#288: Check def-use dominance rules for OpPhi (variable,parent) operands
+ #340: Avoid race on mkdir during build
v2016.2 2016-08-05
- Validator is incomplete
from __future__ import print_function
+import errno
import functools
import json
import os.path
dir = os.path.dirname(os.path.abspath(f))
try:
os.makedirs(dir)
- except:
- pass
+ except OSError as e:
+ if e.errno == errno.EEXIST and os.path.isdir(dir):
+ pass
+ else:
+ raise
def populate_capability_bit_mapping_dict(cap_dict):
from __future__ import print_function
import datetime
+import errno
import os.path
import re
import subprocess
import sys
+def mkdir_p(directory):
+ """Make the directory, and all its ancestors as required. Any of the
+ directories are allowed to already exist."""
+
+ try:
+ os.makedirs(directory)
+ except OSError as e:
+ if e.errno == errno.EEXIST and os.path.isdir(directory):
+ pass
+ else:
+ raise
+
+
def command_output(cmd, directory):
"""Runs a command in a directory and returns its standard output stream.
sys.exit(1)
output_file = sys.argv[2]
- output_dir = os.path.dirname(output_file)
- if not os.path.isdir(output_dir):
- os.makedirs(output_dir)
+ mkdir_p(os.path.dirname(output_file))
software_version = deduce_software_version(sys.argv[1])
new_content = '"{}", "SPIRV-Tools {} {}"\n'.format(