Skip to content

a high-level IR that supports compile-time evalution

Notifications You must be signed in to change notification settings

plos-clan/cte_ir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTE IR

CTE ( compile-time evalution ) IR is a high-level IR. In this IR, all the types are values. It is designed to support compile-time evaluation.

Example

IR

%0 = add 1,2;

Builder

This code is included in this file. You can also see other examples in the examples directory.

use cte_ir::{builder::ValueBuilder, ir::*};

pub fn main() {
    let mut program = Program::new();

    let mut value_builder = program.new_value();

    let one = value_builder.integer(1);
    let two = value_builder.integer(2);

    let add = value_builder.add(one, two);

    program.instructions_mut().push_back(None, add);

    println!("{}", program);
}

About

a high-level IR that supports compile-time evalution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages