mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Catch the Python exception when subprocess.Popen is failing.
For example, if llc cannot be found, the full python stacktrace is displayed and no interesting information are provided. + fail the process when an exception occurs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -236,8 +236,13 @@ if loadable_module:
|
|||||||
|
|
||||||
# llc knows whether he is compiled with -DNDEBUG.
|
# llc knows whether he is compiled with -DNDEBUG.
|
||||||
import subprocess
|
import subprocess
|
||||||
llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
|
try:
|
||||||
|
llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
|
||||||
stdout = subprocess.PIPE)
|
stdout = subprocess.PIPE)
|
||||||
|
except OSError, why:
|
||||||
|
print "Could not find llc in " + llvm_tools_dir
|
||||||
|
exit(42)
|
||||||
|
|
||||||
if re.search(r'with assertions', llc_cmd.stdout.read()):
|
if re.search(r'with assertions', llc_cmd.stdout.read()):
|
||||||
config.available_features.add('asserts')
|
config.available_features.add('asserts')
|
||||||
llc_cmd.wait()
|
llc_cmd.wait()
|
||||||
|
Reference in New Issue
Block a user