├── .gitignore ├── .travis.yml ├── Cargo.toml ├── LICENSE ├── README.md ├── src ├── ir │ ├── Cargo.toml │ ├── attrs.rs │ ├── block.rs │ ├── cond.rs │ ├── instruction │ │ ├── add.rs │ │ ├── br.rs │ │ ├── call.rs │ │ ├── copy.rs │ │ ├── div.rs │ │ ├── mod.rs │ │ ├── mul.rs │ │ ├── ret.rs │ │ ├── shl.rs │ │ ├── shr.rs │ │ └── sub.rs │ ├── item │ │ ├── function.rs │ │ ├── global.rs │ │ └── mod.rs │ ├── lib.rs │ ├── module.rs │ ├── name.rs │ ├── print.rs │ ├── read │ │ ├── characters.rs │ │ ├── mod.rs │ │ ├── parse.rs │ │ ├── resolve.rs │ │ ├── token.rs │ │ └── tokenizer.rs │ ├── span.rs │ ├── types │ │ ├── array.rs │ │ ├── block.rs │ │ ├── decimal.rs │ │ ├── function.rs │ │ ├── integer.rs │ │ ├── mod.rs │ │ ├── pointer.rs │ │ ├── strukt.rs │ │ ├── vector.rs │ │ └── void.rs │ ├── users.rs │ ├── value │ │ ├── argument_ref.rs │ │ ├── block_ref.rs │ │ ├── expression.rs │ │ ├── function_ref.rs │ │ ├── global_ref.rs │ │ ├── literal │ │ │ ├── decimal.rs │ │ │ ├── integer.rs │ │ │ ├── mod.rs │ │ │ └── strukt.rs │ │ ├── mod.rs │ │ ├── register.rs │ │ ├── register_ref.rs │ │ ├── string.rs │ │ └── value.rs │ └── verifier.rs ├── lib.rs ├── machine │ ├── Cargo.toml │ ├── avr │ │ ├── instruction │ │ │ ├── ldi.rs │ │ │ ├── mod.rs │ │ │ ├── mov.rs │ │ │ ├── rd.rs │ │ │ ├── rdi.rs │ │ │ ├── rdrr.rs │ │ │ └── simple.rs │ │ ├── legalize.rs │ │ ├── mod.rs │ │ ├── registers.rs │ │ ├── select.rs │ │ └── target.rs │ ├── encoded_instruction.rs │ ├── generate.rs │ ├── instruction.rs │ ├── lib.rs │ ├── operand.rs │ ├── pattern.rs │ └── register.rs ├── mir │ ├── Cargo.toml │ ├── branch.rs │ ├── builder.rs │ ├── dag.rs │ ├── expand.rs │ ├── function.rs │ ├── lib.rs │ ├── node.rs │ ├── opcodes.rs │ ├── ty.rs │ ├── value.rs │ └── verifier.rs ├── pass │ ├── Cargo.toml │ ├── analysis │ │ └── mod.rs │ ├── lib.rs │ ├── manager.rs │ ├── registrar.rs │ └── transforms │ │ ├── constant_folding.rs │ │ ├── dce.rs │ │ ├── inliner.rs │ │ ├── ir │ │ └── mod.rs │ │ ├── mod.rs │ │ └── strength_reduction.rs ├── regalloc │ ├── Cargo.toml │ ├── algorithm │ │ ├── idiotic.rs │ │ └── mod.rs │ ├── allocate.rs │ ├── instruction.rs │ ├── lib.rs │ ├── live_variable │ │ ├── build.rs │ │ ├── live_interval.rs │ │ ├── live_range.rs │ │ └── mod.rs │ ├── program.rs │ ├── register.rs │ └── target.rs ├── select │ ├── Cargo.toml │ ├── adjustment.rs │ ├── legalize │ │ ├── action.rs │ │ ├── default.rs │ │ ├── mod.rs │ │ └── operation.rs │ ├── lib.rs │ ├── pattern.rs │ └── selector.rs ├── target │ ├── Cargo.toml │ ├── error.rs │ ├── lib.rs │ └── registry.rs ├── test │ ├── Cargo.toml │ ├── find.rs │ ├── instance.rs │ ├── lib.rs │ ├── print.rs │ ├── test.rs │ └── tool.rs └── util │ ├── Cargo.toml │ ├── architecture.rs │ ├── enums.rs │ ├── id.rs │ ├── lib.rs │ ├── list.rs │ ├── os.rs │ └── set.rs ├── tests ├── avr │ └── isel │ │ ├── add8.ir │ │ ├── basic.ir │ │ ├── complicated.ir │ │ └── ret.ir └── parser │ ├── expressions │ ├── argument_ref.ir │ ├── block_ref.ir │ ├── function_ref.ir │ ├── global_ref.ir │ ├── register.ir │ ├── register_ref.ir │ └── string.ir │ ├── function │ ├── barebones-idiomatic.ir │ ├── barebones-multi-line.ir │ ├── barebones-one-liner.ir │ ├── complex-idiomatic.ir │ ├── implied-entry-block.ir │ ├── return_type.ir │ ├── simple-idiomatic.ir │ ├── simple-multi-liner.ir │ └── simple-one-liner.ir │ ├── global │ └── simple-integer.ir │ └── instructions │ ├── add.ir │ ├── div.ir │ ├── mul.ir │ ├── shl.ir │ ├── shr.ir │ └── sub.ir └── tools ├── asm.rs ├── basic-example.rs ├── opt.rs └── test.rs /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/.gitignore -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/.travis.yml -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/Cargo.toml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/README.md -------------------------------------------------------------------------------- /src/ir/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/Cargo.toml -------------------------------------------------------------------------------- /src/ir/attrs.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/attrs.rs -------------------------------------------------------------------------------- /src/ir/block.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/block.rs -------------------------------------------------------------------------------- /src/ir/cond.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/cond.rs -------------------------------------------------------------------------------- /src/ir/instruction/add.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/add.rs -------------------------------------------------------------------------------- /src/ir/instruction/br.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/br.rs -------------------------------------------------------------------------------- /src/ir/instruction/call.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/call.rs -------------------------------------------------------------------------------- /src/ir/instruction/copy.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/copy.rs -------------------------------------------------------------------------------- /src/ir/instruction/div.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/div.rs -------------------------------------------------------------------------------- /src/ir/instruction/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/mod.rs -------------------------------------------------------------------------------- /src/ir/instruction/mul.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/mul.rs -------------------------------------------------------------------------------- /src/ir/instruction/ret.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/ret.rs -------------------------------------------------------------------------------- /src/ir/instruction/shl.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/shl.rs -------------------------------------------------------------------------------- /src/ir/instruction/shr.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/shr.rs -------------------------------------------------------------------------------- /src/ir/instruction/sub.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/instruction/sub.rs -------------------------------------------------------------------------------- /src/ir/item/function.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/item/function.rs -------------------------------------------------------------------------------- /src/ir/item/global.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/item/global.rs -------------------------------------------------------------------------------- /src/ir/item/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/item/mod.rs -------------------------------------------------------------------------------- /src/ir/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/lib.rs -------------------------------------------------------------------------------- /src/ir/module.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/module.rs -------------------------------------------------------------------------------- /src/ir/name.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/name.rs -------------------------------------------------------------------------------- /src/ir/print.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/print.rs -------------------------------------------------------------------------------- /src/ir/read/characters.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/characters.rs -------------------------------------------------------------------------------- /src/ir/read/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/mod.rs -------------------------------------------------------------------------------- /src/ir/read/parse.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/parse.rs -------------------------------------------------------------------------------- /src/ir/read/resolve.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/resolve.rs -------------------------------------------------------------------------------- /src/ir/read/token.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/token.rs -------------------------------------------------------------------------------- /src/ir/read/tokenizer.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/read/tokenizer.rs -------------------------------------------------------------------------------- /src/ir/span.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/span.rs -------------------------------------------------------------------------------- /src/ir/types/array.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/array.rs -------------------------------------------------------------------------------- /src/ir/types/block.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/block.rs -------------------------------------------------------------------------------- /src/ir/types/decimal.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/decimal.rs -------------------------------------------------------------------------------- /src/ir/types/function.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/function.rs -------------------------------------------------------------------------------- /src/ir/types/integer.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/integer.rs -------------------------------------------------------------------------------- /src/ir/types/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/mod.rs -------------------------------------------------------------------------------- /src/ir/types/pointer.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/pointer.rs -------------------------------------------------------------------------------- /src/ir/types/strukt.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/strukt.rs -------------------------------------------------------------------------------- /src/ir/types/vector.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/vector.rs -------------------------------------------------------------------------------- /src/ir/types/void.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/types/void.rs -------------------------------------------------------------------------------- /src/ir/users.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/users.rs -------------------------------------------------------------------------------- /src/ir/value/argument_ref.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/argument_ref.rs -------------------------------------------------------------------------------- /src/ir/value/block_ref.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/block_ref.rs -------------------------------------------------------------------------------- /src/ir/value/expression.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/expression.rs -------------------------------------------------------------------------------- /src/ir/value/function_ref.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/function_ref.rs -------------------------------------------------------------------------------- /src/ir/value/global_ref.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/global_ref.rs -------------------------------------------------------------------------------- /src/ir/value/literal/decimal.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/literal/decimal.rs -------------------------------------------------------------------------------- /src/ir/value/literal/integer.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/literal/integer.rs -------------------------------------------------------------------------------- /src/ir/value/literal/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/literal/mod.rs -------------------------------------------------------------------------------- /src/ir/value/literal/strukt.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/literal/strukt.rs -------------------------------------------------------------------------------- /src/ir/value/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/mod.rs -------------------------------------------------------------------------------- /src/ir/value/register.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/register.rs -------------------------------------------------------------------------------- /src/ir/value/register_ref.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/register_ref.rs -------------------------------------------------------------------------------- /src/ir/value/string.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/string.rs -------------------------------------------------------------------------------- /src/ir/value/value.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/value/value.rs -------------------------------------------------------------------------------- /src/ir/verifier.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/ir/verifier.rs -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/lib.rs -------------------------------------------------------------------------------- /src/machine/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/Cargo.toml -------------------------------------------------------------------------------- /src/machine/avr/instruction/ldi.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/ldi.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/mod.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/mov.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/mov.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/rd.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/rd.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/rdi.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/rdi.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/rdrr.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/rdrr.rs -------------------------------------------------------------------------------- /src/machine/avr/instruction/simple.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/instruction/simple.rs -------------------------------------------------------------------------------- /src/machine/avr/legalize.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/legalize.rs -------------------------------------------------------------------------------- /src/machine/avr/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/mod.rs -------------------------------------------------------------------------------- /src/machine/avr/registers.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/registers.rs -------------------------------------------------------------------------------- /src/machine/avr/select.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/select.rs -------------------------------------------------------------------------------- /src/machine/avr/target.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/avr/target.rs -------------------------------------------------------------------------------- /src/machine/encoded_instruction.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/encoded_instruction.rs -------------------------------------------------------------------------------- /src/machine/generate.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/generate.rs -------------------------------------------------------------------------------- /src/machine/instruction.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/instruction.rs -------------------------------------------------------------------------------- /src/machine/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/lib.rs -------------------------------------------------------------------------------- /src/machine/operand.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/operand.rs -------------------------------------------------------------------------------- /src/machine/pattern.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/pattern.rs -------------------------------------------------------------------------------- /src/machine/register.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/machine/register.rs -------------------------------------------------------------------------------- /src/mir/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/Cargo.toml -------------------------------------------------------------------------------- /src/mir/branch.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/branch.rs -------------------------------------------------------------------------------- /src/mir/builder.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/builder.rs -------------------------------------------------------------------------------- /src/mir/dag.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/dag.rs -------------------------------------------------------------------------------- /src/mir/expand.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/expand.rs -------------------------------------------------------------------------------- /src/mir/function.rs: -------------------------------------------------------------------------------- 1 | pub struct Function 2 | { 3 | 4 | } 5 | 6 | -------------------------------------------------------------------------------- /src/mir/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/lib.rs -------------------------------------------------------------------------------- /src/mir/node.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/node.rs -------------------------------------------------------------------------------- /src/mir/opcodes.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/opcodes.rs -------------------------------------------------------------------------------- /src/mir/ty.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/ty.rs -------------------------------------------------------------------------------- /src/mir/value.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/value.rs -------------------------------------------------------------------------------- /src/mir/verifier.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/mir/verifier.rs -------------------------------------------------------------------------------- /src/pass/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/Cargo.toml -------------------------------------------------------------------------------- /src/pass/analysis/mod.rs: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/pass/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/lib.rs -------------------------------------------------------------------------------- /src/pass/manager.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/manager.rs -------------------------------------------------------------------------------- /src/pass/registrar.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/registrar.rs -------------------------------------------------------------------------------- /src/pass/transforms/constant_folding.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/transforms/constant_folding.rs -------------------------------------------------------------------------------- /src/pass/transforms/dce.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/transforms/dce.rs -------------------------------------------------------------------------------- /src/pass/transforms/inliner.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/transforms/inliner.rs -------------------------------------------------------------------------------- /src/pass/transforms/ir/mod.rs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/pass/transforms/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/transforms/mod.rs -------------------------------------------------------------------------------- /src/pass/transforms/strength_reduction.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/pass/transforms/strength_reduction.rs -------------------------------------------------------------------------------- /src/regalloc/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/Cargo.toml -------------------------------------------------------------------------------- /src/regalloc/algorithm/idiotic.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/algorithm/idiotic.rs -------------------------------------------------------------------------------- /src/regalloc/algorithm/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/algorithm/mod.rs -------------------------------------------------------------------------------- /src/regalloc/allocate.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/allocate.rs -------------------------------------------------------------------------------- /src/regalloc/instruction.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/instruction.rs -------------------------------------------------------------------------------- /src/regalloc/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/lib.rs -------------------------------------------------------------------------------- /src/regalloc/live_variable/build.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/live_variable/build.rs -------------------------------------------------------------------------------- /src/regalloc/live_variable/live_interval.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/live_variable/live_interval.rs -------------------------------------------------------------------------------- /src/regalloc/live_variable/live_range.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/live_variable/live_range.rs -------------------------------------------------------------------------------- /src/regalloc/live_variable/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/live_variable/mod.rs -------------------------------------------------------------------------------- /src/regalloc/program.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/program.rs -------------------------------------------------------------------------------- /src/regalloc/register.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/register.rs -------------------------------------------------------------------------------- /src/regalloc/target.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/regalloc/target.rs -------------------------------------------------------------------------------- /src/select/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/Cargo.toml -------------------------------------------------------------------------------- /src/select/adjustment.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/adjustment.rs -------------------------------------------------------------------------------- /src/select/legalize/action.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/legalize/action.rs -------------------------------------------------------------------------------- /src/select/legalize/default.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/legalize/default.rs -------------------------------------------------------------------------------- /src/select/legalize/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/legalize/mod.rs -------------------------------------------------------------------------------- /src/select/legalize/operation.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/legalize/operation.rs -------------------------------------------------------------------------------- /src/select/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/lib.rs -------------------------------------------------------------------------------- /src/select/pattern.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/pattern.rs -------------------------------------------------------------------------------- /src/select/selector.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/select/selector.rs -------------------------------------------------------------------------------- /src/target/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/target/Cargo.toml -------------------------------------------------------------------------------- /src/target/error.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/target/error.rs -------------------------------------------------------------------------------- /src/target/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/target/lib.rs -------------------------------------------------------------------------------- /src/target/registry.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/target/registry.rs -------------------------------------------------------------------------------- /src/test/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/Cargo.toml -------------------------------------------------------------------------------- /src/test/find.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/find.rs -------------------------------------------------------------------------------- /src/test/instance.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/instance.rs -------------------------------------------------------------------------------- /src/test/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/lib.rs -------------------------------------------------------------------------------- /src/test/print.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/print.rs -------------------------------------------------------------------------------- /src/test/test.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/test.rs -------------------------------------------------------------------------------- /src/test/tool.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/test/tool.rs -------------------------------------------------------------------------------- /src/util/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/Cargo.toml -------------------------------------------------------------------------------- /src/util/architecture.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/architecture.rs -------------------------------------------------------------------------------- /src/util/enums.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/enums.rs -------------------------------------------------------------------------------- /src/util/id.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/id.rs -------------------------------------------------------------------------------- /src/util/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/lib.rs -------------------------------------------------------------------------------- /src/util/list.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/list.rs -------------------------------------------------------------------------------- /src/util/os.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/os.rs -------------------------------------------------------------------------------- /src/util/set.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/src/util/set.rs -------------------------------------------------------------------------------- /tests/avr/isel/add8.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/avr/isel/add8.ir -------------------------------------------------------------------------------- /tests/avr/isel/basic.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/avr/isel/basic.ir -------------------------------------------------------------------------------- /tests/avr/isel/complicated.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/avr/isel/complicated.ir -------------------------------------------------------------------------------- /tests/avr/isel/ret.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --target avr @file 2 | 3 | fn @main() { 4 | ret 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/expressions/argument_ref.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/argument_ref.ir -------------------------------------------------------------------------------- /tests/parser/expressions/block_ref.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/block_ref.ir -------------------------------------------------------------------------------- /tests/parser/expressions/function_ref.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/function_ref.ir -------------------------------------------------------------------------------- /tests/parser/expressions/global_ref.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/global_ref.ir -------------------------------------------------------------------------------- /tests/parser/expressions/register.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --parse @file 2 | 3 | fn @foo() { 4 | %abc = i32 2 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/expressions/register_ref.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/register_ref.ir -------------------------------------------------------------------------------- /tests/parser/expressions/string.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/expressions/string.ir -------------------------------------------------------------------------------- /tests/parser/function/barebones-idiomatic.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --parse @file 2 | 3 | fn @foo () { 4 | } 5 | -------------------------------------------------------------------------------- /tests/parser/function/barebones-multi-line.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --parse @file 2 | 3 | fn @foo ( 4 | ) 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tests/parser/function/barebones-one-liner.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --parse @file 2 | 3 | fn @abc() { } 4 | 5 | -------------------------------------------------------------------------------- /tests/parser/function/complex-idiomatic.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/function/complex-idiomatic.ir -------------------------------------------------------------------------------- /tests/parser/function/implied-entry-block.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/function/implied-entry-block.ir -------------------------------------------------------------------------------- /tests/parser/function/return_type.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/function/return_type.ir -------------------------------------------------------------------------------- /tests/parser/function/simple-idiomatic.ir: -------------------------------------------------------------------------------- 1 | ; RUN: asm --parse @file 2 | 3 | fn @foo(%a: i32, %b: u11) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/function/simple-multi-liner.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/function/simple-multi-liner.ir -------------------------------------------------------------------------------- /tests/parser/function/simple-one-liner.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/function/simple-one-liner.ir -------------------------------------------------------------------------------- /tests/parser/global/simple-integer.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/global/simple-integer.ir -------------------------------------------------------------------------------- /tests/parser/instructions/add.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/add.ir -------------------------------------------------------------------------------- /tests/parser/instructions/div.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/div.ir -------------------------------------------------------------------------------- /tests/parser/instructions/mul.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/mul.ir -------------------------------------------------------------------------------- /tests/parser/instructions/shl.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/shl.ir -------------------------------------------------------------------------------- /tests/parser/instructions/shr.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/shr.ir -------------------------------------------------------------------------------- /tests/parser/instructions/sub.ir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tests/parser/instructions/sub.ir -------------------------------------------------------------------------------- /tools/asm.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tools/asm.rs -------------------------------------------------------------------------------- /tools/basic-example.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tools/basic-example.rs -------------------------------------------------------------------------------- /tools/opt.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tools/opt.rs -------------------------------------------------------------------------------- /tools/test.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanmckay/compiler/HEAD/tools/test.rs --------------------------------------------------------------------------------