# Support for SML/NJ Code Generation using LLVM

This directory tree contains the implementation of a LLVM-based
code generator for SML/NJ. This library takes an ASDL pickle
of the [CFG IR](https://github.com/smlnj/.github/wiki/Informal-Semantics-of-the-CFG-IR)
and produces an in-memory object file that can be either included
in a [binfile](https://github.com/smlnj/.github/wiki/Binfile-Format-and-Linking)
or loaded into the SML heap for execution.

## Directory Roadmap

* `README.md` -- this file
* `cfgc` -- source code for the **cfgc** command-line program, which is a
  program for standalone testing of the code-generation library.
* `compile_flags.txt` -- information to help the **clangd** LSP server
  provide accurate information.
* `config` -- holds configuration template for use when building as a
  top-level project
* `include` -- the API for the code generator library
* `lib-codegen` -- the source for the code generator library
* `lib-heap2obj` -- the source for the heap-to-object-file library
* `tests` -- test XFG pickles for the **cfgc** tool

**WARNING**: the `include` and `lib` directories include the unpickler
code generated by **asdlgen**.  If the CFG IR (or ASDL specification)
changes, then these files (`include/cfg.hpp` and `src/cfg.cpp`) must be
updated.
