Skip to content

Commit

Permalink
Added llvm support for current version 18. This is for reference only
Browse files Browse the repository at this point in the history
as the bindings cannot be compiled without a couple of changes to llvm
itself. Which I plan to do. These are to do with debug support for
dynamic arrays and subranges. You could possibly comment them out if
you are keen to try. Also this version supports the major change llvm
made to support opaque pointers. As a result m3 llvm is slightly simpler
especially in doing loads and stores. In the IR you will now see things
like ptr somevar instead of i64* somevar. A lot of bitcasts bewteen
i8* and i64* have become redundant.
  • Loading branch information
demoitem committed Apr 9, 2024
1 parent 4499ba5 commit bdf3334
Show file tree
Hide file tree
Showing 17 changed files with 16,945 additions and 0 deletions.
22 changes: 22 additions & 0 deletions m3-sys/llvm/llvm18/src/M3CG_LLVM.i3
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
INTERFACE M3CG_LLVM;

IMPORT M3CG,Wr;

TYPE
U <: Public;

Public = M3CG.T OBJECT
METHODS
dumpLLVMIR(BitcodeFileName, AsmFileName: TEXT);
END;

TYPE m3llvmDebugLevTyp = [ 0 .. 5 ]; (* Just leave some space here. *)

(* returns a fresh, initialized code generator that writes LLVM IR
as bitcode to 'wr_bin' and as LLVM assembly to 'wr_char'.
Either may be NIL. *)
PROCEDURE New
(output: Wr.T; targetTriple,dataRep : TEXT; m3llvmDebugLev: m3llvmDebugLevTyp; genDebug: BOOLEAN)
: M3CG.T;

END M3CG_LLVM.
Loading

0 comments on commit bdf3334

Please sign in to comment.