mirror of https://github.com/m-labs/artiq.git
Allow to dump ARTIQ/LLVM IR for stitched code.
This commit is contained in:
parent
ee3f35c608
commit
13ad9b5d08
|
@ -33,9 +33,18 @@ class Core:
|
||||||
stitcher.stitch_call(function, args, kwargs)
|
stitcher.stitch_call(function, args, kwargs)
|
||||||
|
|
||||||
module = Module(stitcher)
|
module = Module(stitcher)
|
||||||
library = OR1KTarget().compile_and_link([module])
|
target = OR1KTarget()
|
||||||
|
|
||||||
return library, stitcher.rpc_map
|
if os.getenv('ARTIQ_DUMP_IR'):
|
||||||
|
print("====== ARTIQ IR DUMP ======", file=sys.stderr)
|
||||||
|
for function in module.artiq_ir:
|
||||||
|
print(function, file=sys.stderr)
|
||||||
|
|
||||||
|
if os.getenv('ARTIQ_DUMP_LLVM'):
|
||||||
|
print("====== LLVM IR DUMP ======", file=sys.stderr)
|
||||||
|
print(module.build_llvm_ir(target), file=sys.stderr)
|
||||||
|
|
||||||
|
return target.compile_and_link([module]), stitcher.rpc_map
|
||||||
except diagnostic.Error as error:
|
except diagnostic.Error as error:
|
||||||
print("\n".join(error.diagnostic.render(colored=True)), file=sys.stderr)
|
print("\n".join(error.diagnostic.render(colored=True)), file=sys.stderr)
|
||||||
raise CompileError() from error
|
raise CompileError() from error
|
||||||
|
|
Loading…
Reference in New Issue