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§

Modules§

Enums§

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