From 6a89e2c1fa8cfa388bc7d66623eddae2d6892851 Mon Sep 17 00:00:00 2001 From: nickysn Date: Wed, 19 Aug 2020 16:18:55 +0000 Subject: [PATCH] + register a LLVM-MC assembler writer (not implemented yet) git-svn-id: branches/wasm@46496 - --- compiler/systems.inc | 1 + compiler/wasm32/agllvmmc.pas | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/compiler/systems.inc b/compiler/systems.inc index 581a2151e3..39e20086e2 100644 --- a/compiler/systems.inc +++ b/compiler/systems.inc @@ -263,6 +263,7 @@ ,as_z80_vasm ,as_z80_rel ,as_wasm32_wabt + ,as_wasm32_llvm_mc { WebAssembly code assembled by llvm-mc (llvm machine code playground) } ); tlink = (ld_none, diff --git a/compiler/wasm32/agllvmmc.pas b/compiler/wasm32/agllvmmc.pas index 9389c4bb95..87fc3debbb 100644 --- a/compiler/wasm32/agllvmmc.pas +++ b/compiler/wasm32/agllvmmc.pas @@ -27,7 +27,35 @@ unit agllvmmc; interface + uses + systems, + assemble; + + type + + { TLLVMMachineCodePlaygroundAssembler } + + TLLVMMachineCodePlaygroundAssembler=class(texternalassembler) + end; + implementation + const + as_wasm32_llvm_mc_info : tasminfo = + ( + id : as_wasm32_llvm_mc; + idtxt : 'LLVM-MC'; + asmbin : 'llvm-mc'; + asmcmd : '--assemble --arch=wasm32 --filetype=obj -o $OBJ $EXTRAOPT $ASM'; + supported_targets : [system_wasm32_wasm,system_wasm32_wasi]; + flags : []; + labelprefix : '.L'; + labelmaxlen : -1; + comment : '# '; + dollarsign : '$'; + ); + +initialization + RegisterAssembler(as_wasm32_llvm_mc_info,TLLVMMachineCodePlaygroundAssembler); end.