diff options
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/shared.py b/tools/shared.py index f6594af2..668e609b 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -7,6 +7,16 @@ if not os.path.exists(CONFIG_FILE): shutil.copy(path_from_root('tests', 'settings.py'), CONFIG_FILE) exec(open(CONFIG_FILE, 'r').read()) +# Tools + +LLVM_LINK=os.path.join(LLVM_ROOT, 'llvm-link') +LLVM_OPT=os.path.expanduser(os.path.join(LLVM_ROOT, 'opt')) +LLVM_AS=os.path.expanduser(os.path.join(LLVM_ROOT, 'llvm-as')) +LLVM_DIS=os.path.expanduser(os.path.join(LLVM_ROOT, 'llvm-dis')) +LLVM_DIS_OPTS = ['-show-annotations'] # For LLVM 2.8+. For 2.7, you may need to do just [] + +# Utilities + def timeout_run(proc, timeout, note): start = time.time() if timeout is not None: @@ -21,3 +31,7 @@ def run_js(engine, filename, args, check_timeout=False): return timeout_run(Popen(engine + [filename] + (['--'] if 'v8' in engine[0] else []) + args, stdout=PIPE, stderr=STDOUT), 120 if check_timeout else None, 'Execution') +def to_cc(cxx): + # By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version + return cxx.replace('clang++', 'clang').replace('g++', 'gcc') + |