Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cr0a3/codegenlib
A x86-64Bit code generator (like LLVM)
https://github.com/cr0a3/codegenlib
code-generation codegen llvm rust x86-64
Last synced: 3 months ago
JSON representation
A x86-64Bit code generator (like LLVM)
- Host: GitHub
- URL: https://github.com/cr0a3/codegenlib
- Owner: Cr0a3
- License: mpl-2.0
- Created: 2024-03-23T09:58:14.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-08T18:30:45.000Z (8 months ago)
- Last Synced: 2024-09-30T03:41:02.697Z (3 months ago)
- Topics: code-generation, codegen, llvm, rust, x86-64
- Language: Rust
- Homepage:
- Size: 471 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
A libary to generate x86-64Bit machine code
> **Warning:** this libary is currently undergoing big changes so don't use in production
## Example
```rust
use CodeGenLib::prelude::*;#[rustfmt::skip]
pub fn main() -> Result<(), Box> {
let mut builder = IrBuilder::new(Target::host());let add = builder.add("add");
add.args(vec![
("x", Type::u64(0) ),
("y", Type::u64(0) ),
]);add.vars(vec![
("z", Type::u64(0) ),
]);add.build_add("x", "y", "z")?;
add.build_return_var("z")?;add.set_public();
builder.write("tmp/ir.o")?;
Ok(())
}
```## Documentation
[ToDo]## Copyright
Copyright (C) 2024 Cr0a3