diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-19 16:01:01 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-19 16:01:01 -0800 |
commit | 05b14137c17f1706ad4716226a4e12e056feb3a0 (patch) | |
tree | 299ed013c8d5307a068295d972e26b61855b1efe /emcc | |
parent | 2d0b313958d6856adaa4a48ae00ee18a3fb08f11 (diff) |
nicer output in emcc when there are source code errors, plus test
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -363,9 +363,13 @@ try: # First, generate LLVM bitcode. For each input file, we get base.o with bitcode for input_file in input_files: if input_file.endswith(SOURCE_SUFFIXES): - args = newargs + ['-emit-llvm', '-c', input_file, '-o', in_temp(unsuffixed_basename(input_file) + '.o')] + output_file = in_temp(unsuffixed_basename(input_file) + '.o') + args = newargs + ['-emit-llvm', '-c', input_file, '-o', output_file] if DEBUG: print >> sys.stderr, "emcc running:", call, ' '.join(args) - Popen([call] + args).communicate() + Popen([call] + args).communicate() # let compiler frontend print directly, so colors are saved (PIPE kills that) + if not os.path.exists(output_file): + print >> sys.stderr, 'emcc: compiler frontend failed to generate LLVM bitcode, halting' + sys.exit(1) else: # bitcode if input_file.endswith(('.bc', '.o')): shutil.copyfile(input_file, in_temp(unsuffixed_basename(input_file) + '.o')) |