agllvmmc.pas 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {
  2. Copyright (c) 1998-2020 by the Free Pascal team
  3. This unit implements the llvm-mc ("llvm machine code playground")
  4. assembler writer for WebAssembly
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit agllvmmc;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. systems,
  23. globtype,globals,
  24. aasmbase,aasmtai,aasmdata,
  25. assemble,aggas;
  26. type
  27. { TLLVMMachineCodePlaygroundAssembler }
  28. TLLVMMachineCodePlaygroundAssembler=class({texternalassembler}TGNUassembler)
  29. protected
  30. function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
  31. end;
  32. implementation
  33. uses
  34. cutils,
  35. finput,
  36. cpubase;
  37. { TLLVMMachineCodePlaygroundAssembler }
  38. function TLLVMMachineCodePlaygroundAssembler.sectionname(atype: TAsmSectiontype; const aname: string; aorder: TAsmSectionOrder): string;
  39. begin
  40. Result:=inherited sectionname(atype, aname, aorder)+',"",@';
  41. end;
  42. const
  43. as_wasm32_llvm_mc_info : tasminfo =
  44. (
  45. id : as_wasm32_llvm_mc;
  46. idtxt : 'LLVM-MC';
  47. asmbin : 'llvm-mc';
  48. asmcmd : '--assemble --arch=wasm32 --filetype=obj -o $OBJ $EXTRAOPT $ASM';
  49. supported_targets : [system_wasm32_wasm,system_wasm32_wasi];
  50. flags : [];
  51. labelprefix : '.L';
  52. labelmaxlen : -1;
  53. comment : '# ';
  54. dollarsign : '$';
  55. );
  56. initialization
  57. RegisterAssembler(as_wasm32_llvm_mc_info,TLLVMMachineCodePlaygroundAssembler);
  58. end.