Compiler CLI
jiangc compiles Jiang source files. The current compiler can emit LLVM IR, object files, or link an executable through the host C compiler.
Emit LLVM IR
Section titled “Emit LLVM IR”./build/jiangc --emit-llvm tests/samples/minimal.jiangBy default, LLVM IR is written to standard output. Use -o to write it to a file:
./build/jiangc --emit-llvm tests/samples/minimal.jiang -o minimal.llEmit an Object File
Section titled “Emit an Object File”./build/jiangc --emit-obj tests/samples/minimal.jiang -o minimal.oThis stops after object generation and does not link an executable.
Link an Executable
Section titled “Link an Executable”Without an explicit --emit-* mode, jiangc creates a temporary object file and asks the host cc to link an executable:
./build/jiangc tests/samples/minimal.jiang -o minimalThen run:
./minimalecho $?Runtime Boundary
Section titled “Runtime Boundary”The current minimum runtime boundary still uses the host C runtime for low-level services, mainly:
mallocfreeprintfabort
This is expected during the current compiler development stage.