Crate CodeGenLib

Source
Expand description

CodeGenLib is a rust libary to generate x86-64Bit machine code (like llvm)

Example

use CodeGenLib::{Builder, ArtifactError}
 
pub fn main() -> Result<(), ArtifactError> {
   let mut builder = Builder::new();

   builder.add_function("call")
    .call("callme")
    .ret_int(1);
    
   builder.build("test.o")?;
    
   Ok(())
}

The examples would make a elf file with a function named call wich just calls a function named callme and then returns a 1

Re-exports§

pub use x86::function::Function;
pub use x86::builder::Builder;
pub use x86::mem::AdressManager;
pub use opt::optimize::Optimize as OptimizeTrait;
pub use error::Result;
pub use error::CodeGenLibError;
pub use arch::def::Arch;
pub use jit::typed::JitRuntime as Jit;
pub use x86::*;

Modules§

arch
error
jit
opt
x86
The sublibary for x86-64Bit CodeGeneration

Enums§

ArtifactError
ArtifactError exportet from the faerie crate The kinds of errors that can befall someone creating an Artifact