diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-16 18:14:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-16 18:14:23 -0800 |
commit | d157b2049d07d3396cfa6d646d56705100ef412f (patch) | |
tree | 0404f0893be489c04393698d0808fe8269ce58fe /tools | |
parent | 48a10df5a060461bc8a213e14e9f3aba2e0b7858 (diff) |
support for .ll files as inputs to emcc
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/shared.py b/tools/shared.py index 7bd31729..97e953be 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -334,14 +334,15 @@ class Building: assert os.path.exists(filename + '.o.ll'), 'Could not create .ll file: ' + output @staticmethod - def llvm_as(filename): + def llvm_as(input_filename, output_filename=None): # LLVM assembly ==> LLVM binary - try: - os.remove(target) - except: - pass - output = Popen([LLVM_AS, filename + '.o.ll', '-o=' + filename + '.o'], stdout=PIPE).communicate()[0] - assert os.path.exists(filename + '.o'), 'Could not create bc file: ' + output + if output_filename is None: + # use test runner conventions + output_filename = input_filename + '.o' + input_filename = input_filename + '.o.ll' + try_delete(output_filename) + output = Popen([LLVM_AS, input_filename, '-o=' + output_filename], stdout=PIPE).communicate()[0] + assert os.path.exists(output_filename), 'Could not create bc file: ' + output @staticmethod def llvm_nm(filename): |